Alexandria 2.31.2
SDC-CH common library for the Euclid project
|
Functions | |
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. | |
template<typename... AxesTypes> | |
std::tuple< GridAxis< AxesTypes >... > | fixAxis (const std::tuple< GridAxis< AxesTypes >... > &original, size_t axis, size_t index) |
template<typename GridCellManager , typename... AxesTypes> | |
Table::Table | gridContainerToTable (const GridContainer< GridCellManager, AxesTypes... > &grid) |
template<typename Coord > | |
size_t | calculateTotalIndex (const std::vector< size_t > &factors, Coord coord) |
template<typename Coord , typename... RestCoords> | |
size_t | calculateTotalIndex (const std::vector< size_t > &factors, Coord coord, RestCoords... rest_coords) |
template<typename Coord > | |
void | checkBounds (const std::vector< std::string > &axes_names, const std::vector< size_t > &axes_sizes, Coord coord) |
template<typename Coord , typename... RestCoords> | |
void | checkBounds (const std::vector< std::string > &axes_names, const std::vector< size_t > &axes_sizes, Coord coord, RestCoords... rest_coords) |
template<typename IterFrom , typename IterTo , int I> | |
static void | fixSameAxes (IterFrom &from, IterTo &to, const TemplateLoopCounter< I > &) |
template<typename IterFrom , typename IterTo > | |
static void | fixSameAxes (IterFrom &, IterTo &, const TemplateLoopCounter<-1 > &) |
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. | |
size_t Euclid::GridContainer::calculateTotalIndex | ( | const std::vector< size_t > & | factors, |
Coord | coord ) |
Definition at line 47 of file GridIndexHelper.icpp.
References calculateTotalIndex(), and std::vector< T >::size().
Referenced by Euclid::GridContainer::GridIndexHelper< AxesTypes... >::axisIndex(), calculateTotalIndex(), calculateTotalIndex(), and Euclid::GridContainer::GridIndexHelper< AxesTypes >::totalIndex().
size_t Euclid::GridContainer::calculateTotalIndex | ( | const std::vector< size_t > & | factors, |
Coord | coord, | ||
RestCoords... | rest_coords ) |
Definition at line 52 of file GridIndexHelper.icpp.
References calculateTotalIndex(), and std::vector< T >::size().
void Euclid::GridContainer::checkBounds | ( | const std::vector< std::string > & | axes_names, |
const std::vector< size_t > & | axes_sizes, | ||
Coord | coord ) |
Definition at line 62 of file GridIndexHelper.icpp.
References checkBounds(), and std::vector< T >::size().
Referenced by Euclid::GridContainer::GridIndexHelper< AxesTypes... >::axisIndex(), checkBounds(), and checkBounds().
void Euclid::GridContainer::checkBounds | ( | const std::vector< std::string > & | axes_names, |
const std::vector< size_t > & | axes_sizes, | ||
Coord | coord, | ||
RestCoords... | rest_coords ) |
Definition at line 70 of file GridIndexHelper.icpp.
References checkBounds(), and std::vector< T >::size().
std::tuple< GridAxis< AxesTypes >... > Euclid::GridContainer::fixAxis | ( | const std::tuple< GridAxis< AxesTypes >... > & | original, |
size_t | axis, | ||
size_t | index ) |
Definition at line 57 of file GridContainer.icpp.
Referenced by Euclid::GridContainer::GridContainer< GridCellManager, AxesTypes >::GridContainer().
|
static |
Definition at line 181 of file GridIterator.icpp.
|
static |
Definition at line 175 of file GridIterator.icpp.
References Euclid::GridContainer::GridContainer< GridCellManager, AxesTypes >::fixAxisByValue(), and fixSameAxes().
Referenced by Euclid::GridContainer::GridContainer< GridCellManager, AxesTypes >::iter< CellType, PointerType, ReferenceType >::fixAllAxes(), and fixSameAxes().
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.
References gridExport().
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.
References gridImport().
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.
Definition at line 120 of file GridContainerToTable.icpp.
References Euclid::GridContainer::GridCellToTable< T, Enable >::addColumnDescriptions(), std::make_shared(), std::move(), and std::vector< T >::reserve().
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.
Referenced by gridBinaryExport().
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 |
Definition at line 131 of file FitsSerialize.icpp.
References Euclid::GridContainer::GridAxesToFitsHelper< AxesTypes >::addGridAxesToFitsFile(), and Euclid::GridContainer::GridConstructionHelper< Axes >::createAxesSizesVector().
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 |
Definition at line 221 of file FitsSerialize.icpp.
References std::move(), and Euclid::GridContainer::GridAxisFitsReader< GridType >::readAllAxes().
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().
Referenced by gridBinaryImport().
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.