00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef CLOUDSATFILEDATA_H
00021 #define CLOUDSATFILEDATA_H
00022
00023 #include "hdffiledata.h"
00024 #include "pixel.h"
00025 #include "satellitefiledata.h"
00026
00031 class CLOUDSATFileData : public SatelliteFileData, public HDFFileData {
00032 static const float colocation_tolerance;
00033
00034
00036 string latitude_name;
00038 string longitude_name;
00040 static const string time_name;
00042 static const string time_origin_name;
00043
00044
00046 string product;
00048 string version;
00050 int lat_lon_index_max;
00052 short orbit_nb;
00053
00057 void init();
00061 void set_time_coverage();
00066 void parse_filename(const string & short_filename);
00071 bool check_filename(const string & short_filename);
00075 void set_lat_lon_index_max();
00076 public:
00078 static const int nb_vbins=125;
00080 static const int nb_profile_max=40000;
00082 static const int nb_layers=5;
00088 CLOUDSATFileData(const string &name, const string &mode="r");
00092 virtual ~CLOUDSATFileData();
00097 void load_geolocation_data();
00102 void free_geolocation_data();
00103
00112 const bool contain_location(const float &lat,const float &lon, const double &tolerance=0.01);
00123 const bool contain_data(const float &lat, const float &lon, const double &time, const double &colocation_tolerance=0.01) ;
00132 const float get_nearest_point_distance(const float &lat,const float &lon,const float coloc_tolerance=CLOUDSATFileData::colocation_tolerance);
00137 string get_product() const { return product; }
00142 string get_version() const { return version; }
00152 const bool get_index(const float &lat, const float& lon, int &nearest_pix_idx, const float colocation_tolerance=0.01);
00161 virtual void get_vindex(vector < vector < int > > &v_index, const float &lat, const float& lon,
00162 const float colocation_tolerance=0.01 ) {
00163 UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00164 throw e;
00165 };
00166
00171 const int get_nb_geo_points() { return lat_lon_index_max + 1; }
00175 virtual void load_v_pixel() ;
00179 virtual void close_data_file() {
00180 free_hdf_file();
00181 };
00185 virtual void open_data_file() {
00186 load_hdf_file();
00187 };
00195 virtual void get_pixel_coord ( const vector < int > & ipix, float &lat, float &lon, double &time ) {
00196 if (!is_geolocation_data_loaded())
00197 load_geolocation_data();
00198 lat = lat_data [ ipix[0] ];
00199 lon = lon_data [ ipix[0] ];
00200 time = time_data [ ipix[0] ];
00201 };
00202 };
00203
00204 #endif