Public Member Functions | |
PMFileData (const string &name, const string &mode="r") | |
constructor | |
~PMFileData () | |
destructor | |
void | load_geolocation_data () |
read the geolocation data (latitude, longitude and time) This method is used to make the search of the indexes of a (lat,lon,time) point faster. | |
void | free_geolocation_data () |
free eventually loaded geolocation data If the geolocation data are not loaded, doesn't do anything | |
const bool | contain_location (const float &lat, const float &lon, const double &tolerance=0.01) |
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=0.01) |
check if the file has possible (lat,lon) coincidence | |
const float | get_nearest_point_distance (const float &lat, const float &lon, const float coloc_tolerance=PMFileData::colocation_tolerance) |
compute the distance to (lat,lon) of the nearest point in the data | |
string | get_product () const |
access to the product name | |
string | get_version () const |
access to the version of the product | |
const bool | get_index (const float &lat, const float &lon, int igrid[2], const float colocation_tolerance=0.01) |
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 bool | get_index (const float &lat, const float &lon, int &idata, const float colocation_tolerance=0.01) |
find the index of the nearest point to (lat,lon) in the data. The resulting index is linearized : if the dataset has 2 dimensions, this index will be "i_x + sz_x * i_y" If (lat,lon) is not found or out of the colocalisation_frame, returned indexes are [-1,-1] | |
virtual void | get_vindex (vector< vector< int > > &v_index, const float &lat, const float &lon, const float colocation_tolerance=0.01) |
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 | |
const int | get_nb_geo_points () |
retrieve the number of (lat,lon) pixels in the file | |
virtual void | load_v_pixel () |
load the list data pixels Unused for this type of product | |
virtual void | close_data_file () |
closes the file. | |
virtual void | open_data_file () |
opens the file. | |
virtual void | get_pixel_coord (const vector< int > &ipix, float &lat, float &lon, double &time) |
retrieve the coordinates of a pixel using its index. Actuallty, the data are gridded, so the ( lat, lon ) position returned is the center of the grid cell | |
int | get_orbit_nb () const |
orbit number getter | |
void | geolocation_to_grid (const float *lat_lon, int *igrid) |
get the full resolution polder grid indexes corresponding to a point given by its (lat,lon) coordinates | |
void | geolocation_to_grid (const float &lat, const float &lon, int *igrid) |
get the full resolution polder grid indexes corresponding to a point given by its (lat,lon) coordinates | |
void | grid_to_geolocation (const int *igrid, float *lat_minmax, float *lon_minmax=NULL) |
get the lat,lon extrema for a grid point if the indexes are out of the grid or not valid, lat_minmax and lon_minmax are set to -1. | |
const int16 * | get_irow_shift_data () const |
getter of the column shift for each row data | |
float32 | get_node_lon () const |
getter of the ascending node longitude | |
void | read_node_lon () |
read the ascending node longitude in the file attributes and set it | |
const bool | is_geolocation_data_loaded () const |
check if the geolocation data have been already loaded | |
Static Public Member Functions | |
static const int16 | get_sz_grid_y () |
accessor to the height, in pixels, of the data grid | |
static const int16 | get_sz_grid_x () |
accessor to the width, in pixels, of the data grid |
PMFileData::PMFileData | ( | const string & | name, | |
const string & | mode = "r" | |||
) |
constructor
name | the filename | |
mode | opening mode. only "r" at this time |
const bool PMFileData::contain_data | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time, | |||
const double & | colocation_tolerance = 0.01 | |||
) | [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 PMFileData::contain_location | ( | const float & | lat, | |
const float & | lon, | |||
const double & | tolerance = 0.01 | |||
) | [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().
void PMFileData::geolocation_to_grid | ( | const float * | lat_lon, | |
int * | igrid | |||
) |
get the full resolution polder grid indexes corresponding to a point given by its (lat,lon) coordinates
lat_lon | the geolocation coordinates | |
igrid | the indexes in the reference POLDER full resolution grid, in the format [line,col] and starting from 1 |
Referenced by geolocation_to_grid().
void PMFileData::geolocation_to_grid | ( | const float & | lat, | |
const float & | lon, | |||
int * | igrid | |||
) | [inline] |
get the full resolution polder grid indexes corresponding to a point given by its (lat,lon) coordinates
lat | latitude | |
lon | longitude | |
igrid | the indexes in the reference POLDER full resolution grid, in the format [line,col] and starting from 1 |
References geolocation_to_grid().
const bool PMFileData::get_index | ( | const float & | lat, | |
const float & | lon, | |||
int | igrid[2], | |||
const float | colocation_tolerance = 0.01 | |||
) |
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 | |
igrid | the indexes of the grid cell that contains the measure. {-1,-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. Unused here because data are gridded |
Referenced by contain_location(), and get_index().
const bool PMFileData::get_index | ( | const float & | lat, | |
const float & | lon, | |||
int & | idata, | |||
const float | colocation_tolerance = 0.01 | |||
) |
find the index of the nearest point to (lat,lon) in the data. The resulting index is linearized : if the dataset has 2 dimensions, this index will be "i_x + sz_x * i_y" If (lat,lon) is not found or out of the colocalisation_frame, returned indexes are [-1,-1]
lat | the latitude | |
lon | the longitude | |
idata | the linearized 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. Unused here because data are gridded |
References get_index().
const int16* PMFileData::get_irow_shift_data | ( | ) | const [inline] |
getter of the column shift for each row data
const int PMFileData::get_nb_geo_points | ( | ) | [inline] |
retrieve the number of (lat,lon) pixels in the file
const float PMFileData::get_nearest_point_distance | ( | const float & | lat, | |
const float & | lon, | |||
const float | coloc_tolerance = PMFileData::colocation_tolerance | |||
) | [inline] |
compute the distance to (lat,lon) of the nearest point in the data
lat | the latitude | |
lon | the longitude | |
coloc_tolerance | the -/+ maximal tolerance for 2 points considered as colocated |
float32 PMFileData::get_node_lon | ( | ) | const [inline] |
getter of the ascending node longitude
int PMFileData::get_orbit_nb | ( | ) | const [inline] |
orbit number getter
virtual void PMFileData::get_pixel_coord | ( | const vector< int > & | ipix, | |
float & | lat, | |||
float & | lon, | |||
double & | time | |||
) | [inline, virtual] |
retrieve the coordinates of a pixel using its index. Actuallty, the data are gridded, so the ( lat, lon ) position returned is the center of the grid cell
ipix | [IN] index of the pixel | |
lat | [OUT] latitude of the pixel | |
lon | [OUT] longitude of the pixel | |
time | [OUT] timestamp of the pixel. Unused for this product |
References grid_to_geolocation().
string PMFileData::get_product | ( | ) | const [inline] |
access to the product name
static const int16 PMFileData::get_sz_grid_x | ( | ) | [inline, static] |
accessor to the width, in pixels, of the data grid
static const int16 PMFileData::get_sz_grid_y | ( | ) | [inline, static] |
accessor to the height, in pixels, of the data grid
string PMFileData::get_version | ( | ) | const [inline] |
access to the version of the product
virtual void PMFileData::get_vindex | ( | vector< vector< int > > & | v_index, | |
const float & | lat, | |||
const float & | lon, | |||
const float | colocation_tolerance = 0.01 | |||
) | [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. |
void PMFileData::grid_to_geolocation | ( | const int * | igrid, | |
float * | lat_minmax, | |||
float * | lon_minmax = NULL | |||
) |
get the lat,lon extrema for a grid point if the indexes are out of the grid or not valid, lat_minmax and lon_minmax are set to -1.
lat_minmax | 2 elements array containing the latitude extrema. Mustn't be NULL | |
lon_minmax | 2 elements array containing the longitude extrema. Can be NULL. In this case, only lat_minmax will be computed | |
igrid | the indexes in the reference POLDER grid (line,col) and so starts from 1 |
Referenced by get_pixel_coord().