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

/home/pascal/depot/filedata/src/satellitefiledata.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 
00021 
00022 #ifndef SATELLITEFILEDATA_H
00023 #define SATELLITEFILEDATA_H
00024 
00025 #include "filedata.h"
00026 #include "pixel.h"
00027 #include "geometry.h"
00028 #include "viewing_geometry.h"
00029 #include "observation.h"
00030 #include <map>
00031 
00032 class SatelliteFileData : virtual public FileData {
00033 protected:
00034     // define types for coincident pixels search
00035     typedef P_Pixel_base<float, vector <int> > PixelType;
00036     typedef vector<PixelType>::iterator I_Pixel;
00037 
00038     /***** Geolocation buffers *****/
00040     float *lat_data;
00042     float *lon_data;
00044     double *time_data;
00046     vector< PixelType > v_pixel;
00048     typedef vector <int> PixelIndice;
00049     std::map <PixelIndice, Carthesian::Segment3D> viewing_directions;
00051     typedef vector <int> DataIndice;
00052     std::map <PixelIndice, DataIndice> ipix2idata;
00053 
00054 public:
00055     SatelliteFileData(const string &name, const string &mode/*= "r"*/) : FileData(name,mode) {
00056         lat_data  = NULL;
00057         lon_data  = NULL;
00058         time_data = NULL;
00059     };
00063     virtual ~SatelliteFileData();
00064 
00072     virtual const bool contain_data(const float &lat,const float &lon, const double &time, const double &tolerance)=0;
00073 
00082      virtual const bool contain_location(const float &lat,const float &lon, const double &tolerance)=0 ;
00083 
00093      virtual const bool get_index(const float &lat, const float& lon, int &nearest_pix_idx, const float colocation_tolerance)=0;
00094 
00103      virtual void get_vindex(vector < vector < int > > &v_index, const float &lat, const float& lon, const float colocation_tolerance) = 0;
00104 
00105      virtual const float get_nearest_point_distance(const float &lat, const float &lon, const float coloc_tolerance)=0;
00110     virtual void load_geolocation_data()=0;
00114     virtual void free_geolocation_data();
00118     virtual const bool is_geolocation_data_loaded() const;
00119 
00123     virtual void close_data_file()=0;
00124 
00128     virtual void open_data_file()=0;
00132     virtual void load_v_pixel() = 0;
00136     virtual void free_v_pixel();
00141     virtual const vector< PixelType > & get_v_pixel() const {
00142         return v_pixel;
00143     }
00151     virtual void get_pixel_coord ( const vector < int > & ipix, float &lat, float &lon, double &time ) = 0;
00156     float* get_lat_data() const {
00157         return lat_data;
00158     }
00163     float* get_lon_data() const {
00164         return lon_data;
00165     }
00170     double* get_time_data() const {
00171         return time_data;
00172     }
00176 //     virtual void load_viewing_directions () {
00177 //         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00178 //         throw e;
00179 //     };
00183 //     virtual void free_viewing_directions ();
00187 //     void print_viewing_directions ();
00192     virtual void load_pix2data_map () {
00193         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00194         throw e;
00195     };
00199     void print_pix2data_map ();
00203     void free_pix2data_map ();
00208 //     const std::map< PixelIndice, Carthesian::Segment3D > & get_viewing_directions() const {
00209 //         return viewing_directions;
00210 //     }
00216 //     const Carthesian::Segment3D & get_viewing_direction(const PixelIndice & ipix) {
00217 //         return viewing_directions[ipix];
00218 //     }
00224     virtual void get_viewing_directions (const vector <int> & ipix, vector <Observation> & v_obs){v_obs.clear();};
00228     virtual bool is_viewing_directions_data_loaded() {return false;};
00232     virtual void load_viewing_directions_data () {;};
00236     virtual void free_viewing_directions_data () {;};
00237 };
00238 
00239 #endif
00240 

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