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

/home/pascal/depot/filedata/src/ceresfiledata.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 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 // // // //    float *lat_data; /** the latitudes */
00040 // // // //    float *lon_data; /** the longitudes */
00041 // // // //    double *time_data; /** the times */
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     ***  CONSTRUCTORS/DESTRUCTORS  ***
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     ***         GETTERS/SETTERS        ***
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

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