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

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

00001 /***************************************************************************
00002  *   Copyright (C) 2011 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 DARDARFILEDATA_H
00021 #define DARDARFILEDATA_H
00022 
00023 #include "cloudsatfiledata.h"
00024 
00029 class DARDARFileData : public SatelliteFileData, public HDFFileData {
00030     static const float colocation_tolerance;
00031 
00032     /***** constants *****/
00034     string latitude_name;
00036     string longitude_name;
00038     string time_name;
00042     enum Product_ID {
00043         UNDEFINED = 0,
00044         DARDAR_CLOUD,
00045         DARDAR_MASK,
00046     };
00047 
00048     /***** Product characteristics *****/
00050     Product_ID product_id;
00052     string product;
00054     string version;
00056     int lat_lon_index_max;
00058     short orbit_nb;
00059 
00064     void parse_filename(const string & short_filename);
00069     bool check_filename(const string & short_filename);
00073     void init();
00077     void set_lat_lon_index_max();
00081     void set_time_coverage();
00082 public:
00084     static const int nb_dardar_bin=436;
00086     static const int16 dardar_height [];
00092     DARDARFileData(const string &name, const string &mode="r");
00096     ~DARDARFileData();
00101     void load_geolocation_data();
00106     void free_geolocation_data();
00110     void load_v_pixel() ;
00114     void close_data_file() {
00115         free_hdf_file();
00116     };
00120     void open_data_file() {
00121         load_hdf_file();
00122     };
00127     const int get_nb_geo_points() { return lat_lon_index_max + 1; }
00132     string get_product() const { return product; }
00137     string get_version() const { return version; }
00138 
00147     const bool contain_location(const float &lat,const float &lon, const double &tolerance=0.01);
00158     const bool contain_data(const float &lat, const float &lon, const double &time, const double &colocation_tolerance=0.01) ;
00167     const float get_nearest_point_distance(const float &lat,const float &lon,const float coloc_tolerance=DARDARFileData::colocation_tolerance);
00177      virtual const bool get_index(const float &lat, const float& lon, int &nearest_pix_idx, const float colocation_tolerance=0.01);
00186      void get_vindex(vector < vector < int > > &v_index, const float &lat, const float& lon,
00187                                             const float colocation_tolerance=0.01 ) {
00188         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00189         throw e;
00190      };
00198     void get_pixel_coord ( const vector < int > & ipix, float &lat, float &lon, double &time ) {
00199         get_pixel_coord (ipix[0], lat, lon, time);
00200     };
00208     void get_pixel_coord ( const int ipix, float &lat, float &lon, double &time ) {
00209         if (!is_geolocation_data_loaded())
00210             load_geolocation_data();
00211         lat  = lat_data  [ ipix ];
00212         lon  = lon_data  [ ipix ];
00213         time = time_data [ ipix ];
00214     };
00215 
00220     static const int16* get_dardar_height() {
00221         return DARDARFileData::dardar_height;
00222     }
00223 
00224 };
00225 
00226 #endif

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