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

/home/pascal/depot/filedata/src/cloudsatfiledata.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 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     /***** CLOUDSAT constants *****/
00036     string latitude_name;
00038     string longitude_name;
00040     static const string time_name;
00042     static const string time_origin_name;
00043 
00044     /***** Product characteristics *****/
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

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