00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef IIRFILEDATA_H
00021 #define IIRFILEDATA_H
00022
00023 #include "hdffiledata.h"
00024 #include "pixel.h"
00025 #include "satellitefiledata.h"
00026
00027 static const int GET_SHOT_TIME_INDEX_TRACE=0;
00028 static const int BRUTE_FORCE_SEARCH=1;
00029
00035 class IIRFileData : public SatelliteFileData, public HDFFileData {
00036
00037 public:
00041 enum ProductType{
00042 UNDEFINED,
00043 L1,
00044 L2_TRACK,
00045 L2_SWATH,
00046 };
00048 static const int IIR_swath_size;
00050 static const int nb_record_max;
00051
00052 private:
00056 int level;
00060 ProductType product_type;
00064 bool day_mode;
00065
00066
00067
00068
00069
00071 vector<PixelType> v_pixel;
00072
00073 static const string latitude_sds_name;
00074 static const string longitude_sds_name;
00076 string time_sds_name;
00078 static const float colocation_tolerance;
00079
00080 int lat_lon_index_max[2];
00081
00082 void init();
00088 void check_filename( const string& short_filename ) const;
00096 void parse_filename( const string& short_filename );
00097 void set_time_coverage();
00098 void set_lat_lon_index_max();
00099 protected:
00103 virtual void load_v_pixel() ;
00104
00105 public:
00111 IIRFileData(const string& _name="", const string& mode="r");
00115 ~IIRFileData();
00120 const bool is_day() const;
00125 void get_latitude_data(float* data);
00130 void get_longitude_data(float* data);
00135 void get_time_data(double* data);
00140 const int get_track_size() const ;
00145 const int get_swath_size() const ;
00146
00157 const bool get_index(const float &lat, const float& lon, const double &time, int * near_point_idx, const float coloc_tolerance=IIRFileData::colocation_tolerance);
00165 const int get_nearest_point_index( const float &lat, const float &lon,const double &time);
00173 const bool contains_data_at(const float &lat,const float &lon, const double &time) const;
00177 void load_geolocation_data();
00181 void free_geolocation_data();
00186 const bool is_geolocation_data_loaded() const;
00187
00197 const bool get_index(const float &lat, const float& lon, int &nearest_pix_idx, const float colocation_tolerance=IIRFileData::colocation_tolerance);
00198
00207 const float get_nearest_point_distance(const float &lat,const float &lon,const float coloc_tolerance=IIRFileData::colocation_tolerance);
00216 const bool contain_location(const float &lat,const float &lon, const double &tolerance=IIRFileData::colocation_tolerance);
00227 const bool contain_data(const float &lat, const float &lon, const double &time, const double &colocation_tolerance=IIRFileData::colocation_tolerance) ;
00235 virtual void get_pixel_coord ( const vector < int > & ipix, float &lat, float &lon, double &time ) {
00236 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00237 throw e;
00238 };
00239
00248 virtual void get_vindex(vector < vector < int > > &v_index, const float &lat, const float& lon,
00249 const float colocation_tolerance ) {
00250 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00251 throw e;
00252 };
00256 virtual void close_data_file() {
00257 free_hdf_file();
00258 };
00262 virtual void open_data_file() {
00263 load_hdf_file();
00264 };
00265
00266 };
00267
00268 #endif