#include <iirfiledata.h>
Public Types | |
enum | ProductType { UNDEFINED, L1, L2_TRACK, L2_SWATH } |
Public Member Functions | |
IIRFileData (const string &_name="", const string &mode="r") | |
~IIRFileData () | |
const bool | is_day () const |
void | get_latitude_data (float *data) |
void | get_longitude_data (float *data) |
void | get_time_data (double *data) |
const int | get_track_size () const |
Read the number of track measures contained in this file (in pixels). | |
const int | get_swath_size () const |
Read the size of the swath (in pixels). | |
const bool | get_index (const float &lat, const float &lon, const double &time, int *near_point_idx, const float coloc_tolerance=IIRFileData::colocation_tolerance) |
search the index of the nearest point in the data to (lat , lon ) If coloc_tolerance is given, it will compute only the distance of the points that have a distance to ( lat, lon ) inferior to coloc_tolerance | |
const int | get_nearest_point_index (const float &lat, const float &lon, const double &time) |
const bool | contains_data_at (const float &lat, const float &lon, const double &time) const |
void | load_geolocation_data () |
void | free_geolocation_data () |
const bool | is_geolocation_data_loaded () const |
const bool | get_index (const float &lat, const float &lon, int &nearest_pix_idx, const float colocation_tolerance=IIRFileData::colocation_tolerance) |
find the index of the nearest point to (lat,lon) in the data. If (lat,lon) is not found or out of the colocalisation_frame, returned indexes are [-1,-1] | |
const float | get_nearest_point_distance (const float &lat, const float &lon, const float coloc_tolerance=IIRFileData::colocation_tolerance) |
compute the distance to (lat,lon) of the nearest point in the data If coloc_tolerance is given, it will compute only the distance of the points that have a distance to ( lat, lon ) inferior to coloc_tolerance | |
const bool | contain_location (const float &lat, const float &lon, const double &tolerance=IIRFileData::colocation_tolerance) |
check if this file has eventually data coincident with (lat,lon) Actually, it only tests if (lat,lon) is contained in the data's bounding rectangle. | |
const bool | contain_data (const float &lat, const float &lon, const double &time, const double &colocation_tolerance=IIRFileData::colocation_tolerance) |
check if the file has possible (lat,lon) coincidence | |
virtual void | get_pixel_coord (const vector< int > &ipix, float &lat, float &lon, double &time) |
retrieve the coordinates of a pixel using its index | |
virtual void | get_vindex (vector< vector< int > > &v_index, const float &lat, const float &lon, const float colocation_tolerance) |
build the list of indices of pixels that are in colocation tolerance, sorted by increasing distance to (lat,lon) If (lat,lon) is not found or out of the colocalisation_frame, returns an empty vector | |
virtual void | close_data_file () |
closes the file. | |
virtual void | open_data_file () |
opens the file. | |
Static Public Attributes | |
static const int | IIR_swath_size = 69 |
static const int | nb_record_max = 25000 |
Protected Member Functions | |
virtual void | load_v_pixel () |
load the list data pixels |
manage the reading of the CALIPSO IIR files. At this time, treats only L2 Track files. For Swath files, some methods need to be completed.
defines the possible types of IIR products
IIRFileData::IIRFileData | ( | const string & | _name = "" , |
|
const string & | mode = "r" | |||
) |
Constructor
_name | the name (path+filename) of the file to be opened | |
mode | the opening mode. LIMITATION : only "r" mode treated at this time |
IIRFileData::~IIRFileData | ( | ) |
Destructor
References free_geolocation_data(), HDFFileData::free_hdf_file(), and HDFFileData::free_hdf_metadata().
const bool IIRFileData::contain_data | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time, | |||
const double & | colocation_tolerance = IIRFileData::colocation_tolerance | |||
) | [virtual] |
check if the file has possible (lat,lon) coincidence
lat | latitude | |
lon | longitude | |
time | time | |
colocation_tolerance | the acceptable bias (in km or degrees. Supposed to be in, a plane approximation) between [lat,lon] and the nearest data point. |
Reimplemented from FileData.
References contain_location(), and FileData::contain_time().
const bool IIRFileData::contain_location | ( | const float & | lat, | |
const float & | lon, | |||
const double & | tolerance = IIRFileData::colocation_tolerance | |||
) | [virtual] |
check if this file has eventually data coincident with (lat,lon) Actually, it only tests if (lat,lon) is contained in the data's bounding rectangle.
lat | the latitude of the event | |
lon | the longitude of the event | |
tolerance | acceptable bias between the nearest point in the data and the given (lat,lon) point |
Reimplemented from FileData.
References get_index().
Referenced by contain_data().
const bool IIRFileData::contains_data_at | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time | |||
) | const |
check if this file has data coincident with (lat,lon,time)
lat | the latitude of the event | |
lon | the longitude of the event | |
time | the time of the event |
References FileData::get_date(), and Date::get_TAI93_time().
void IIRFileData::free_geolocation_data | ( | ) | [virtual] |
free eventually loaded geolocation data
Reimplemented from FileData.
References SatelliteFileData::lat_data, SatelliteFileData::lon_data, and SatelliteFileData::time_data.
Referenced by get_index(), get_nearest_point_distance(), get_nearest_point_index(), and ~IIRFileData().
const bool IIRFileData::get_index | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time, | |||
int * | near_point_idx, | |||
const float | coloc_tolerance = IIRFileData::colocation_tolerance | |||
) |
search the index of the nearest point in the data to (lat , lon ) If coloc_tolerance is given, it will compute only the distance of the points that have a distance to ( lat, lon ) inferior to coloc_tolerance
near_point_idx | the indexes of the nearest point found (or {-1,-1} if not found) | |
lat | the latitude | |
lon | the longitude | |
time | the time of the observation. If -1., skipped | |
coloc_tolerance | the -/+ maximal tolerance for 2 points considered as colocated |
References free_geolocation_data(), is_geolocation_data_loaded(), and load_geolocation_data().
Referenced by contain_location(), get_index(), and get_nearest_point_distance().
const bool IIRFileData::get_index | ( | const float & | lat, | |
const float & | lon, | |||
int & | nearest_pix_idx, | |||
const float | colocation_tolerance = IIRFileData::colocation_tolerance | |||
) |
find the index of the nearest point to (lat,lon) in the data. If (lat,lon) is not found or out of the colocalisation_frame, returned indexes are [-1,-1]
lat | the latitude | |
lon | the longitude | |
nearest_pix_idx | the index of the nearest measure. -1 if no coincidence found. | |
colocation_tolerance | the acceptable bias (in km or degrees. Supposed to be in, a plane approximation) between [lat,lon] and the nearest data point. |
References get_index().
void IIRFileData::get_latitude_data | ( | float * | data | ) |
read the latitudes data in this file, and fill data with it
data | the array that will contain the latitudes once the method is ended |
References get_swath_size(), get_track_size(), and HDFFileData::read_data().
void IIRFileData::get_longitude_data | ( | float * | data | ) |
read the longitudes data in this file, and fill data with it
data | the array that will contain the latitudes once the method is ended |
References get_swath_size(), get_track_size(), and HDFFileData::read_data().
const float IIRFileData::get_nearest_point_distance | ( | const float & | lat, | |
const float & | lon, | |||
const float | coloc_tolerance = IIRFileData::colocation_tolerance | |||
) |
compute the distance to (lat,lon) of the nearest point in the data If coloc_tolerance is given, it will compute only the distance of the points that have a distance to ( lat, lon ) inferior to coloc_tolerance
lat | the latitude | |
lon | the longitude | |
coloc_tolerance | the -/+ maximal tolerance for 2 points considered as colocated |
References free_geolocation_data(), get_index(), is_geolocation_data_loaded(), SatelliteFileData::lat_data, load_geolocation_data(), and SatelliteFileData::lon_data.
const int IIRFileData::get_nearest_point_index | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time | |||
) |
find the row index of the nearest point in the data of this file to (lat,lon,time). Be careful, it will return a valid index : this method doesn't check if the point given in parametre is contained in this file. Use the contains_data_at to check it first.
lat | the latitude of the event | |
lon | the longitude of the event | |
time | the time of the event |
References free_geolocation_data(), get_track_size(), is_geolocation_data_loaded(), SatelliteFileData::lat_data, load_geolocation_data(), and SatelliteFileData::lon_data.
virtual void IIRFileData::get_pixel_coord | ( | const vector< int > & | ipix, | |
float & | lat, | |||
float & | lon, | |||
double & | time | |||
) | [inline, virtual] |
retrieve the coordinates of a pixel using its index
ipix | [IN] index of the pixel | |
lat | [OUT] latitude of the pixel | |
lon | [OUT] longitude of the pixel | |
time | [OUT] timestamp of the pixel |
const int IIRFileData::get_swath_size | ( | ) | const |
Read the size of the swath (in pixels).
References IIR_swath_size.
Referenced by get_latitude_data(), get_longitude_data(), get_time_data(), and load_geolocation_data().
void IIRFileData::get_time_data | ( | double * | data | ) |
read the time data in this file, and fill data with it
data | the array that will contain the time once the method is ended |
References get_swath_size(), get_track_size(), and HDFFileData::read_data().
const int IIRFileData::get_track_size | ( | ) | const |
Read the number of track measures contained in this file (in pixels).
Referenced by get_latitude_data(), get_longitude_data(), get_nearest_point_index(), get_time_data(), and load_geolocation_data().
virtual void IIRFileData::get_vindex | ( | vector< vector< int > > & | v_index, | |
const float & | lat, | |||
const float & | lon, | |||
const float | colocation_tolerance | |||
) | [inline, virtual] |
build the list of indices of pixels that are in colocation tolerance, sorted by increasing distance to (lat,lon) If (lat,lon) is not found or out of the colocalisation_frame, returns an empty vector
lat | the latitude | |
lon | the longitude | |
colocation_tolerance | the acceptable bias (in km or degrees. Supposed to be in, a plane approximation) between [lat,lon] and the nearest data point. |
const bool IIRFileData::is_day | ( | ) | const |
Check if the file contains day or night data
const bool IIRFileData::is_geolocation_data_loaded | ( | ) | const [virtual] |
Check if the geolocation data have been already loaded
Reimplemented from FileData.
References SatelliteFileData::lat_data, SatelliteFileData::lon_data, and SatelliteFileData::time_data.
Referenced by get_index(), get_nearest_point_distance(), get_nearest_point_index(), and load_geolocation_data().
void IIRFileData::load_geolocation_data | ( | ) | [virtual] |
load the geolocations data. This method is used to make the search of the indexes of a (lat,lon,time) point faster.
Reimplemented from FileData.
References HDFFileData::free_hdf_file(), get_swath_size(), get_track_size(), is_geolocation_data_loaded(), HDFFileData::is_hdf_file_loaded(), SatelliteFileData::lat_data, HDFFileData::load_hdf_file(), load_v_pixel(), SatelliteFileData::lon_data, HDFFileData::read_data(), and SatelliteFileData::time_data.
Referenced by get_index(), get_nearest_point_distance(), and get_nearest_point_index().
const int IIRFileData::IIR_swath_size = 69 [static] |
number of pixels of the IIR swath (at 1 km resolution)
Referenced by get_swath_size().
const int IIRFileData::nb_record_max = 25000 [static] |
maximum number of records for an IIR L2 half-orbit. Useful for static buffers allocations