Public Member Functions | Protected Member Functions | Protected Attributes

HDFFileData Class Reference

#include <hdffiledata.h>

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

List of all members.

Public Member Functions

 HDFFileData (const string &name="", const string &mode="r", const bool open_file=false)
 Open and initialize the file.
 HDFFileData (const HDFFileData &hfd)
 Copy constructor.
virtual ~HDFFileData ()
 Destructor.
HDFFileDataoperator= (const HDFFileData &hfd)
 Affectation.
Hdf_file * get_hdf_file ()
 accessor to the Hdf_file object.
void load_hdf_file ()
 open the hdf file in reading mode. Instantiates a Hdf_file object.
void free_hdf_file ()
 close the hdf file, and free the ressources used by it
const bool is_hdf_file_loaded ()
 Check if the hdf file has already been loaded.
HDFFileMetaDataget_metadata ()
 access to the HDF file metadata.
void load_hdf_metadata ()
 Read the metadata contained in the hdf file and put them in a tree.
void free_hdf_metadata ()
 Release the metadata tree If the metadata haven't been loaded, nothing's done.
const bool is_hdf_metadata_loaded ()
 Check if the metadata' tree have already been constructed.
virtual void get_dataset_fill_value (const string &sds_name, void *fill_value)
 read the fill value of the sds given in parametre
vector< int > get_sds_dimension (const string &sds_name)
 access the size of the given sds
virtual vector< int > get_dataset_dimension (const string &sds_name)
 return the given dataset size along each axis
vector< int > get_vdata_dimension (const string &vdata_name)
 access the size of a vdata It returns a 2 values vector like this {nb of vdata records, nb of fields}. It doesn't change if the fields have an order bigger than one.
int get_n_dataset ()
string get_dataset_name (int i)
Hdf_sds get_dataset (string sds_name)
int get_dataset_data_type (string sds_name)
string get_values_attr_dataset (string sds_name, string attr_name)
bool has_attr_dataset (string sds_name, string attr_name)
void close_data_file ()
 closes the file
void open_data_file ()
 open the file
string get_values_attr (string attr_name)
string get_file_attr (string attr_name)
bool has_attr (string attr_name)
bool has_file_attr (string attr_name)
template<class T >
get_var_value (const string sds_name, const int &y_index, const int &x_index)
template<class T >
get_value_0D (const char *sds_name="Height", int *start=NULL, int *stride=NULL, int *edges=NULL, int &rank=-1)
template<class T >
vector< T > * get_value_1D (const char *sds_name="Height", int *start=NULL, int *stride=NULL, int *edges=NULL, int &rank=-1)
template<class T >
vector< vector< T > > * get_value_2D (const char *sds_name="Height", int *start=NULL, int *stride=NULL, int *edges=NULL, int &rank=-1)
virtual void * read_data (void *data, const char *sds_name, int *start=NULL, int *stride=NULL, int *edges=NULL, int rank=-1)
template<typename DataType >
DataType * read_data (DataType *data, const char *sds_name, int *start=NULL, int *stride=NULL, int *edges=NULL, int rank=-1)
 method to read the data of an sds similar to void* read_data(...) This method add a test on the validity of the ouput buffer type compared to the sds one.
void * read_vdata (void *data, const char *vdata_name="", const char *vdata_field="", int start=0, int edges=-1)
 read the data of an hdf VData Field

  • for a multi_order field, all order will be loaded. See the HDF documentation for more details about it.
    ----------------------------- USING DEFAULT VALUES ----------------------------
    Like the read_data method, you can use the default values to read all the data.
    Nevertheless, some precautions have to be taken if you let the method do the allocation (ie data parametre is NULL)

void get_fillValue (const string &sds_name, void *fillValue)
 read the given dataset's fill value
void get_scaling (const string &sds_name, float64 &scale, float64 &offset)
template<typename T >
T * read_data (T *data, const char *sds_name, int *start, int *stride, int *edges, int rank)

Protected Member Functions

template<class T >
const vector< int > get_nearest_index (const vector< T > &v_data, const T &val=T(0))
template<class T >
const int get_nearest_index (const vector< T > *data, const T val)
template<class T >
const int get_nearest_index (const T *data=NULL, const int data_size=0, const T val=T(0))
void init_read_write_null_input_param (const char *sds_name, int *&start, int *&stride, int *&edges, int &rank, bool *initialized_values)
void free_read_write_allocations (const bool *are_limits_initialized, int *start, int *stride, int *edges)
const bool check_read_write_limits (const char *sds_name, int *start, int *stride, int *edges, const int rank)

