Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions

IIRFileData Class Reference

#include <iirfiledata.h>

Inheritance diagram for IIRFileData:
Inheritance graph
[legend]
Collaboration diagram for IIRFileData:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.

Author:
Nicolas PASCAL

Member Enumeration Documentation

defines the possible types of IIR products


Constructor & Destructor Documentation

IIRFileData::IIRFileData ( const string &  _name = "",
const string &  mode = "r" 
)

Constructor

Parameters:
_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 (  ) 

Member Function Documentation

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

Warning:
it's an EVENTUAL coincidence. That is not a proof !!!
Parameters:
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.
Returns:
true if can eventually contain a coincidence with the point.
Warning:
at this time always true. I don't have a good way to do it

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.

Parameters:
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
Returns:
true if a point in the data has been found in the colocation frame

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)

Parameters:
lat the latitude of the event
lon the longitude of the event
time the time of the event
Returns:

References FileData::get_date(), and Date::get_TAI93_time().

void IIRFileData::free_geolocation_data (  )  [virtual]
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

Parameters:
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
Returns:
true if found

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]

Parameters:
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.
Returns:
true if the coincidence has been found

References get_index().

void IIRFileData::get_latitude_data ( float *  data  ) 

read the latitudes data in this file, and fill data with it

Parameters:
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

Parameters:
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

Parameters:
lat the latitude
lon the longitude
coloc_tolerance the -/+ maximal tolerance for 2 points considered as colocated
Returns:
the distance to the nearest point, or -1 if no point in the colocalisation frame has been found.

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.

Parameters:
lat the latitude of the event
lon the longitude of the event
time the time of the event
Returns:
the nearest point row index

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

Parameters:
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).

Returns:
the size of the swath

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

Parameters:
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).

Returns:
the size of the track

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

Parameters:
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.
Returns:
the list of indices of pixels
const bool IIRFileData::is_day (  )  const

Check if the file contains day or night data

Returns:
true if the file contains day data
const bool IIRFileData::is_geolocation_data_loaded (  )  const [virtual]

Check if the geolocation data have been already loaded

Returns:
true if the lat_lon data have already been 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]

Member Data Documentation

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


The documentation for this class was generated from the following files: