00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef CERESFILEDATA_H
00021 #define CERESFILEDATA_H
00022
00023 #include "hdffiledata.h"
00024 #include "satellitefiledata.h"
00025
00031 class CERESFileData : public SatelliteFileData, public HDFFileData {
00032
00033 protected:
00034 string product;
00035 string platform;
00036 string instrument;
00037 string version;
00038
00039
00040
00041
00042
00043 static const string latitude_sds_name;
00044 static const string longitude_sds_name;
00045 static const float colocation_tolerance;
00046
00047 int lat_lon_index_max[1];
00049 void init();
00050 void parse_filename(const string & short_filename);
00051 bool check_filename(const string & short_filename) const;
00052
00053 const string get_time_sds_name(const string product="") const{
00054 return "Time of observation";
00055 };
00059 virtual void load_v_pixel() {
00060 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00061 throw e;
00062 };
00063 public:
00064
00065
00066
00072 CERESFileData(const string& name, const string& mode="r");
00076 ~CERESFileData();
00082 static const float get_ceres_lon(const float & lon);
00088 static const float get_ceres_lat(const float & lat);
00092 void set_lat_lon_index_max();
00093
00094
00095
00100 const string get_product() const {
00101 return product;
00102 }
00107 const string get_platform() const {
00108 return platform;
00109 }
00114 const string get_instrument() const {
00115 return instrument;
00116 }
00121 const string get_version() const {
00122 return version;
00123 }
00129 const string get_radix() const;
00141 virtual const bool get_index(const float &lat, const float& lon, const double time, int &index, const float coloc_tolerance=CERESFileData::colocation_tolerance);
00152 virtual const float get_nearest_point_distance(const float &lat,const float &lon, int &coincidence_idx ,float coloc_tolerance=CERESFileData::colocation_tolerance);
00159 virtual const bool contain_location(const float &lat,const float &lon, float tolerance=CERESFileData::colocation_tolerance);
00164 virtual void load_geolocation_data();
00168 virtual void free_geolocation_data();
00172 virtual const bool is_geolocation_data_loaded() const;
00177 const int get_nb_geo_points() const;
00187 const bool get_index(const float &lat, const float& lon, int &nearest_pix_idx, const float colocation_tolerance=CERESFileData::colocation_tolerance);
00196 virtual void get_vindex(vector < vector < int > > &v_index, const float &lat, const float& lon,
00197 const float colocation_tolerance=CERESFileData::colocation_tolerance ) {
00198 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00199 throw e;
00200 };
00201
00210 const float get_nearest_point_distance(const float &lat,const float &lon,const float coloc_tolerance=CERESFileData::colocation_tolerance);
00219 const bool contain_location(const float &lat,const float &lon, const double &tolerance=CERESFileData::colocation_tolerance);
00230 const bool contain_data(const float &lat, const float &lon, const double &time, const double &colocation_tolerance=CERESFileData::colocation_tolerance) ;
00234 virtual void close_data_file() {
00235 free_hdf_file();
00236 };
00240 virtual void open_data_file() {
00241 load_hdf_file();
00242 };
00250 virtual void get_pixel_coord ( const vector < int > & ipix, float &lat, float &lon, double &time ) {
00251 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00252 throw e;
00253 };
00254 };
00255
00256 #endif