Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
Classes | |
class | GridAxis |
Provides information related with an axis of a GridContainer. More... | |
struct | GridAxisToTable |
struct | GridAxisToTable< Euclid::XYDataset::QualifiedName > |
class | GridCellManagerTraits |
Class used by the GridContainer to access the different CellManagers. More... | |
struct | GridCellManagerTraits< GridCellManagerVectorOfVectors< T > > |
struct | GridCellManagerTraits< std::vector< T > > |
struct | GridCellManagerVectorOfVectors |
struct | GridCellToTable |
struct | GridCellToTable< T, typename std::enable_if< std::is_arithmetic< T >::value >::type > |
class | GridConstructionHelper |
GridContainer construction helper class. More... | |
class | GridContainer |
Representation of a multi-dimensional grid which contains axis information. More... | |
class | GridIndexHelper |
Helper class for converting multi-dimensional grid coordinates to the index of a long data array and vice versa. More... | |
struct | TemplateLoopCounter |
struct | VectorValueProxy |
Functions | |
template<typename GridCellManager , typename... AxesTypes> | |
Table::Table | gridContainerToTable (const GridContainer< GridCellManager, AxesTypes... > &grid) |
template<typename... AxesTypes> | |
GridIndexHelper< AxesTypes... > | makeGridIndexHelper (const std::tuple< GridAxis< AxesTypes >... > &axes_tuple) |
template<typename OArchive , typename GridCellManager , typename... AxesTypes> | |
void | gridExport (std::ostream &out, const GridContainer< GridCellManager, AxesTypes... > &grid) |
Export to the given output stream the given grid. The archive type is templated. | |
template<typename GridType , typename IArchive > | |
GridType | gridImport (std::istream &in) |
Imports from the given stream a grid. | |
template<typename GridCellManager , typename... AxesTypes> | |
void | gridBinaryExport (std::ostream &out, const GridContainer< GridCellManager, AxesTypes... > &grid) |
Exports to the given output stream the given grid. | |
template<typename GridType > | |
GridType | gridBinaryImport (std::istream &in) |
Imports from the given stream a grid. | |
template<typename GridCellManager , typename... AxesTypes> | |
void | gridFitsExport (const boost::filesystem::path &filename, const std::string &hdu_name, const GridContainer< GridCellManager, AxesTypes... > &grid) |
Exports a Grid as a FITS file. | |
template<typename GridType > | |
GridType | gridFitsImport (const boost::filesystem::path &filename, int hdu_index) |
Imports a Grid from a FITS file. | |
void Euclid::GridContainer::gridBinaryExport | ( | std::ostream & | out, |
const GridContainer< GridCellManager, AxesTypes... > & | grid | ||
) |
Exports to the given output stream the given grid.
GridCellManager | the type of the cell manager of the GridContainer |
AxesTypes | the types of the GridContainer axes knot values |
out | The stream to write the grid in |
grid | The grid to export |
Definition at line 103 of file serialize.h.
GridType Euclid::GridContainer::gridBinaryImport | ( | std::istream & | in | ) |
Imports from the given stream a grid.
GridType | the type of the grid to read from the stream |
in | The stream to read the grid from |
Definition at line 115 of file serialize.h.
Table::Table Euclid::GridContainer::gridContainerToTable | ( | const GridContainer< GridCellManager, AxesTypes... > & | grid | ) |
Transform a GridContainer into a Table, with an entry for each cell. The content will be unfolded, so the knot values will be repeated.
void Euclid::GridContainer::gridExport | ( | std::ostream & | out, |
const GridContainer< GridCellManager, AxesTypes... > & | grid | ||
) |
Export to the given output stream the given grid. The archive type is templated.
The current implementation uses boost serialization and it requires that the GridCellManager and all the axes values are serializable. Also the GridCellManagerTraits specialization for the specific GridCellManager must have the enable_boost_serialize flag set to true.
Note that if any of the required types is not boost serializable, compilation of this method will fail. Non serializable grids of this type can still be used if there is no call to this method.
OArchive | boost output archive type |
GridCellManager | the type of the cell manager of the GridContainer |
AxesTypes | the types of the GridContainer axes knot values |
out | The stream to write the grid in |
grid | The grid to export |
Definition at line 58 of file serialize.h.
void Euclid::GridContainer::gridFitsExport | ( | const boost::filesystem::path & | filename, |
const std::string & | hdu_name, | ||
const GridContainer< GridCellManager, AxesTypes... > & | grid | ||
) |
Exports a Grid as a FITS file.
The grid cell values are stored in an array HDU. Grids with cell types which are not one of the default FITS array types are not supported (compilation will fail). The name of this HDU is the name given with the parameter hdu_name.
The array HDU is followed with one binary table HDU per grid axis, where the axes knot values are stored. The names of these HDUs are following the format: <AXISNAME>_<hdu_name>, where the hdu_name is the one of the array HDU. Note that the axes knots must be of one of the default FITS binary table types. This behavior can be extended by specializing the GridAxisValueFitsHelper template (this is already done for the XYDataset::QualifiedName).
If the FITS file does not already exist, this method will create it. If it exists, the grid related HDUs will be appended to the file. Note that if the FITS file is being created, the primary HDU is left empty and the array HDU with the grid data is the first extension.
filename | The FITS file to store the grid |
hdu_name | The name of the array HDU |
grid | The grid to store |
GridType Euclid::GridContainer::gridFitsImport | ( | const boost::filesystem::path & | filename, |
int | hdu_index | ||
) |
Imports a Grid from a FITS file.
The FITS file must follow the format as described in the gridFitsExport() documentation. The given HDU index is the index of the array HDU with the grid data.
filename | The FITS file containing the grid |
hdu_index | The index of the array HDU with the grid data |
GridType Euclid::GridContainer::gridImport | ( | std::istream & | in | ) |
Imports from the given stream a grid.
The current implementation uses boost serialization and it requires that the GridCellManager and all the axes values are serializable. Also the GridCellManagerTraits specialization for the specific GridCellManager must have the enable_boost_serialize flag set to true.
Note that if any of the required types is not boost serializable, compilation of this method will fail. Non serializable grids of this type can still be used if there is no call to this method.
GridType | the type of the grid to read from the stream |
IArchive | the type of the input archive |
in | The stream to read the grid from |
Definition at line 83 of file serialize.h.
References std::move().
GridIndexHelper< AxesTypes... > Euclid::GridContainer::makeGridIndexHelper | ( | const std::tuple< GridAxis< AxesTypes >... > & | axes_tuple | ) |
Factory method for simplifying the creation of GridIndexHelper instances. It is equivalent with using the constructor by specifying the AxesTypes template parameters.
AxesTypes | the types of the GridContainer axes |
axes_tuple | the information of the GridContainer axes |
Definition at line 128 of file GridIndexHelper.h.