2 #ifndef AFW_TABLE_IO_FitsReader_h_INCLUDED
3 #define AFW_TABLE_IO_FitsReader_h_INCLUDED
12 namespace lsst {
namespace afw {
namespace table {
namespace io {
39 explicit FitsReader(std::string
const & persistedClassName);
61 template <
typename ContainerT>
69 ContainerT container(boost::dynamic_pointer_cast<typename ContainerT::Table>(table));
70 if (!container.getTable()) {
72 pex::exceptions::RuntimeError,
73 "Invalid table class for catalog."
77 container.reserve(nRows);
78 for (std::size_t
row = 0;
row < nRows; ++
row) {
82 const_cast<typename boost::remove_const<typename ContainerT::Record>::type&
>(
97 template <
typename ContainerT,
typename SourceT>
101 return apply<ContainerT>(fits, ioFlags, archive);
153 #endif // !AFW_TABLE_IO_FitsReader_h_INCLUDED
std::size_t countRows()
Return the number of row in a table.
virtual boost::shared_ptr< BaseTable > makeTable(FitsSchemaInputMapper &mapper, boost::shared_ptr< daf::base::PropertyList > metadata, int ioFlags, bool stripMetadata) const
A utility class for reading FITS binary tables.
static ContainerT apply(SourceT &source, int hdu, int ioFlags, boost::shared_ptr< InputArchive > archive=boost::shared_ptr< InputArchive >())
Class for storing ordered metadata with comments.
FitsReader(std::string const &persistedClassName)
static ContainerT apply(afw::fits::Fits &fits, int ioFlags, boost::shared_ptr< InputArchive > archive=boost::shared_ptr< InputArchive >())
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
virtual bool usesArchive(int ioFlags) const
void _setupArchive(afw::fits::Fits &fits, FitsSchemaInputMapper &mapper, boost::shared_ptr< InputArchive > archive, int ioFlags) const
void setHdu(int hdu, bool relative=false)
Set the current HDU.
#define LSST_EXCEPT(type,...)
Base class for all tables.
void readMetadata(daf::base::PropertySet &metadata, bool strip=false)
Read a FITS header into a PropertySet or PropertyList.
static FitsReader const * _lookupFitsReader(daf::base::PropertyList const &metadata)