22class SimpleFitsWriter :
public io::FitsWriter {
24 explicit SimpleFitsWriter(Fits* fits,
int flags) : io::FitsWriter(fits, flags) {}
34 "Cannot use a SimpleFitsWriter on a non-Simple table.");
36 io::FitsWriter::_writeTable(table, nRows);
37 _fits->writeKey(
"AFW_TYPE",
"SIMPLE",
"Tells lsst::afw to load this as a Simple table.");
51class SimpleFitsReader :
public io::FitsReader {
53 SimpleFitsReader() : io::FitsReader(
"SIMPLE") {}
57 bool stripMetadata)
const override {
59 table->setMetadata(metadata);
65static SimpleFitsReader
const simpleFitsReader;
77 if (!checkSchema(
schema)) {
79 "Schema for Simple must contain at least the keys defined by makeMinimalSchema().");
88 :
BaseTable(other), _idFactory(other._idFactory ? other._idFactory->
clone() : other._idFactory) {}
94SimpleTable::MinimalSchema::MinimalSchema() {
99SimpleTable::MinimalSchema& SimpleTable::getMinimalSchema() {
100 static MinimalSchema it;
105 return std::make_shared<SimpleFitsWriter>(
fitsfile, flags);
#define LSST_EXCEPT(type,...)
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
Tag types used to declare specialized field types.
Base class for all tables.
static CoordKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc)
Add a pair of _ra, _dec fields to a Schema, and return a CoordKey that points to them.
Defines the fields and offsets for a table.
Key< T > addField(Field< T > const &field, bool doReplace=false)
Add a new field to the Schema, and return the associated Key.
Table class that must contain a unique ID field and a celestial coordinate field.
std::shared_ptr< BaseTable > _clone() const override
Clone implementation with noncovariant return types.
std::shared_ptr< io::FitsWriter > makeFitsWriter(fits::Fits *fitsfile, int flags) const override
std::shared_ptr< BaseRecord > _makeRecord() override
Default-construct an associated record (protected implementation).
std::shared_ptr< IdFactory > getIdFactory()
Return the object that generates IDs for the table (may be null).
static std::shared_ptr< SimpleTable > make(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
Construct a new table.
SimpleTable(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)