Public Member Functions | |
IGroup (const H5::Group &group) | |
IGroup (hid_t group) | |
std::vector< std::string > | getAttrs () |
std::vector< std::string > | find (const std::string name, const std::string start=".", const std::string type="BOTH", const std::string path="FULL") |
Search function for given name in the group. More... | |
std::string | getPathname () |
Return the path of the group from the file root. More... | |
H5::DataSpace | getDataSpace (const std::string &name) |
Return the H5::DataSpace of the given attribute. More... | |
int | getNumElements (const std::string &name) |
Return the number of elements in the given attribute. More... | |
template<typename T > | |
void | read (T &v, const std::string &att) |
Reading scalar attribute given by name. More... | |
void | read (std::string &v, const std::string &att) |
Reading scalar string attribute given by name. More... | |
template<typename T > | |
void | read (T *buf, const std::string &att) |
Reading multi-dimensional attribute in raw pointer. More... | |
void | read (std::string *buf, const std::string &att) |
Reading multi-dimensional string attribute in raw pointer. More... | |
template<typename T > | |
void | read (std::vector< T > &buf, const std::string &att) |
Reading multi-dimensional attribute in vector. More... | |
template<typename T > | |
void | read (std::valarray< T > &buf, const std::string &att) |
Reading multi-dimensional attribute in valarray. More... | |
IDataSet | openDataSet (const H5std_string &name) |
Open a given dataset. More... | |
IGroup | openGroup (const H5std_string &name) |
Open a given group. More... | |
IGroup | createGroup (const H5std_string &name) |
Create a group within this group. More... | |
IDataSet | createDataSet (const std::string &name, const std::string &data) |
Create a string scalar dataset and simultaneously write the data. More... | |
template<typename T > | |
IDataSet | createDataSet (const std::string &name, const T &data) |
Create a (non-string) scalar dataset and simultaneously write the data. | |
template<typename T > | |
IDataSet | createDataSet (const std::string &name, const std::vector< T > &data) |
Create a dataset (1D) and write the data from a vector container. | |
template<typename T > | |
IDataSet | createDataSet (const std::string &name, const std::valarray< T > &data) |
Create a dataset (1D) and write the data from a valarray container. | |
template<typename T > | |
IDataSet | createDataSet (const std::string &name, const T *buffer, const size_t size) |
Create a dataset (1D) and write a buffer's data. | |
template<typename T , typename T2 , size_t S> | |
IDataSet | createDataSet (const std::string &name, const std::vector< T > &data, const std::array< T2, S > &dims) |
Create a dataset (nD) and write the data from a vector container. | |
template<typename T , typename T2 , size_t S> | |
IDataSet | createDataSet (const std::string &name, const std::valarray< T > &data, const std::array< T2, S > &dims) |
Create a dataset (nD) and write the data from a valarray container. | |
template<typename T , typename T2 , size_t S> | |
IDataSet | createDataSet (const std::string &name, const T *data, const std::array< T2, S > &dims) |
Create a dataset (nD) and write the data from a buffer. | |
template<typename T , typename T2 , size_t S> | |
IDataSet | createDataSet (const std::string &name, const std::array< T2, S > &dims, const int chunk=0, const int shuffle=0, const int deflate=0) |
Create a datatset with compression options. | |
template<typename T > | |
void | createAttribute (const std::string &name, const T &data) |
Creating and writing a scalar as an attribute. More... | |
template<typename T > | |
void | createAttribute (const std::string &name, const std::vector< T > &values) |
Creating and writing a std::vector data as a 1D-array attribute. More... | |
template<typename T > | |
void | createAttribute (const std::string &name, const std::valarray< T > &values) |
Creating and writing a std::valarray data as a 1D-array attribute. More... | |
template<typename T , typename T2 , size_t S> | |
void | createAttribute (const std::string &name, const std::array< T2, S > &dims, const std::vector< T > &values) |
Creating and writing a std::vector data with dimensions (std::array) as an attribute. More... | |
template<typename T , typename T2 , size_t S> | |
void | createAttribute (const std::string &name, const std::array< T2, S > &dims, const std::valarray< T > &values) |
Creating and writing a std::valarray data with dimensions (std::array) as an attribute. More... | |
template<typename T , typename T2 , size_t S> | |
void | createAttribute (const std::string &name, const std::array< T2, S > &dims, const T *buffer) |
Creating and writing a raw pointer to data with dimensions (std::array) as an attribute. More... | |
template<> | |
void | createAttribute (const std::string &name, const H5::DataType &datatype, const H5::DataSpace &dataspace, const std::string *buffer) |
template<typename T > | |
isce3::io::IDataSet | createDataSet (const std::string &name, const T &data) |
template<typename T > | |
isce3::io::IDataSet | createDataSet (const std::string &name, const std::vector< T > &data) |
template<typename T > | |
isce3::io::IDataSet | createDataSet (const std::string &name, const std::valarray< T > &data) |
template<typename T > | |
isce3::io::IDataSet | createDataSet (const std::string &name, const T *data, const size_t sz) |
template<typename T , typename T2 , size_t S> | |
isce3::io::IDataSet | createDataSet (const std::string &name, const std::vector< T > &data, const std::array< T2, S > &dims) |
template<typename T , typename T2 , size_t S> | |
isce3::io::IDataSet | createDataSet (const std::string &name, const std::valarray< T > &data, const std::array< T2, S > &dims) |
template<typename T , typename T2 , size_t S> | |
isce3::io::IDataSet | createDataSet (const std::string &name, const T *data, const std::array< T2, S > &dims) |
template<typename T , typename T2 , size_t S> | |
isce3::io::IDataSet | createDataSet (const std::string &name, const std::array< T2, S > &dims, const int chunk, const int shuffle, const int deflate) |
template<> | |
void | createAttribute (const std::string &name, const std::string &data) |
|
inline |
Creating and writing a scalar as an attribute.
[in] | name | Name of the attribute to create |
[in] | data | Reference to scalar attribute value |
|
inline |
Creating and writing a std::vector data as a 1D-array attribute.
[in] | name | Name of the attribute to create |
[in] | buffer | std::vector of attribute data to write |
The shape of the attribute is 1D.
|
inline |
Creating and writing a std::valarray data as a 1D-array attribute.
[in] | name | Name of the attribute to create |
[in] | buffer | std::valarray of attribute data to write |
The shape of the attribute is 1D.
|
inline |
Creating and writing a std::vector data with dimensions (std::array) as an attribute.
[in] | name | Name of the attribute to create |
[in] | dims | Array containing the size of each dimension of the attribute |
[in] | buffer | std::vector of attribute data to write |
|
inline |
Creating and writing a std::valarray data with dimensions (std::array) as an attribute.
[in] | name | Name of the attribute to create |
[in] | dims | Array containing the size of each dimension of the attribute |
[in] | buffer | std::valarray of attribute data to write |
|
inline |
Creating and writing a raw pointer to data with dimensions (std::array) as an attribute.
[in] | name | Name of the attribute to create |
[in] | dims | Array containing the size of each dimension of the attribute |
[in] | buffer | Raw pointer buffer to attribute data to write |
void isce3::io::IGroup::createAttribute | ( | const std::string & | name, |
const H5::DataType & | datatype, | ||
const H5::DataSpace & | dataspace, | ||
const std::string * | buffer | ||
) |
[in] | name | Name of the group attribute to create |
[in] | datatype | H5 data type of the attribute |
[in] | dataspace | H5 data space of the attribute |
[in] | buffer | of std::string values to write |
|
inline |
[in] | name | Name of the attribute to create |
[in] | data | String scalar attribute |
isce3::io::IDataSet isce3::io::IGroup::createDataSet | ( | const std::string & | name, |
const std::string & | data | ||
) |
Create a string scalar dataset and simultaneously write the data.
[in] | name | Name of the dataset to create |
[in] | data | Scalar (std::string) data to write to the dataset |
The dataset is a 1-element dataset
|
inline |
[in] | name | Name of the dataset to create |
[in] | data | Scalar (non std::string) data to write to the dataset |
The dataset is a 1-element dataset
|
inline |
[in] | name | Name of the dataset to create |
[in] | data | std::vector of data to write to the dataset |
The shape of the dataset is 1D. The number of dataset points is inferred from the size of the input data vector. The dataset type is same as data type.
|
inline |
[in] | name | Name of the dataset to create |
[in] | data | std::valarray of data to write to the dataset |
The shape of the dataset is 1D. The number of dataset points is inferred from the size of the input data valarray. The dataset type is same as data type.
|
inline |
[in] | name | Name of the dataset to create |
[in] | data | Raw pointer to data to write to the dataset |
[in] | sz | Number of points in the raw pointer buffer |
The shape of the dataset is 1D. The dataset type is same as data type.
|
inline |
[in] | name | Name of the dataset to create |
[in] | data | std::vector of data to write to the dataset |
[in] | dims | Array containing the size of each dimension of the dataset |
The dataset type is same as data type.
|
inline |
[in] | name | Name of the dataset to create |
[in] | data | std::valarray of data to write to the dataset |
[in] | dims | Array containing the size of each dimension of the dataset |
The dataset type is same as data type.
|
inline |
[in] | name | Name of the dataset to create |
[in] | data | Raw pointer to buffer towrite to the dataset |
[in] | dims | Array containing the size of each dimension of the dataset |
The dataset type is same as data type.
isce3::io::IDataSet isce3::io::IGroup::createDataSet | ( | const std::string & | name, |
const std::array< T2, S > & | dims, | ||
const int | chunk, | ||
const int | shuffle, | ||
const int | deflate | ||
) |
[in] | name | Name of the dataset to create |
[in] | dims | Array containing the size of each dimension of the dataset |
[in] | chunk | 1/0 flag to set dataset chunking |
[in] | shuffle | 1/0 flag to set byte shuffling |
[in] | deflate | [0..9] level of dataset compression |
This interface just create the dataset and does not write any data. Writing is done with the IDataSet write function. To use API specific format (float16, complex,..), this function to create dataset has to be used. Chunking is set to 128x128 chunk on the fastest 2 dimensions only. It is automatically activated if shuffle, deflate or a specfic API format is used. If datatype is of NBIT type (i.e., float16, complex16, n1Bit, n2Bit, the NBIT filter is automatically activated if the chunking is activated.
isce3::io::IGroup isce3::io::IGroup::createGroup | ( | const H5std_string & | name | ) |
Create a group within this group.
[in] | name | Name of the group to create. |
name must contain the full path from root location and name of the group to create.
std::vector< std::string > isce3::io::IGroup::find | ( | const std::string | name, |
const std::string | start = "." , |
||
const std::string | type = "BOTH" , |
||
const std::string | path = "FULL" |
||
) |
Search function for given name in the group.
[in] | name | Regular Expression to search for. |
[in] | start | Relative path from current group to start the search from. |
[in] | type | Type of object to search for. Default: BOTH |
[in] | path | Absolute or Relative path of found object. Default: FULL |
The function returns paths of all objects in the file whose names satisfy name.
param name: can be a regular expression. param type: three types of objects to search for are available: GROUP: only returns groups whose names satisfy the inpout name. DATASET: only return datasets whose names satisfy the input name. BOTH: return groups and datsets whose names satisfy the input name. param path: the returned path of the found objects can be expressed from the current group (path = FULL - this is default) or relative to the start (path = RELATIVE).
H5::DataSpace isce3::io::IGroup::getDataSpace | ( | const std::string & | name | ) |
Return the H5::DataSpace of the given attribute.
[in] | v | Name of the attribute. Returns the H5::DataSpace of the attribute. |
int isce3::io::IGroup::getNumElements | ( | const std::string & | name | ) |
Return the number of elements in the given attribute.
[in] | v | Name of the attribute. Returns the number of elements in the attribute. |
std::string isce3::io::IGroup::getPathname | ( | ) |
Return the path of the group from the file root.
Return the path of the current group from the root location in the file.
isce3::io::IDataSet isce3::io::IGroup::openDataSet | ( | const H5std_string & | name | ) |
Open a given dataset.
Open the dataset of the input name that belongs to the current group.
isce3::io::IGroup isce3::io::IGroup::openGroup | ( | const H5std_string & | name | ) |
Open a given group.
[in] | name | Name of the group to open. |
name must contain the full path from root location and name of the group to open.
|
inline |
Reading scalar attribute given by name.
[in] | att | Name of the attribute |
[out] | v | Attribute scalar value (numeric type). |
Reads the value of the numeral attribute contained in the current group. For attribute containing more than one element, see other functions signature. For attribute of string type, see other signature.
void isce3::io::IGroup::read | ( | std::string & | v, |
const std::string & | att | ||
) |
Reading scalar string attribute given by name.
[in] | att | Name of the attribute |
[out] | v | Attribute scalar value (std::string type). |
Reads the value of a string attribute contained in the current group. For attribute containing more than one elements, see other function signature.
|
inline |
Reading multi-dimensional attribute in raw pointer.
[in] | att | String containing the name of the attribute to read. |
[out] | buffer | Raw pointer to array that will received the read data. |
buffer has to be adequately allocated by caller.
void isce3::io::IGroup::read | ( | std::string * | buffer, |
const std::string & | att | ||
) |
Reading multi-dimensional string attribute in raw pointer.
[in] | att | String containing the name of the attribute to read. |
[out] | buffer | Raw pointer to array that will received the read data. |
buffer has to be adequately allocated by caller.
|
inline |
Reading multi-dimensional attribute in vector.
[in] | att | String containing the name of the attribute to read. |
[out] | buffer | std::vector will received the attribute data. |
If the output container is undersized compared to the data to read the function will size it accordingly. If the container is larger than the data to be read, its size is unchanged. In both case the data read is stored at the beginning of the container.
|
inline |
Reading multi-dimensional attribute in valarray.
[in] | att | String containing the name of the attribute to read. |
[out] | buffer | std::valarray will received the attribute data. |
If the output container is undersized compared to the data to read the function will size it accordingly. If the container is larger than the data to be read, its size is unchanged. In both case the data read is stored at the beginning of the container.