00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DARDARFILEDATA_H
00021 #define DARDARFILEDATA_H
00022
00023 #include "cloudsatfiledata.h"
00024
00029 class DARDARFileData : public SatelliteFileData, public HDFFileData {
00030 static const float colocation_tolerance;
00031
00032
00034 string latitude_name;
00036 string longitude_name;
00038 string time_name;
00042 enum Product_ID {
00043 UNDEFINED = 0,
00044 DARDAR_CLOUD,
00045 DARDAR_MASK,
00046 };
00047
00048
00050 Product_ID product_id;
00052 string product;
00054 string version;
00056 int lat_lon_index_max;
00058 short orbit_nb;
00059
00064 void parse_filename(const string & short_filename);
00069 bool check_filename(const string & short_filename);
00073 void init();
00077 void set_lat_lon_index_max();
00081 void set_time_coverage();
00082 public:
00084 static const int nb_dardar_bin=436;
00086 static const int16 dardar_height [];
00092 DARDARFileData(const string &name, const string &mode="r");
00096 ~DARDARFileData();
00101 void load_geolocation_data();
00106 void free_geolocation_data();
00110 void load_v_pixel() ;
00114 void close_data_file() {
00115 free_hdf_file();
00116 };
00120 void open_data_file() {
00121 load_hdf_file();
00122 };
00127 const int get_nb_geo_points() { return lat_lon_index_max + 1; }
00132 string get_product() const { return product; }
00137 string get_version() const { return version; }
00138
00147 const bool contain_location(const float &lat,const float &lon, const double &tolerance=0.01);
00158 const bool contain_data(const float &lat, const float &lon, const double &time, const double &colocation_tolerance=0.01) ;
00167 const float get_nearest_point_distance(const float &lat,const float &lon,const float coloc_tolerance=DARDARFileData::colocation_tolerance);
00177 virtual const bool get_index(const float &lat, const float& lon, int &nearest_pix_idx, const float colocation_tolerance=0.01);
00186 void get_vindex(vector < vector < int > > &v_index, const float &lat, const float& lon,
00187 const float colocation_tolerance=0.01 ) {
00188 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00189 throw e;
00190 };
00198 void get_pixel_coord ( const vector < int > & ipix, float &lat, float &lon, double &time ) {
00199 get_pixel_coord (ipix[0], lat, lon, time);
00200 };
00208 void get_pixel_coord ( const int ipix, float &lat, float &lon, double &time ) {
00209 if (!is_geolocation_data_loaded())
00210 load_geolocation_data();
00211 lat = lat_data [ ipix ];
00212 lon = lon_data [ ipix ];
00213 time = time_data [ ipix ];
00214 };
00215
00220 static const int16* get_dardar_height() {
00221 return DARDARFileData::dardar_height;
00222 }
00223
00224 };
00225
00226 #endif