22 class 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.");
37 _fits->writeKey(
"AFW_TYPE",
"SIMPLE",
"Tells lsst::afw to load this as a Simple table.");
51 class SimpleFitsReader :
public io::FitsReader {
53 SimpleFitsReader() : io::FitsReader(
"SIMPLE") {}
57 bool stripMetadata)
const override {
59 table->setMetadata(metadata);
65 static SimpleFitsReader
const simpleFitsReader;
77 if (!checkSchema(schema)) {
79 "Schema for Simple must contain at least the keys defined by makeMinimalSchema().");
85 :
BaseTable(schema), _idFactory(idFactory) {}
88 :
BaseTable(other), _idFactory(other._idFactory ? other._idFactory->
clone() : other._idFactory) {}
94 SimpleTable::MinimalSchema::MinimalSchema() {
97 schema.getCitizen().markPersistent();
100 SimpleTable::MinimalSchema& SimpleTable::getMinimalSchema() {
101 static MinimalSchema it;
106 return std::make_shared<SimpleFitsWriter>(fitsfile, flags);
114 auto record = constructRecord<SimpleRecord>();
Defines the fields and offsets for a table.
std::shared_ptr< BaseRecord > _makeRecord() override
Default-construct an associated record (protected implementation).
A custom container class for records, based on std::vector.
SimpleTable(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
std::shared_ptr< BaseTable > _clone() const override
Clone implementation with noncovariant return types.
Table class that must contain a unique ID field and a celestial coordinate field. ...
A base class for image defects.
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
T dynamic_pointer_cast(T... args)
Reports errors in the logical structure of the program.
virtual void _writeTable(std::shared_ptr< BaseTable const > const &table, std::size_t nRows)
Write a table and its schema.
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
std::shared_ptr< SimpleTable > clone() const
Return a polymorphic deep copy of the table.
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.
Reports invalid arguments.
ItemVariant const * other
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.
Base class for all tables.