Protected Attributes

Hdf_file * hdf_file
HDFFileMetaDatametadata

Detailed Description

Manage the opening, reading, and accessing to the data in a HDF File. This class encapsulates the Hdf_file class, developped by Fabrice Ducos (fabrice.ducos@icare.univ-lille1.fr), which is a lower level interface to HDF.

How to do some useful actions :

load the data of a whole sds

> in a C way (with static arrays)

HDFFileData my_hdf=HDFFileData("path_to_desired_hdf_file"); // open the file for reading
float32 *data =NULL; // define buffer where to put the read data
data=read_data(static_cast<void*>(data),"Name_Of_The_Sds"); // read the sds' data
make your stuff with the data here
delete[] data; // don't forget to free the data after use
Some remarks :

> in a C++ way (with STL's vectors)

HDFFileData my_hdf=HDFFileData("path_to_desired_hdf_file"); // open the file for reading
Vector < T > *v_data=get_value_XD<T>("Name_Of_The_Sds"); // fill a vector with the read data
make your stuff with the data vector here
delete v_data; // don't forget to free the data after use
Some remarks :


Constructor & Destructor Documentation

HDFFileData::HDFFileData ( const string &  name = "",
const string &  mode = "r",
const bool  open_file = false 
)

Open and initialize the file.

Parameters:
_name the filename of the file to be opened (including its path). Ex : "/home/kiki/my_file.hdf"
mode the opening mode : "r", "w" or "rw". At this time, only the reading "r" mode is fully implemented
open_file tell wether the file must be opened during the instantiation or not

References hdf_file, load_hdf_file(), load_hdf_metadata(), and metadata.

HDFFileData::HDFFileData ( const HDFFileData hfd  ) 

Copy constructor.

Parameters:
hfd the HDFFileData object to be recopied.

References hdf_file, and metadata.


Member Function Documentation

void HDFFileData::free_read_write_allocations ( const bool *  are_limits_initialized,
int *  start,
int *  stride,
int *  edges 
) [protected]

free the allocations made by the init_read_write_null_input_param methods

Referenced by MODISFileData::read_calibrated_data(), and read_data().

virtual vector<int> HDFFileData::get_dataset_dimension ( const string &  sds_name  )  [inline, virtual]

return the given dataset size along each axis

Parameters:
ds_name [IN] dataset name
Returns:
the axis dimensions in ordering [..., Z, Y, X]. Use return_vector.size() to know the rank of the sds

Reimplemented from FileData.

References get_sds_dimension().

void HDFFileData::get_dataset_fill_value ( const string &  sds_name,
void *  fill_value 
) [virtual]

read the fill value of the sds given in parametre

Parameters:
sds_name the name of the sds where to read the fill value
fill_value (output) where to store the read value

Reimplemented from FileData.

References get_hdf_file(), is_hdf_file_loaded(), and load_hdf_file().

Referenced by MODISFileData::read_calibrated_data().

void HDFFileData::get_fillValue ( const string &  sds_name,
void *  fillValue 
) [virtual]

read the given dataset's fill value

Parameters:
ds_name [IN] dataset name
fillvalue [OUT] fill value.

Reimplemented from FileData.

References hdf_file.

Hdf_file * HDFFileData::get_hdf_file (  ) 

accessor to the Hdf_file object.

Returns:
a pointer to Hdf_file object used.

References hdf_file, is_hdf_file_loaded(), and load_hdf_file().

Referenced by get_dataset_fill_value(), and GMAOFileData::get_sds_fill_value().

HDFFileMetaData * HDFFileData::get_metadata (  ) 

access to the HDF file metadata.

Returns:
a pointer to HDFFileMetaData object. If the metadata haven't been loaded using the load_metadata method, it will return NULL.

References is_hdf_metadata_loaded(), load_hdf_metadata(), and metadata.

template<class T >
const vector< int > HDFFileData::get_nearest_index ( const vector< T > &  v_data,
const T &  val = T(0) 
) [protected]

find the indexes of the values that are the nearest to val. REM if the return vector have many indexes, the values at those indexes are equal.

Parameters:
v_data the vector that contains the data to be processed
val the value we are searching for the nearest values in v_data
Returns:
a vector containing the indexes of the values that are the nearest to val in v_data
template<class T >
const int HDFFileData::get_nearest_index ( const vector< T > *  data,
const T  val 
) [protected]

search in a vector the nearest value to val, and retrun its index

Parameters:
data the vector where must be processed the search
val the value wa are searching for the nearset one
Returns:
the index of the nearest vector value. -1 in case of problem, for example if the data are empty.
template<class T >
const int HDFFileData::get_nearest_index ( const T *  data = NULL,
const int  data_size = 0,
const T  val = T(0) 
) [protected]

search in a vector the nearest value to val, and retrun its index

Parameters:
data the array where must be processed the search
data_size the number of values of the array
val the value wa are searching for the nearset one
Returns:
the index of the nearest vector value. -1 in case of problem, for example if the data are empty.
vector< int > HDFFileData::get_sds_dimension ( const string &  sds_name  ) 

access the size of the given sds

Parameters:
sds_name the name of the sds
Returns:
a vector that contains the dimensions of the sds in each direction. Use return_vector.size() to know the rank of the sds

References free_hdf_file(), hdf_file, is_hdf_file_loaded(), and load_hdf_file().

Referenced by get_dataset_dimension().

template<class T >
T HDFFileData::get_value_0D ( const char *  sds_name = "Height",
int *  start = NULL,
int *  stride = NULL,
int *  edges = NULL,
int &  rank = -1 
)

In the opened file, read the value of the sds called "sds_name" at the point "start". BE CAREFUL : this array must be given using the order ...[Z][Y][X]. This method is a template, so you have also to precise the data type of the read value while calling it.

If you are trying to read a value in a 2D sds, please refer to the get_var_value method. It's a simplest front-end to this method.

An examples is clearest :
long start[] = {16,25}; // start position
long rank = 2; // the dimension of start
float32 val = hfd.get_value_0D<float32>("Latitude",start,NULL,NULL,rank);

It will read the data of the sds "Latitude", that is composed of float32 values at the position (16,25) using (Y,X) convention (ie (lat,lon)).

Parameters:
sds_name the name of the sds (Scientific Data Set) we want to access.
start begining of the selection. If NULL, start at (0,0) if rank is 2 ; (0,0,0) if rank is 3...
stride step between 2 interesting values. If NULL, this step is set to 1 in each dimension (ie all values will be read)
edges number of values to be read in each dimension. if NULL, it will be all data along each dimension.
rank the dimension of start
Returns:
a pointer to a 1D vector containing the selected values of type T. Allocated with new inside, and so must be deleted by the caller after being used.
template<class T >
vector< T > * HDFFileData::get_value_1D ( const char *  sds_name = "Height",
int *  start = NULL,
int *  stride = NULL,
int *  edges = NULL,
int &  rank = -1 
)

In the opened file, read the values of the sds called "sds_name", starting at the point "start", reading "edges" values, with a step of "stride" between each values. BE CAREFUL : those array values must be given using the order ...[Z][Y][X]. The result data must be a 1D array. If it isn't the case, an error message will prevent you. This method is a template, so you have also to precise the data type of the read values while calling it.

Some examples are clearest : ----------------------------- EXAMPLE 1 ----------------------------
long start[] = {3,0}; // start position
long stride[] = {2,1}; // step between 2 values
long edges[] = {35,1}; // number of values to be read
long rank = 2; // the dimension of start,stride and edges
vector<float32> *v = hfd.get_value_1D<float32>("Latitude",start,stride,edges,rank);

It will read the data of the sds "Latitude", that is composed of float32 values.

  • Along X, 1 value (edges[1]) will be read, starting at the position 0 (start[1]), with a step of 1 (stride[1]) between 2 values. In this case, the step isn't useful because we read only 1 value.
  • Along Y, 35 values (edges[0]) will be read, starting at the position 3 (start[0]), with a step of 2 (stride[0]) between 2 values. The method will return a POINTER to an 1D vector. So, to access the read data, use (*v)[0] instead of v[0] if it wasn't a pointer.

----------------------------- EXAMPLE 2 ----------------------------
long start[] = {0,0,0}; // start position
long stride[] = {1,1,1}; // same result if NULL, and even a little bit faster : by default, the step between 2 values is 1
long edges[] = {20,1,1}; // number of values to be read
long rank = 3; // the dimension of start,stride and edges
vector<uint8> *v = hfd.get_value_1D<uint8>("Nb_Layer_Found",start,stride,edges,rank);

It will read the data of the sds "Nb_Layer_Found", that is composed of uint8 values.

  • Along X, 1 value (edges[2]) will be read, starting at the position 0 (start[2]), with a step of 1 (stride[2]).
  • Along Y, 1 values (edges[1]) will be read, starting at the position 0 (start[1]), with a step of 1 (stride[1]).
  • Along Z, 20 values (edges[0]) will be read, starting at the position 0 (start[0]), with a step of 1 (stride[0]). The method will return a POINTER to an 1D vector.

TODO----------------------------- EXAMPLE 3 : USING DEFAULT VALUES (not available yet) ---------------------------- TODO
vector<float32> *v = get_value_1D<float32>("Top_Layer_Height",NULL,NULL,NULL,1);
TODO It will return the whole data of type float32 contained in the sds named "Top_Layer_Height". TODO REM : In this case, the sds "Top_Layer_Height" must have a dimension of 1, because the read values' vector must have a dimension of 1.

Parameters:
sds_name the name of the sds (Scientific Data Set) we want to access.
start begining of the selection. If NULL, start at (0,0) if rank is 2 ; (0,0,0) if rank is 3...
stride step between 2 interesting values. If NULL, this step is set to 1 in each dimension (ie all values will be read)
edges number of values to be read in each dimension. if NULL, it will be all data along each dimension.
rank the dimension of start, stride and edges
Returns:
a pointer to a 1D vector containing the selected values of type T. Allocated with new inside, and so must be deleted by the caller after being used.
template<class T >
vector< vector< T > > * HDFFileData::get_value_2D ( const char *  sds_name = "Height",
int *  start = NULL,
int *  stride = NULL,
int *  edges = NULL,
int &  rank = -1 
)

In the opened file, read the values of the sds called "sds_name", starting at the point "start", reading "edges" values, with a step of "stride" between each values. BE CAREFUL : those array values must be given using the order ...[Z][Y][X]. The result data must be a 1D array. If it isn't the case, an error message will prevent you. This method is a template, so you have also to precise the data type of the read values while calling it.

Some examples are clearest : ----------------------------- EXAMPLE 1 ----------------------------
long start[] = {3,0}; // start position
long stride[] = {2,1}; // step between 2 values
long edges[] = {35,2}; // number of values to be read
long rank = 2; // the dimension of start,stride and edges
vector<float32> *v = hfd.get_value_2D<float32>("Latitude",start,stride,edges,rank);

It will read the data of the sds "Latitude", that is composed of float32 values.

  • Along X, 2 value (edges[1]) will be read, starting at the position 0 (start[1]), with a step of 1 (stride[1]) between 2 values.
  • Along Y, 35 values (edges[0]) will be read, starting at the position 3 (start[0]), with a step of 2 (stride[0]) between 2 values. The method will return a POINTER to an 2D vector. So, to access the read data, use (*v)[0][0].

----------------------------- EXAMPLE 2 ----------------------------
long start[] = {0,0,0}; // start position
long stride[] = {1,1,1}; // same result if NULL, and even a little bit faster : by default, the step between 2 values is 1
long edges[] = {1,20,15}; // number of values to be read
long rank = 3; // the dimension of start,stride and edges
vector<uint8> *v = hfd.get_value_2D<uint8>("Nb_Layer_Found",start,stride,edges,rank);

It will read the data of the sds "Nb_Layer_Found", that is composed of uint8 values.

  • Along X (the longitude for ex), 15 values (edges[2]) will be read, starting at the position 0 (start[2]), with a step of 1 (stride[2]).
  • Along Y (the latitude for ex), 20 values (edges[1]) will be read, starting at the position 0 (start[1]), with a step of 1 (stride[1]).
  • Along Z (the number of layers found for ex), 1 value (edges[0]) will be read, starting at the position 0 (start[0]), with a step of 1 (stride[0]). The method will return a POINTER to an 2D vector.

In this example, the sense of the return vector will be : the number of cloud's layers found along (20,15) lat_lon mesures.

TODO----------------------------- EXAMPLE 3 : USING DEFAULT VALUES (not available yet) ---------------------------- TODO
vector<float32> *v = get_value_2D<float32>("Longitude",NULL,NULL,NULL,2);
TODO It will return the whole data of type float32 contained in the sds named "Longitude". TODO REM : In this case, the sds "Longitude" must have a dimension of 2, because the read values' vector must have a dimension of 2.

Parameters:
sds_name the name of the sds (Scientific Data Set) we want to access.
start begining of the selection. If NULL, start at (0,0) if rank is 2 ; (0,0,0) if rank is 3...
stride step between 2 interesting values. If NULL, this step is set to 1 in each dimension (ie all values will be read)
edges number of values to be read in each dimension. if NULL, it will be all data along each dimension.
rank the dimension of start, stride and edges
Returns:
a pointer to a 2D vector containing the selected values of type T. Allocated with new inside, and so must be deleted by the caller after being used.
template<class T >
T HDFFileData::get_var_value ( const string  sds_name,
const int &  y_index,
const int &  x_index 
)

Read a value in a sds directly using its y_index and x_index. This method is a convenience method to access to a 2D sds. This method is a template, so you have also to precise the data type of the read value while calling it. Ex :
float32 v = get_var_value<float32>("Latitude",12,1);
will read in the sds "Latitude" the value at (12,1) using (Y,X) convention

Returns:
the read value
vector< int > HDFFileData::get_vdata_dimension ( const string &  vdata_name  ) 

access the size of a vdata It returns a 2 values vector like this {nb of vdata records, nb of fields}. It doesn't change if the fields have an order bigger than one.

Parameters:
vdata_name the name of the vdata
Returns:
a vector that contains the dimensions of the vdata.

References free_hdf_file(), hdf_file, is_hdf_file_loaded(), and load_hdf_file().

Referenced by read_vdata().

void HDFFileData::init_read_write_null_input_param ( const char *  sds_name,
int *&  start,
int *&  stride,
int *&  edges,
int &  rank,
bool *  initialized_values 
) [protected]

initialize NULL parametres in read_data methods for a specific sds :

  • set rank size to the sds one
  • allocate edges and set it to hte whole sds size
  • allocate start to the rank size and set it to 0

References hdf_file.

Referenced by MODISFileData::read_calibrated_data(), and read_data().

const bool HDFFileData::is_hdf_metadata_loaded (  ) 

Check if the metadata' tree have already been constructed.

Returns:
true if the metadata have already been loaded

References metadata.

Referenced by get_metadata(), and MODISFileData::set_lat_lon_min_max().

HDFFileData & HDFFileData::operator= ( const HDFFileData hfd  ) 

Affectation.

Parameters:
hfd the HDFFileData object to be recopied.

References hdf_file, and metadata.

template<typename DataType >
DataType* HDFFileData::read_data ( DataType *  data,
const char *  sds_name,
int *  start = NULL,
int *  stride = NULL,
int *  edges = NULL,
int  rank = -1 
)

method to read the data of an sds similar to void* read_data(...) This method add a test on the validity of the ouput buffer type compared to the sds one.

Warning:
this method can only be used with 1D output buffers (you can use an indexation like [j*nb_i+i] to simulate a 2D buffer )
Parameters:
data 
sds_name 
start 
stride 
edges 
rank 
Returns:
void * HDFFileData::read_data ( void *  data,
const char *  sds_name,
int *  start = NULL,
int *  stride = NULL,
int *  edges = NULL,
int  rank = -1 
) [virtual]

Read the data in a HDF file. Similar to get_value_nD methods, but in a C way : this method fills an array and doesn't use a std::vector. Some examples are clearest : ----------------------------- EXAMPLE 1 ----------------------------
long Y_LENGTH = 2;
long X_LENGTH = 35;
long start[] = {3,0}; // start position
long stride[] = {2,1}; // step between 2 values
long edges[] = {X_LENGTH,Y_LENGTH}; // number of values to be read
long rank = 2; // the dimension of start,stride and edges
float32 data[Y_LENGTH][X_LENGTH]; // buffer where to put the read data
hfd.read_data((void*)data,"Latitude",start,stride,edges,rank);

It will read the data of the sds "Latitude", that is composed of float32 values.

  • Along X, 2 value (edges[1]) will be read, starting at the position 0 (start[1]), with a step of 1 (stride[1]) between 2 values.
  • Along Y, 35 values (edges[0]) will be read, starting at the position 3 (start[0]), with a step of 2 (stride[0]) between 2 values.

----------------------------- EXAMPLE 2 ----------------------------
long Z_LENGTH = 1;
long Y_LENGTH = 20;
long X_LENGTH = 15;
long start[] = {0,0,0}; // start position
long stride[] = {1,1,1}; // same result if NULL, and even a little bit faster : by default, the step between 2 values is 1
long edges[] = {Z_LENGTH,Y_LENGTH,X_LENGTH}; // number of values to be read
long rank = 3; // the dimension of start,stride and edges
uint8 data[Z_LENGTH][Y_LENGTH][X_LENGTH]; // buffer where to put the read data
hfd.read_data((void*)data,"Nb_Layer_Found",start,stride,edges,rank);

It will read the data of the sds "Nb_Layer_Found", that is composed of uint8 values.

  • Along X (the longitude for ex), 15 values (edges[2]) will be read, starting at the position 0 (start[2]), with a step of 1 (stride[2]).
  • Along Y (the latitude for ex), 20 values (edges[1]) will be read, starting at the position 0 (start[1]), with a step of 1 (stride[1]).
  • Along Z (the number of layers found for ex), 1 value (edges[0]) will be read, starting at the position 0 (start[0]), with a step of 1 (stride[0]).

----------------------------- EXAMPLE 3 : USING DEFAULT VALUES ---------------------------- float32 *data = NULL; // buffer where to put the read data
data=(float32*)hfd.read_data((void*)data,"Longitude");// the method allocates the needed memory
// Do what you have to do with data here
delete[] data;// Don't forget to free the memory once used
It will read the whole data of type float32 contained in the sds named "Longitude". The method manages the allocation of the data' array

Parameters:
data the buffer to fill with the read values
sds_name the name of the sds (Scientific Data Set) we want to access.
start begining of the selection. If NULL, start at (0,0) if rank is 2 ; (0,0,0) if rank is 3...
stride step between 2 interesting values. If NULL, this step is set to 1 in each dimension (ie all values will be read)
edges number of values to be read in each dimension. if NULL, it will be all data along each dimension.
rank the dimension of start, stride and edges
Returns:
a pointer to the read data array. It is useful when you let this method manage the allocation to update the allocated pointer to the data. If you've done it yourself or you are using a static buffer, it isn't necessary to catch this return pointer

Implements FileData.

References free_hdf_file(), free_read_write_allocations(), hdf_file, init_read_write_null_input_param(), is_hdf_file_loaded(), and load_hdf_file().

Referenced by IIRFileData::get_latitude_data(), IIRFileData::get_longitude_data(), IIRFileData::get_time_data(), PMFileData::load_geolocation_data(), MODISFileData::load_geolocation_data(), IIRFileData::load_geolocation_data(), DARDARFileData::load_geolocation_data(), CLOUDSATFileData::load_geolocation_data(), CERESFileData::load_geolocation_data(), CALIOPFileData::load_geolocation_data(), CALIOPFileData::load_viewing_directions_data(), and MODISFileData::read_calibrated_data().

void * HDFFileData::read_vdata ( void *  data,
const char *  vdata_name = "",
const char *  vdata_field = "",
int  start = 0,
int  edges = -1 
)

read the data of an hdf VData Field

  • for a multi_order field, all order will be loaded. See the HDF documentation for more details about it.
    ----------------------------- USING DEFAULT VALUES ----------------------------
    Like the read_data method, you can use the default values to read all the data.
    Nevertheless, some precautions have to be taken if you let the method do the allocation (ie data parametre is NULL)

  1. Set your data buffer to the return value of the method to update its adress
  2. Don't forget to delete the data buffer once used using the delete[] operator

Here is a example :
float32 *data = NULL; // buffer where to put the read data. Set it to NULL to let the method allocate it
data=(float32)hfd.read_vdata((VOIDP)data,"Longitude");// the method allocates the needed memory. Remark that data s set to the method's return value. It works in a malloc way. That's why you also have to cast it
// Do what you have to do with data
delete[] data;// Don't forget to free the memory once used

Parameters:
data the data buffer. Can be NULL. In this case, the allocation is done by the method. In this case, the caller MUST delete the buffer once
vdata_name the name of the VData
vdata_field the name of the field
start the start point. default : 0 : the record start
edges the number of values to read in all direction. If -1 (default), will read all records
Returns:
a pointer to the buffer. Useful only if the dynamic allocation is done by the method

References free_hdf_file(), get_vdata_dimension(), hdf_file, is_hdf_file_loaded(), and load_hdf_file().

Referenced by CLOUDSATFileData::load_geolocation_data().


Member Data Documentation

Hdf_file* HDFFileData::hdf_file [protected]

a tree representing the metadata of the file. Can be NULL. In this case, to access the data, call the load_hdf_metadata method first

Referenced by free_hdf_metadata(), get_metadata(), HDFFileData(), is_hdf_metadata_loaded(), load_hdf_metadata(), operator=(), MODISFileData::set_gring(), MODISFileData::set_lat_lon_min_max(), and CALIOPFileData::set_lat_lon_min_max().


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