00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef FILEDATA_H
00027 #define FILEDATA_H
00028
00029 #include "g_exception.h"
00030 #include "filedataexception.h"
00031 #include "statistic.h"
00032 #include "geometry.h"
00033 #include "observation.h"
00034
00040 class FileData {
00041 protected:
00045 string name;
00049 string mode;
00053 Date *date;
00057 double time_coverage;
00062 void set_name( const string & name ) { this->name=name; };
00067 void set_date(const Date& d) {
00068 if (&d!=NULL)
00069 *date = d;
00070 };
00071 public:
00081 FileData(const string &name = "",const string &mode = "r");
00086 FileData(const FileData &fd);
00087
00093 FileData &operator= (const FileData &fd);
00097 virtual ~FileData();
00102 const string get_name() const { return name; };
00107 virtual string get_filename(){
00108 return get_name();
00109 };
00114 const Date get_date() const { return *date; }
00121 const bool contain_time(const double time=-1.) const;
00122
00134 virtual void* read_data(void* data, const char* sds_name, int * start = NULL, int * stride = NULL, int * edges = NULL, int rank = -1) = 0;
00135
00136 double get_time_coverage() const {
00137 return time_coverage;
00138 };
00143 virtual void close_data_file() {
00144 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00145 throw e;
00146 };
00151 virtual void open_data_file() {
00152 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00153 throw e;
00154 };
00163 virtual const bool contain_location(const float &lat,const float &lon, const double &tolerance) {
00164 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00165 throw e;
00166 };
00178 virtual const bool contain_data(const float &lat, const float &lon, const double &time, const double &colocation_tolerance) {
00179 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00180 throw e;
00181 };
00187 static void check_geolocation (const float lat, const float lon);
00193 virtual void load_geolocation_data() {
00194 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00195 throw e;
00196 };;
00201 virtual void free_geolocation_data() {
00202 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00203 throw e;
00204 };;
00209 virtual const bool is_geolocation_data_loaded() const {
00210 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00211 throw e;
00212 };
00219 virtual void get_dataset_fill_value(const string &ds_name, void * fillvalue) {
00220 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00221 throw e;
00222 };
00228 virtual vector<int> get_dataset_dimension(const string &sds_name) {
00229 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00230 throw e;
00231 };
00237 template<class X>
00238 void get_fillValue(const string & ds_name, X & fillValue) {
00239 get_fillValue(ds_name, (void*)&fillValue);
00240 };
00241 virtual void get_fillValue(const string &ds_name, void *fillValue) {
00242 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00243 throw e;
00244 };
00245 template<class X>
00246 void get_fill_value(const string & ds_name, X & fillValue) {
00247 get_fill_value(ds_name, (void*)&fillValue);
00248 };
00249 virtual void get_fill_value(const string &ds_name, void * fillValue) {
00250 get_fillValue(ds_name, (void*)&fillValue);
00251 };
00255 virtual bool is_viewing_directions_data_loaded() {
00256 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00257 throw e;
00258 };
00262 virtual void load_viewing_directions_data () {
00263 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00264 throw e;
00265 };
00269 virtual void free_viewing_directions_data () {
00270 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00271 throw e;
00272 };
00278 virtual void get_viewing_directions (const vector <int> & ipix, vector <Observation> & v_obs) {
00279 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00280 throw e;
00281 };
00282 };
00283
00284 #endif
00285