Public Member Functions | |
OMIFileData (const string &_name, const string &mode="r") | |
Constructor. | |
~OMIFileData () | |
Destructor : | |
const bool | get_index (const float &lat, const float &lon, const double &time, int *near_point_idx, const float coloc_tolerance=OMIFileData::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 () |
const bool | get_index (const float &lat, const float &lon, int &nearest_pix_idx, const float colocation_tolerance=OMIFileData::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=OMIFileData::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=OMIFileData::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=OMIFileData::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 | |
void | load_v_pixel () |
virtual void | close_data_file () |
closes the file. | |
virtual void | open_data_file () |
opens the file. | |
const int | get_sz_x () const |
accessor to the geolocation datasets swath size (in pixels) | |
const int | get_sz_y () const |
accessor to the geolocation datasets along track size (in pixels) | |
Protected Member Functions | |
void | init () |
void | check_filename (const string &short_filename) const |
void | parse_filename (const string &short_filename) |
Protected Attributes | |
int | track_size |
vector< int > | lat_lon_index_max |
Static Protected Attributes | |
static const string | latitude_sds_name = "Latitude" |
static const string | longitude_sds_name = "Longitude" |
static const string | time_sds_name = "Time" |
static const float | colocation_tolerance = 0.05 |
OMIFileData::OMIFileData | ( | 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 |
const bool OMIFileData::contain_data | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time, | |||
const double & | colocation_tolerance = OMIFileData::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 OMIFileData::contain_location | ( | const float & | lat, | |
const float & | lon, | |||
const double & | tolerance = OMIFileData::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 colocation_tolerance, and get_index().
Referenced by contain_data().
const bool OMIFileData::contains_data_at | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time | |||
) | const [inline] |
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 |
const bool OMIFileData::get_index | ( | const float & | lat, | |
const float & | lon, | |||
int & | nearest_pix_idx, | |||
const float | colocation_tolerance = OMIFileData::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().
const bool OMIFileData::get_index | ( | const float & | lat, | |
const float & | lon, | |||
const double & | time, | |||
int * | near_point_idx, | |||
const float | coloc_tolerance = OMIFileData::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 SatelliteFileData::free_geolocation_data(), SatelliteFileData::is_geolocation_data_loaded(), load_geolocation_data(), and SatelliteFileData::v_pixel.
Referenced by contain_location(), get_index(), and get_nearest_point_distance().
const float OMIFileData::get_nearest_point_distance | ( | const float & | lat, | |
const float & | lon, | |||
const float | coloc_tolerance = OMIFileData::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 SatelliteFileData::free_geolocation_data(), get_index(), SatelliteFileData::is_geolocation_data_loaded(), SatelliteFileData::lat_data, load_geolocation_data(), and SatelliteFileData::lon_data.
const int OMIFileData::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 SatelliteFileData::free_geolocation_data(), SatelliteFileData::is_geolocation_data_loaded(), SatelliteFileData::lat_data, load_geolocation_data(), and SatelliteFileData::lon_data.
virtual void OMIFileData::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 OMIFileData::get_sz_x | ( | ) | const [inline] |
accessor to the geolocation datasets swath size (in pixels)
const int OMIFileData::get_sz_y | ( | ) | const [inline] |
accessor to the geolocation datasets along track size (in pixels)
virtual void OMIFileData::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. |
void OMIFileData::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 SatelliteFileData::is_geolocation_data_loaded(), SatelliteFileData::lat_data, SatelliteFileData::lon_data, HDF5FileData::read_data(), and SatelliteFileData::time_data.
Referenced by get_index(), get_nearest_point_distance(), and get_nearest_point_index().
const float OMIFileData::colocation_tolerance = 0.05 [static, protected] |
default acceptable tolerance between 2 colocated measures
Referenced by contain_location().