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
virtual bool usesArchive(int ioFlags) const
A utility class for reading FITS binary tables.
void setHdu(int hdu, bool relative=false)
Set the current HDU.
Class for storing ordered metadata with comments.
void readMetadata(daf::base::PropertySet &metadata, bool strip=false)
Read a FITS header into a PropertySet or PropertyList.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
void _setupArchive(afw::fits::Fits &fits, FitsSchemaInputMapper &mapper, boost::shared_ptr< InputArchive > archive, int ioFlags) const
std::size_t countRows()
Return the number of row in a table.
FitsReader(std::string const &persistedClassName)
#define LSST_EXCEPT(type,...)
virtual boost::shared_ptr< BaseTable > makeTable(FitsSchemaInputMapper &mapper, boost::shared_ptr< daf::base::PropertyList > metadata, int ioFlags, bool stripMetadata) const
static ContainerT apply(SourceT &source, int hdu, int ioFlags, boost::shared_ptr< InputArchive > archive=boost::shared_ptr< InputArchive >())
static FitsReader const * _lookupFitsReader(daf::base::PropertyList const &metadata)
static ContainerT apply(afw::fits::Fits &fits, int ioFlags, boost::shared_ptr< InputArchive > archive=boost::shared_ptr< InputArchive >())
Base class for all tables.