LSST Applications 24.1.6,g063fba187b+56b85ce14a,g0f08755f38+df8a265115,g12f32b3c4e+891a09f10d,g1524ad2192+7a5d7b3fbd,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g28da252d5a+07cb1400be,g2bbee38e9b+ae03bbfc84,g2bc492864f+ae03bbfc84,g3156d2b45e+6e55a43351,g347aa1857d+ae03bbfc84,g35bb328faa+a8ce1bb630,g3a166c0a6a+ae03bbfc84,g3e281a1b8c+c5dd892a6c,g414038480c+6b9177ef31,g41af890bb2+8f257c4c0b,g781aacb6e4+a8ce1bb630,g7af13505b9+7137b3b17d,g80478fca09+6df6903293,g82479be7b0+091ce1d07f,g858d7b2824+df8a265115,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,g9726552aa6+414189b318,ga5288a1d22+4a2bca08d7,gacef1a1666+c9a8ff65f4,gb58c049af0+d64f4d3760,gbcfae0f0a0+de1d42d831,gc28159a63d+ae03bbfc84,gcf0d15dbbd+72117bf34e,gda6a2b7d83+72117bf34e,gdaeeff99f8+1711a396fd,ge500cccec5+c8c9c9af63,ge79ae78c31+ae03bbfc84,gf0baf85859+c1f95f4921,gfa517265be+df8a265115,gfa999e8aa5+17cd334064,gfb92a5be7c+df8a265115
LSST Data Management Base Package
|
A class that describes a mapping from a FITS binary table to an afw::table Schema. More...
#include <FitsSchemaInputMapper.h>
Classes | |
class | Impl |
Public Types | |
using | Item = FitsSchemaItem |
Public Member Functions | |
FitsSchemaInputMapper (daf::base::PropertyList &metadata, bool stripMetadata) | |
Construct a mapper from a PropertyList of FITS header values, stripping recognized keys if desired. | |
FitsSchemaInputMapper (FitsSchemaInputMapper const &) | |
FitsSchemaInputMapper (FitsSchemaInputMapper &&) | |
FitsSchemaInputMapper & | operator= (FitsSchemaInputMapper const &) |
FitsSchemaInputMapper & | operator= (FitsSchemaInputMapper &&) |
~FitsSchemaInputMapper () | |
void | setArchive (std::shared_ptr< InputArchive > archive) |
Set the Archive to an externally-provided one, overriding any that may have been read. | |
bool | readArchive (afw::fits::Fits &fits) |
Set the Archive by reading from the HDU specified by the AR_HDU header entry. | |
bool | hasArchive () const |
Return true if the mapper has an InputArchive. | |
Item const * | find (std::string const &ttype) const |
Find an item with the given column name (ttype), returning nullptr if no such column exists. | |
Item const * | find (int column) const |
Find an item with the given column number, returning nullptr if no such column exists. | |
void | erase (Item const *item) |
Remove the given item (which should have been retrieved via find()) from the mapping, preventing it from being included in the regular fields added by finalize(). | |
void | erase (std::string const &ttype) |
Remove the item with the given column name (ttype) from the mapping, preventing it from being included in the regular fields added by finalize(). | |
void | erase (int column) |
Remove the item at the given column position from the mapping, preventing it from being included in the regular fields added by finalize(). | |
void | customize (std::unique_ptr< FitsColumnReader > reader) |
Customize a mapping by providing a FitsColumnReader instance that will be invoked by readRecords(). | |
Schema | finalize () |
Map any remaining items into regular Schema items, and return the final Schema. | |
void | readRecord (BaseRecord &record, afw::fits::Fits &fits, std::size_t row) |
Fill a record from a FITS binary table row. | |
Static Public Attributes | |
static std::size_t | PREPPED_ROWS_FACTOR = 1 << 15 |
When processing each column, divide this number by the record size (in bytes) and ask CFITSIO to read this many that of values from that column in a single call. | |
A class that describes a mapping from a FITS binary table to an afw::table Schema.
A FitsSchemaInputMapper is created every time a FITS binary table is read into an afw::table catalog, allowing limited customization of the mapping between on-disk FITS table columns an in-memory fields by subclasses of BaseTable.
The object is constructed from a daf::base::PropertyList that represents the FITS header, which is used to populate a custom container of FitsSchemaItems. These can then be retrieved by name or column number via the find() methods, allowing the user to create custom readers for columns or groups of columns via addColumnReader(). They can also be removed from the "regular" fields via the erase() method. Those regular fields are filled in by the finalize() method, which automatically generates mappings for any FitsSchemaItems that have not been removed by calls to erase(). Once finalize() has been called, readRecord() may be called repeatedly to read FITS rows into record objects according to the mapping that has been defined.
Definition at line 91 of file FitsSchemaInputMapper.h.
Definition at line 93 of file FitsSchemaInputMapper.h.
lsst::afw::table::io::FitsSchemaInputMapper::FitsSchemaInputMapper | ( | daf::base::PropertyList & | metadata, |
bool | stripMetadata ) |
Construct a mapper from a PropertyList of FITS header values, stripping recognized keys if desired.
Definition at line 89 of file FitsSchemaInputMapper.cc.
|
default |
|
default |
|
default |
void lsst::afw::table::io::FitsSchemaInputMapper::customize | ( | std::unique_ptr< FitsColumnReader > | reader | ) |
Customize a mapping by providing a FitsColumnReader instance that will be invoked by readRecords().
Definition at line 353 of file FitsSchemaInputMapper.cc.
void lsst::afw::table::io::FitsSchemaInputMapper::erase | ( | int | column | ) |
Remove the item at the given column position from the mapping, preventing it from being included in the regular fields added by finalize().
Definition at line 344 of file FitsSchemaInputMapper.cc.
Remove the given item (which should have been retrieved via find()) from the mapping, preventing it from being included in the regular fields added by finalize().
Definition at line 331 of file FitsSchemaInputMapper.cc.
void lsst::afw::table::io::FitsSchemaInputMapper::erase | ( | std::string const & | ttype | ) |
Remove the item with the given column name (ttype) from the mapping, preventing it from being included in the regular fields added by finalize().
Definition at line 337 of file FitsSchemaInputMapper.cc.
Schema lsst::afw::table::io::FitsSchemaInputMapper::finalize | ( | ) |
Map any remaining items into regular Schema items, and return the final Schema.
This method must be called before any calls to readRecords().
Definition at line 771 of file FitsSchemaInputMapper.cc.
FitsSchemaItem const * lsst::afw::table::io::FitsSchemaInputMapper::find | ( | int | column | ) | const |
Find an item with the given column number, returning nullptr if no such column exists.
The returned pointer is owned by the mapper object, and should not be deleted. It is invalidated by calls to either erase() or finalize().
Definition at line 323 of file FitsSchemaInputMapper.cc.
FitsSchemaItem const * lsst::afw::table::io::FitsSchemaInputMapper::find | ( | std::string const & | ttype | ) | const |
Find an item with the given column name (ttype), returning nullptr if no such column exists.
The returned pointer is owned by the mapper object, and should not be deleted. It is invalidated by calls to either erase() or finalize().
Definition at line 315 of file FitsSchemaInputMapper.cc.
bool lsst::afw::table::io::FitsSchemaInputMapper::hasArchive | ( | ) | const |
Return true if the mapper has an InputArchive.
Definition at line 313 of file FitsSchemaInputMapper.cc.
|
default |
|
default |
bool lsst::afw::table::io::FitsSchemaInputMapper::readArchive | ( | afw::fits::Fits & | fits | ) |
Set the Archive by reading from the HDU specified by the AR_HDU header entry.
Returns true on success, false if there is no AR_HDU entry.
Definition at line 297 of file FitsSchemaInputMapper.cc.
void lsst::afw::table::io::FitsSchemaInputMapper::readRecord | ( | BaseRecord & | record, |
afw::fits::Fits & | fits, | ||
std::size_t | row ) |
Fill a record from a FITS binary table row.
Definition at line 869 of file FitsSchemaInputMapper.cc.
void lsst::afw::table::io::FitsSchemaInputMapper::setArchive | ( | std::shared_ptr< InputArchive > | archive | ) |
Set the Archive to an externally-provided one, overriding any that may have been read.
Definition at line 295 of file FitsSchemaInputMapper.cc.
|
static |
When processing each column, divide this number by the record size (in bytes) and ask CFITSIO to read this many that of values from that column in a single call.
Both FITS binary tables and afw.table are stored row-major, so reading multiple rows from a single column at a time leads to nonsequential reads. But given the way the I/O code is structured, we tend to get nonsequential reads anyway, and it seems the per-call overload to CFITSIO is sufficiently high that it's best to do this anyway for all but the largest record sizes.
Definition at line 107 of file FitsSchemaInputMapper.h.