/*************************************************************************** * Copyright (C) 2005 by Nicolas PASCAL * * nicolas.pascal@icare.univ-lille1.fr * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef PARASOLFILERECORD_H #define PARASOLFILERECORD_H #include #include "tools.h" #include "g_exception.h" #define MAX_PARAM 400 #include using namespace std; /** maximum number of viewing directions */ static const int MAX_PARASOL_DIRECTION=16; /** maximum number of acquisition sequences */ static const int NB_MAX_PARASOL_SEQUENCE = 130; /** maximum number of acquired images during a sequence */ static const int NB_MAX_PARASOL_IMAGE_PER_SEQUENCE = 9; /** * represents which leader file record we are working on. */ enum Record{ // leader file record LEADER_FILE_DESCRIPTOR = 0, HEADER, SPATIO_TEMPORAL_CHARACTERISTICS, INSTRUMENT_SETTING_PARAMETERS, TECHNOLOGICAL_PARAMETERS, DATA_PROCESSING_PARAMETERS, SCALING_FACTORS, ANNOTATIONS, // data file record DATA_FILE_DESCRIPTOR, DATA }; /** * This class is designed to store the values read in one PARASOL leader file record. It is only an abstract interface for more specialized classes, and so can't be instantiated as itself. The implementations for one specific record can be seen above. * See PARASOL leader file format classes for description * @author Nicolas PASCAL */ class PARASOLFileRecord{ public: unsigned int rec_nb; /**< Record Number in the file */ unsigned short rec_len; /**< Length of this record */ PARASOLFileRecord(){}; virtual ~PARASOLFileRecord(){}; /** * @brief access to each attribute for writing it * Method set for retrocompatibility * @param entry_index the index of the entry in the record * @param val_index the index of the value to read (ex : the parameter number for the scaling factors) * What is called group is many following entries that are repeated * @return a pointer to the attribute to read */ virtual void* get_entry(const int& entry_index, const int val_index) { vector v_ival (1); v_ival [0] = val_index; return get_entry(entry_index, v_ival); }; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ virtual void* get_entry(const int& entry_index, const vector v_ival = vector (0)) = 0; }; /** * Store the PARASOL files descriptor record values. */ class LeaderFileDescriptorRecord : public PARASOLFileRecord { public: char ref_doc_id[12+1]; /**< Reference Document Identification */ char ref_doc_version[6+1]; /**< Reference Document Version Number */ char soft_version[6+1]; /**< Software Version Number */ char file_nb[4+1]; /**< File Number */ char filename[16+1]; /**< File Name */ unsigned int nb_header_rec; /**< Number of "Header" records in the file */ unsigned int header_rec_len; /**< Length of the "Header" record */ unsigned int nb_spatio_temp_char_rec; /**< Number of "Spatio-Temporal Characteristics" records in the file */ unsigned int spatio_temp_char_rec_len; /**< Length of the "Spatio-Temporal Characteristics" record */ unsigned int nb_instr_setting_param_rec; /**< Number of "Instrument setting parameters" records in the file */ unsigned int instr_setting_param_rec_len; /**< Length of the "Instrument setting parameters" record */ unsigned int nb_tech_param_rec; /**< Number of "Technological parameters" records in the file */ unsigned int tech_param_rec_len; /**< Length of the "Technological parameters" record */ unsigned int nb_data_proc_param_rec; /**< Number of "Data processing parameters" records in the file */ unsigned int data_proc_param_rec_len; /**< Length of the "Data processing parameters" record */ unsigned int nb_scaling_factor_rec; /**< Number of "Scaling factors" records in the file */ unsigned int scaling_factor_rec_len; /**< Length of the "Scaling factors" record */ unsigned int nb_annot_rec; /**< Number of "Annotation" records in the file */ unsigned int annot_rec_len; /**< Length of the "Annotation" record */ /** * @brief constructor : put the end-of-string characters */ LeaderFileDescriptorRecord(){ ref_doc_id[12]='\0'; ref_doc_version[6]='\0'; soft_version[6]='\0'; file_nb[4]='\0'; filename[16]='\0'; }; ~LeaderFileDescriptorRecord(){}; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); /** * @brief access a specific record size. * If the record isn't defined for the product, return 0 * @param record a PARASOL leader file record * @return the record size */ const int get_record_size(const Record& record); }; /** * Store the PARASOL header record values. */ class HeaderRecord : public PARASOLFileRecord { public: char phone_nb[16+1]; /**< Information Point Phone Number */ char product_id[16+1]; /**< Product Identification */ char sat_id[8+1]; /**< Satellite identificator */ char instr_id[8+1]; /**< Instrument identificator */ char spatial_cover[16+1]; /**< Spatial Coverage */ char pix_size[8+1]; /**< Pixel size of the POLDER/Parasol grid */ char ellips_name[30+1]; /**< Name of the ellipsoid used for the data registration */ char ellips_minor_axis_len[12+1]; /**< Length of the ellipsoid minor axis */ char ellips_major_axis_len[12+1]; /**< Length of the ellipsoid major axis */ char DEM_name[30+1]; /**< Name of the DEM used for the data registration */ char DEM_spatial_res_lat[8+1]; /**< Spatial resolution of the DEM along the latitudes */ char DEM_spatial_res_lon[8+1]; /**< Spatial resolution of the DEM along the longitudes */ /** * @brief constructor : put the end-of-string characters */ HeaderRecord(){ phone_nb[16]='\0'; product_id[16]='\0'; sat_id[8]='\0'; instr_id[8]='\0'; spatial_cover[16]='\0'; pix_size[8]='\0'; ellips_name[30]='\0'; ellips_minor_axis_len[12]='\0'; ellips_major_axis_len[12]='\0'; DEM_name[30]='\0'; DEM_spatial_res_lat[8]='\0'; DEM_spatial_res_lon[8]='\0'; }; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * Store the PARASOL SpatioTemporalCharacteristics record values. */ class SpatioTemporalCharacteristicsRecord : public PARASOLFileRecord { public: char cycle_nb[4+1]; /**< Cycle number */ char orbit_nb[4+1]; /**< Orbit Number in the cycle */ char subsat_track_nb[4+1]; /**< Sub satellite track number */ char desc_node_lon[8+1]; /**< Descending Node Longitude */ char desc_node_date[16+1]; /**< Descending Node date */ char first_acq_date[16+1]; /**< Date first acquisition */ char last_acq_date[16+1]; /**< Date last acquisition */ char nb_seq[4+1]; /**< Number of sequences */ char line_nb_northern_pix[4+1]; /**< Line number of northern most pixel */ char line_nb_southern_pix[4+1]; /**< Line number of southern most pixel */ /** * @brief constructor : put the end-of-string characters */ SpatioTemporalCharacteristicsRecord(){ cycle_nb[4]='\0'; orbit_nb[4]='\0'; subsat_track_nb[4]='\0'; desc_node_lon[8]='\0'; desc_node_date[16]='\0'; first_acq_date[16]='\0'; last_acq_date[16]='\0'; nb_seq[4]='\0'; line_nb_northern_pix[4]='\0'; line_nb_southern_pix[4]='\0'; }; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * Store the PARASOL InstrumentSettingParameters record values. */ class InstrumentSettingParametersRecord : public PARASOLFileRecord { public: char SIA_duration[8+1]; /**< SIA duration */ char LIA_duration[8+1]; /**< LIA duration */ char integration_time_def_type_A[16+1]; /**< Integration Time Definition for sequence type A */ char integration_time_def_type_B[16+1]; /**< Integration Time Definition for sequence type B */ unsigned char seq_type[16]; /**< Sequence Type : 16 bytes of bit flags */ char analog_gain_nb[8+1]; /**< Analogic Gain Number */ /** * @brief constructor : put the end-of-string characters */ InstrumentSettingParametersRecord(){ SIA_duration[8]='\0'; LIA_duration[8]='\0'; integration_time_def_type_A[16]='\0'; integration_time_def_type_B[16]='\0'; analog_gain_nb[8]='\0'; }; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * @class TechnologicalParametersRecord PARASOL Technological Parameters records storage, as read in the leader file */ class TechnologicalParametersRecord : public PARASOLFileRecord { public: char seq_nb[4 + 1]; /**< Sequence Number */ char intern_lens_temp [8 + 1]; /**< Internal lens temperature during the sequence (Celsius degrees) */ char extern_lens_temp [8 + 1]; /**< External lens temperature during the sequence (Celsius degrees) */ char short_acq_time_duration [8 + 1]; /**< Short Acquisition Time duration (ms) */ char long_acq_time_duration [8 + 1]; /**< Long Acquisition Time duration (ms) */ // sequential group entries char img_nb [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [2 + 1] ; /**< Image Number : i (0≤i≤9). i=im if the sequence was acquired and processed; i=0 otherwise */ char time_acq [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [16 + 1]; /**< Date and UT time of the acquisition of image #1 in sequence is : yyyymmddhhmmsscc */ char x_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [16 + 1]; /**< X component of the Parasol position during acquisition of image #1 in the sequence (km) */ char y_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [16 + 1]; /**< Y component of the Parasol position during acquisition of image #1 in the sequence (km) */ char z_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [16 + 1]; /**< Z component of the Parasol position during acquisition of image #1 in the sequence (km) */ char vx_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [16 + 1]; /**< Vx component of the Parasol speed vector during the acquisition of image #1 in the sequence (km.s-1) */ char vy_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [16 + 1]; /**< Vy component of the Parasol speed vector during the acquisition of image #1 in the sequence (km.s-1) */ char vz_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [16 + 1]; /**< Vz component of the Parasol speed vector during the acquisition of image #1 in the sequence (km.s-1) */ char yaw_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [8 + 1] ; /**< Yaw of the Parasol instrument during acquisition of image #1 in the sequence */ char pitch_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [8 + 1] ; /**< Pitch of the Parasol instrument during acquisition of image #1 in the sequence */ char roll_sat [NB_MAX_PARASOL_SEQUENCE] [NB_MAX_PARASOL_IMAGE_PER_SEQUENCE] [8 + 1] ; /**< Roll of the Parasol instrument during acquisition of image #1 in the sequence */ public: /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); /** * @brief read the X, Y, Z position of the satellite and fill in the output data buffers with it * @warning buffers must have been already allocated with a size of NB_MAX_PARASOL_SEQUENCE * NB_MAX_PARASOL_IMAGE_PER_SEQUENCE * @param v_x_sat [OUT] X satellite position (m) * @param v_y_sat [OUT] Y satellite position (m) * @param v_z_sat [OUT] Z satellite position (m) */ void get_xyz_sat (double * v_x_sat, double * v_y_sat, double * v_z_sat); }; /** * Store the PARASOL DataProcessingParametersRecord record values. */ class DataProcessingParametersRecord : public PARASOLFileRecord { public: char l0_creation_country[8+1]; /**< Level-0 creation country */ char l0_creation_agency[8+1]; /**< Level-0 creation agency */ char l0_creation_facility[16+1]; /**< Level-0 creation facility */ char l0_creation_date[16+1]; /**< Level-0 creation date */ char l0_process_soft_version[8+1]; /**< Level-0 processing software version */ char l1_creation_country[8+1]; /**< Level-1 creation country */ char l1_creation_agency[8+1]; /**< Level-1 creation agency */ char l1_creation_facility[16+1]; /**< Level-1 creation facility */ char l1_creation_date[16+1]; /**< Level-1 creation date */ char l1_process_soft_version[8+1]; /**< Level-1 processing software version */ char l0_input_parasol_data_id[16+1]; /**< Identificator of level-0 Input PARASOL data */ char calib_data_version[8+1]; /**< Version of data used for Calibration */ char calib_creation_date[16+1]; /**< Date of Calibration File Creation */ char calib_applic_date[16+1]; /**< Date of Begining of Calibration Applicability */ char geo_process_data_version[8+1]; /**< Version of data for Geometric Processing */ char geo_file_creation_date[16+1]; /**< Date of Geometric File Creation */ char geo_applic_date[16+1]; /**< Date of Begining of Geometric Applicability */ unsigned char product_confidence[4]; /**< Product Confidence Data */ char l2_creation_country[8+1]; /**< Level-2 creation country */ char l2_creation_agency[8+1]; /**< Level-2 creation agency */ char l2_creation_facility[16+1]; /**< Level-2 creation facility */ char l2_creation_date[16+1]; /**< Level-2 creation date */ char process_line_id[16+1]; /**< Processing Line Identification */ char product_them_id[32+1]; /**< Product Thematic identification */ char l2_process_soft_version[8+1]; /**< Level-2 processing software version */ char l1_input_parasol_data_id[16+1]; /**< Identificator of level-1 Input PARASOL data */ char l3_input_parasol_data_num1_id[16+1]; /**< Identificator of 1st level-3 Input PARASOL data */ char l3_input_parasol_data_num2_id[16+1]; /**< Identificator of 2nd level-3 Input PARASOL data */ char l3_input_parasol_data_num3_id[16+1]; /**< Identificator of 3rd level-3 Input PARASOL data */ char input_meteo_data_num1_id[32+1]; /**< Identificator of 1st input Meteo data */ char input_meteo_data_num2_id[32+1]; /**< Identificator of 2nd input Meteo data */ char input_meteo_data_num3_id[32+1]; /**< Identificator of 3rd input Meteo data */ char input_TOMS_data_num1_id[32+1]; /**< Identificator of 1st input TOMS data */ char input_TOMS_data_num2_id[32+1]; /**< Identificator of 2nd input TOMS data */ unsigned char product_confidence_intern[4]; /**< Product Confidence Data (internal use) */ /** * @brief constructor : put the end-of-string characters */ DataProcessingParametersRecord(){ l0_creation_country[8]='\0'; /**< Level-0 creation country */ l0_creation_agency[8]='\0'; /**< Level-0 creation agency */ l0_creation_facility[16]='\0'; /**< Level-0 creation facility */ l0_creation_date[16]='\0'; /**< Level-0 creation date */ l0_process_soft_version[8]='\0'; /**< Level-0 processing software version */ l1_creation_country[8]='\0'; /**< Level-1 creation country */ l1_creation_agency[8]='\0'; /**< Level-1 creation agency */ l1_creation_facility[16]='\0'; /**< Level-1 creation facility */ l1_creation_date[16]='\0'; /**< Level-1 creation date */ l1_process_soft_version[8]='\0'; /**< Level-1 processing software version */ l0_input_parasol_data_id[16]='\0'; /**< Identificator of level-0 Input PARASOL data */ calib_data_version[8]='\0'; /**< Version of data used for Calibration */ calib_creation_date[16]='\0'; /**< Date of Calibration File Creation */ calib_applic_date[16]='\0'; /**< Date of Begining of Calibration Applicability */ geo_process_data_version[8]='\0'; /**< Version of data for Geometric Processing */ geo_file_creation_date[16]='\0'; /**< Date of Geometric File Creation */ geo_applic_date[16]='\0'; /**< Date of Begining of Geometric Applicability */ l2_creation_country[8]='\0'; /**< Level-2 creation country */ l2_creation_agency[8]='\0'; /**< Level-2 creation agency */ l2_creation_facility[16]='\0'; /**< Level-2 creation facility */ l2_creation_date[16]='\0'; /**< Level-2 creation date */ process_line_id[16]='\0'; /**< Processing Line Identification */ product_them_id[32]='\0'; /**< Product Thematic identification */ l2_process_soft_version[8]='\0'; /**< Level-2 processing software version */ l1_input_parasol_data_id[16]='\0'; /**< Identificator of level-1 Input PARASOL data */ l3_input_parasol_data_num1_id[16]='\0'; /**< Identificator of 1st level-3 Input PARASOL data */ l3_input_parasol_data_num2_id[16]='\0'; /**< Identificator of 2nd level-3 Input PARASOL data */ l3_input_parasol_data_num3_id[16]='\0'; /**< Identificator of 3rd level-3 Input PARASOL data */ input_meteo_data_num1_id[32]='\0'; /**< Identificator of 1st input Meteo data */ input_meteo_data_num2_id[32]='\0'; /**< Identificator of 2nd input Meteo data */ input_meteo_data_num3_id[32]='\0'; /**< Identificator of 3rd input Meteo data */ input_TOMS_data_num1_id[32]='\0'; /**< Identificator of 1st input TOMS data */ input_TOMS_data_num2_id[32]='\0'; /**< Identificator of 2nd input TOMS data */ }; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * Store the PARASOL ScalingFactors record values. */ class ScalingFactorsRecord : public PARASOLFileRecord { public: char interleave_id[8+1]; /**< Interleaving indicator */ char byte_order[16+1]; /**< Byte ordering standard */ char nb_pix_param[4+1]; /**< Nb parameters per pixel */ char nb_pix_bytes[8+1]; /**< Nb bytes per pixel */ char nb_bytes[MAX_PARAM][2+1]; /**< the number of bytes of each parameter */ char slope[MAX_PARAM][17+1]; /**< the scaling slope of each parameter */ char offset[MAX_PARAM][17+1]; /**< the scaling offset of each parameter */ /** * @brief constructor : put the end-of-string characters */ ScalingFactorsRecord () { memset(interleave_id,0,8+1); memset(byte_order,0,16+1); memset(nb_pix_param,0,4+1); memset(nb_pix_bytes,0,8+1); memset(nb_bytes,0,(MAX_PARAM*(2+1))); memset(slope,0,(MAX_PARAM*(17+1))); memset(offset,0,(MAX_PARAM*(17+1))); } /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * Store the PARASOL Annotations record values. */ class AnnotationsRecord : public PARASOLFileRecord { struct c5 { char c[4+1]; }; public: char l2_dummy_data_percent[4+1]; /**< % of Dummy data in level-2 product */ char l2_non_significant_data_percent[4+1]; /**< % of non significant data in level-2 product */ char l2_land_pix_percent[4+1]; /**< % of Land pixels in level-2 product */ char l2_ocean_pix_percent[4+1]; /**< % of Ocean pixels in level-2 product */ char l2_coast_pix_percent[4+1]; /**< % of Coast pixels in level-2 product */ vector cloudy_pix_percent_per_lat_band; /**< % of cloudy pixels for 10 degrees latitude band # */ char nb_non_empty_grid_line[4+1]; /**< Nb grid lines with at least one pixel */ vector nb_pix_per_line; /**< Nb pixel for line # */ /** * @brief constructor : put the end-of-string characters */ AnnotationsRecord(){ l2_dummy_data_percent[4]='\0'; /**< % of Dummy data in level-2 product */ l2_non_significant_data_percent[4]='\0'; /**< % of non significant data in level-2 product */ l2_land_pix_percent[4]='\0'; /**< % of Land pixels in level-2 product */ l2_ocean_pix_percent[4]='\0'; /**< % of Ocean pixels in level-2 product */ l2_coast_pix_percent[4]='\0'; /**< % of Coast pixels in level-2 product */ nb_non_empty_grid_line[4]='\0'; /**< Nb grid lines with at least one pixel */ }; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * Store the PARASOL data files descriptor record values. */ class DataFileDescriptorRecord : public PARASOLFileRecord { public: char ref_doc_id[12+1]; /**< Reference Document Identification */ char ref_doc_version[6+1]; /**< Reference Document Version Number */ char soft_version[6+1]; /**< Software Version Number */ char file_nb[4+1]; /**< File Number */ char filename[16+1]; /**< File Name */ unsigned int nb_data_rec; /**< Number of "Data" records in the file */ unsigned int one_data_rec_len; /**< Length of one "Data" record */ unsigned int data_rec_prefix_len; /**< Length of the Prefix in the Record Data */ unsigned int data_rec_data_len; /**< Length of the Datas in the Record Data */ unsigned int data_rec_suffix_len; /**< Length of the Suffix in the Record Data */ /** * @brief constructor : put the end-of-string characters */ DataFileDescriptorRecord(){ ref_doc_id[12]='\0'; /**< Reference Document Identification */ ref_doc_version[6]='\0'; /**< Reference Document Version Number */ soft_version[6]='\0'; /**< Software Version Number */ file_nb[4]='\0'; /**< File Number */ filename[16]='\0'; /**< File Name */ }; /** * @brief access to each attribute for writing it * For example, this used for reading the L1 technological parametres. If you want to access to the image "im" in the sequence "is", @a v_ival will be ["is","im"] * @param entry_index the index of the entry in the record * @param v_ival the indexes of the value to read, stored as a vector * @return a pointer to the attribute to read */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); /** * @brief access a specific record size. * If the record isn't defined for the product, return 0 * @param record a PARASOL data file record * @return the record size */ const int get_record_size(const Record& record); }; /** * Interface class that describes a PARASOL data record storage class. Each product must implements it */ class DataRecord : public PARASOLFileRecord { public: unsigned short line_nb; unsigned short col_nb; /** * @brief access to one data entry * @param entry_index the index of the entry * @param v_ival the indexes of the value to read, stored as a vector. For entries that have many (ex: The Temperature Profile in RB2 products that have 10 values), v_ival[0] will be the index of a direction) * @param group_item_index the subindex of a repeated group. Ex : the relative azimuth angle in RB2 products have a entry index of 44 and a group_item_index of 2 * @return the value as a void pointer. If not found, returns a NULL one */ // void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * Implementation of the DataRecord interface for RB2 products * REM : the I1 typed variables (in the DPC) are stored as unsigned short */ class RB2_DataRecord : public DataRecord { public: signed short mean_alt; /**< mean altitude */ unsigned short land_percent; /**< percent of land fields */ unsigned char dsqtrait[2]; /**< Pixel Confidence Data */ unsigned short obs_time_hr; /**< Observation UTC time (hours) */ unsigned short obs_time_min; /**< Observation UTC time (min) */ unsigned short nb_view_dir; /**< Nb Viewing Directions */ unsigned short nb_Pray_dir; /**< Nb Directions for Pray Estimation */ unsigned short minmax_glint_dir; /**< First and Last directions contamined by glint */ unsigned short solar_zenith_angle_cos; /**< Cosine of Solar Zenith angle */ unsigned short mean_albedo; /**< Mean Albedo at 670/865 nm */ unsigned short spatial_stddev_albedo; /**< Relative spatial std dev of the albedos */ unsigned short angular_stddev_albedo; /**< Relative angular std dev of the albedos */ unsigned short albedo_QI; /**< Albedo Quality Index */ unsigned short scene_albedo; /**< Scene Albedo */ unsigned short angular_stddev_scene_albedo; /**< Relative Angular std dev of the Scene Albedo */ unsigned short clear_albedo; /**< Clear Albedo at 670/865 nm */ unsigned short sw_albedo; /**< Shortwave Albedo */ unsigned short clear_sw_albedo; /**< Clear Shortwave Albedo */ unsigned short cloud_cover; /**< Cloud Cover */ unsigned short indet2clear_pix_fraction; /**< Fraction of Pix firstly indetermined Finally Clear/cloudy */ unsigned short cloud_cover_QI; /**< Cloud Cover Quality Index */ unsigned short water_vapor_column; /**< Water Vapor Column */ unsigned short water_vapor_stddev; /**< Water Vapor Standard Deviation */ unsigned short mean_po2; /**< Mean Cloud oxygen pressure */ unsigned short angular_stddev_po2; /**< Cloud oxygen pressure angular Standard Deviation */ unsigned short mean_pray; /**< Mean Cloud Rayleigh pressure */ unsigned short angular_stddev_pray; /**< Cloud Rayleigh pressure angular Standard Deviation */ unsigned short opt_th; /**< Cloud Optical Thickness (Linear Mean) */ unsigned short stddev_opt_th; /**< Relative Std Dev of Optical Thickness */ unsigned short homogeneity_coef_opt_th; /**< Homogeneity Coef of Optical Thickness */ unsigned short sperical_albedo; /**< Cloud Spherical Albedo at 670/865 nm */ unsigned short cloud_phase; /**< Cloud Phase */ unsigned short ice_shape_idx; /**< Ice Crystal Shape Index */ unsigned short strato_aero_opt_th; /**< Stratospheric Aerosol Optical Thickness */ unsigned short ozone_total_column; /**< Ozone Total Column */ unsigned short surf_wind_speed; /**< Surface Wind Speed */ unsigned short surf_wind_dir; /**< Surface Wind Direction */ unsigned short surf_pressure; /**< Surface Pressure */ unsigned short temp_prof[10]; /**< Temperature Profile : for each pressure level */ unsigned short water_vapor_prof[10]; /**< Water Vapor Profile */ // directionnal group entries : for unsigned short view_zenith_angle[MAX_PARASOL_DIRECTION]; /**< View Zenith Angle */ unsigned short azimuth_angle[MAX_PARASOL_DIRECTION]; /**< Relative Azimuth Angle */ unsigned short reflectance[MAX_PARASOL_DIRECTION]; /**< Reflectance Corrected for gas Absorption */ unsigned short narrow_albedo[MAX_PARASOL_DIRECTION]; /**< Narrowband Albedo */ unsigned short dir_sw_reflectance[MAX_PARASOL_DIRECTION]; /**< Shortwave Reflectance */ unsigned short dir_sw_albedo[MAX_PARASOL_DIRECTION]; /**< Shortwave Albedo */ unsigned short polar_radiance[MAX_PARASOL_DIRECTION]; /**< Polarized Radiance at 865 nm */ unsigned short clear_cloudy_pix_fraction[MAX_PARASOL_DIRECTION]; /**< Clear/CLoudy Pix Fraction */ unsigned short dir_cloud_cover[MAX_PARASOL_DIRECTION]; /**< Directional Cloud Cover */ unsigned short dir_spherical_albedo[MAX_PARASOL_DIRECTION]; /**< Directional Cloud Spherical Albedo at 670/865 nm */ /** * @brief access to one data entry * @param entry_index the index of the entry * @param v_ival the indexes of the value to read, stored as a vector. For entries that have many (ex: The Temperature Profile in RB2 products that have 10 values), v_ival[0] will be the index of a direction) * @param group_item_index the subindex of a repeated group. Ex : the relative azimuth angle in RB2 products have a entry index of 44 and a group_item_index of 2 * @return the value as a void pointer. If not found, returns a NULL one */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; /** * Implementation of the DataRecord interface for BASIC_1 products * REM : the I1 typed variables (in the DPC) are stored as unsigned short */ class BASIC_1_DataRecord : public DataRecord { public: signed short alt; /**< Pixel altitude */ unsigned short land_percent; /**< surface tpe indicator : 100->land, 0->Water, 50->Mixed */ unsigned char dqx[32]; /**< Pixel Quality Index */ unsigned short rough_cloud_ind; /**< Rough Cloud Indicator (0:clear, 100:cloudy, 50:undetermined) */ unsigned short phis; /**< Solar Azimuth Angle */ unsigned short ni; /**< Number of available viewing directions */ unsigned char seq_arrang[2]; /**< Sequence Arrangement Indicator */ // directionnal group entries unsigned short seq_nb[MAX_PARASOL_DIRECTION]; /**< Sequence Number */ signed short ccd_lin[MAX_PARASOL_DIRECTION]; /**< Line number of the CCD matrix detector which has observed the pixel for filter 670P2 */ signed short ccd_col[MAX_PARASOL_DIRECTION]; /**< Column number of the CCD matrix detector which has observed the pixel for filter 670P2 */ unsigned short thetas[MAX_PARASOL_DIRECTION]; /**< Solar Zenith Angle */ unsigned short thetav[MAX_PARASOL_DIRECTION]; /**< View Zenith Angle for filter 670P2 */ unsigned short phi[MAX_PARASOL_DIRECTION]; /**< Relative Azimuth Angle for filter 670P2 */ signed short delta_thetav_cosphi[MAX_PARASOL_DIRECTION]; /**< Delta(Thetav.cos(phi)) : relative variation of viewing geometry between the filters */ signed short delta_thetav_sinphi[MAX_PARASOL_DIRECTION]; /**< Delta(Thetav.sin(phi)) : relative variation of viewing geometry between the filters */ unsigned short rad443NP[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 443NP */ unsigned short rad490P[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 490P */ unsigned short rad1020NP[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 1020NP */ unsigned short rad565NP[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 565NP */ unsigned short rad670P[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 670P */ unsigned short rad763NP[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 763NP */ unsigned short rad765NP[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 765NP */ unsigned short rad865P[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 865NP */ unsigned short rad910NP[MAX_PARASOL_DIRECTION]; /**< Normalized radiance for channel 910NP */ unsigned short Q490P[MAX_PARASOL_DIRECTION]; /**< Second component of Stokes Vector (Q) for channel 490P */ unsigned short Q670P[MAX_PARASOL_DIRECTION]; /**< Second component of Stokes Vector (Q) for channel 670P */ unsigned short Q865P[MAX_PARASOL_DIRECTION]; /**< Second component of Stokes Vector (Q) for channel 865P */ unsigned short U490P[MAX_PARASOL_DIRECTION]; /**< Second component of Stokes Vector (Q) for channel 490P */ unsigned short U670P[MAX_PARASOL_DIRECTION]; /**< Second component of Stokes Vector (Q) for channel 670P */ unsigned short U865P[MAX_PARASOL_DIRECTION]; /**< Second component of Stokes Vector (Q) for channel 865P */ /** * @brief access to one data entry * @param entry_index the index of the entry * @param v_ival the indexes of the value to read, stored as a vector. For entries that have many (ex: The Temperature Profile in RB2 products that have 10 values), v_ival[0] will be the index of a direction) * @param group_item_index the subindex of a repeated group. Ex : the relative azimuth angle in RB2 products have a entry index of 44 and a group_item_index of 2 * @return the value as a void pointer. If not found, returns a NULL one */ void* get_entry(const int& entry_index, const vector v_ival = vector (0)); }; // void * PARASOLFileRecord::get_entry(const int & i_entry, const vector< int > v_ival) { // int sz_v_ival = v_ival.size(); // if (sz_v_ival == 0) // return get_entry (i_entry); // else if (sz_v_ival == 1) // return get_entry (i_entry, v_ival[0]); // else { // } // } #endif