• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/home/pascal/depot/filedata/src/iirfiledata.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Nicolas PASCAL                                  *
00003  *   nicolas.pascal@icare.univ-lille1.fr                                   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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 // // // //     float *lat_data;
00067 // // // //     float *lon_data;
00068 // // // //     double *time_data;
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

Generated on Thu Feb 14 2013 17:59:03 for filedata.kdevelop by  doxygen 1.7.1