24 #ifndef AFW_TABLE_Source_h_INCLUDED
25 #define AFW_TABLE_Source_h_INCLUDED
27 #include "boost/array.hpp"
28 #include "boost/type_traits/is_convertible.hpp"
64 template <
typename RecordT>
261 Schema r = getMinimalSchema().schema;
282 return std::static_pointer_cast<SourceRecord>(
_makeRecord());
403 struct MinimalSchema {
411 static MinimalSchema &getMinimalSchema();
422 template <
typename RecordT>
426 typedef typename RecordT::Table
Table;
476 ndarray::Array<double, 1>
const getX()
const {
479 ndarray::Array<double, 1>
const getY()
const {
483 ndarray::Array<double, 1>
const getIxx()
const {
486 ndarray::Array<double, 1>
const getIyy()
const {
489 ndarray::Array<double, 1>
const getIxy()
const {
494 template <
typename InputIterator>
496 InputIterator last) {
513 return this->
get(
getTable()->getPsfFluxSlot().getMeasKey());
517 return this->
get(
getTable()->getPsfFluxSlot().getErrKey());
521 return this->
get(
getTable()->getPsfFluxSlot().getFlagKey());
525 return this->
get(
getTable()->getModelFluxSlot().getMeasKey());
529 return this->
get(
getTable()->getModelFluxSlot().getErrKey());
533 return this->
get(
getTable()->getModelFluxSlot().getFlagKey());
537 return this->
get(
getTable()->getApFluxSlot().getMeasKey());
541 return this->
get(
getTable()->getApFluxSlot().getErrKey());
545 return this->
get(
getTable()->getApFluxSlot().getFlagKey());
549 return this->
get(
getTable()->getGaussianFluxSlot().getMeasKey());
553 return this->
get(
getTable()->getGaussianFluxSlot().getErrKey());
557 return this->
get(
getTable()->getGaussianFluxSlot().getFlagKey());
561 return this->
get(
getTable()->getCalibFluxSlot().getMeasKey());
565 return this->
get(
getTable()->getCalibFluxSlot().getErrKey());
569 return this->
get(
getTable()->getCalibFluxSlot().getFlagKey());
573 return this->
get(
getTable()->getCentroidSlot().getMeasKey());
577 return this->
get(
getTable()->getCentroidSlot().getErrKey());
581 return this->
get(
getTable()->getCentroidSlot().getFlagKey());
585 return this->
get(
getTable()->getShapeSlot().getMeasKey());
589 return this->
get(
getTable()->getShapeSlot().getErrKey());
table::Key< std::string > name
ItemVariant const * other
table::Key< table::Array< std::uint8_t > > wcs
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
An ellipse core with quadrupole moments as parameters.
Column-wise view into a sequence of records that have been allocated contiguously.
static BaseColumnView make(std::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
ndarray::ArrayRef< T, 1 > const operator[](Key< T > const &key) const
Return a 1-d array corresponding to a scalar field (or subfield).
Base class for all records.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
std::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
Schema getSchema() const
Return the table's schema.
std::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
SlotDefinition specialization for centroids.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
std::shared_ptr< Table > getTable() const
Return the table that owns the records.
SlotDefinition specialization for fluxes.
double ErrValue
Type returned by accessing the slot uncertainty.
double MeasValue
Type returned by accessing the slot measurement.
static std::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
A class used as a handle to a particular field in a table.
Defines the fields and offsets for a table.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
std::shared_ptr< AliasMap > getAliasMap() const
Return the map of aliases.
A mapping between the keys of two Schemas, used to copy data between them.
SlotDefinition specialization for shapes.
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
Record class that must contain a unique ID field and a celestial coordinate field.
Table class that must contain a unique ID field and a celestial coordinate field.
Custom catalog class for record/table subclasses that are guaranteed to have an ID,...
SourceColumnViewT & operator=(SourceColumnViewT const &)=default
ndarray::Array< double, 1 > getPsfInstFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
ndarray::Array< double, 1 > getApInstFlux() const
Get the value of the ApFlux slot measurement.
ndarray::Array< double, 1 > const getY() const
ndarray::Array< double, 1 > getApInstFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
SourceColumnViewT(BaseColumnView const &base)
ndarray::Array< double, 1 > getCalibInstFlux() const
Get the value of the CalibFlux slot measurement.
ndarray::Array< double, 1 > getGaussianInstFluxErr() const
Get the uncertainty on the GaussianFlux slot measurement.
~SourceColumnViewT()=default
ndarray::Array< double, 1 > getPsfInstFlux() const
Get the value of the PsfFlux slot measurement.
SourceColumnViewT & operator=(SourceColumnViewT &&)=default
ndarray::Array< double, 1 > const getIxy() const
ndarray::Array< double, 1 > getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
static SourceColumnViewT make(std::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
SourceColumnViewT(SourceColumnViewT &&)=default
ndarray::Array< double, 1 > getGaussianInstFlux() const
Get the value of the GaussianFlux slot measurement.
SourceColumnViewT(SourceColumnViewT const &)=default
ndarray::Array< double, 1 > const getX() const
ndarray::Array< double, 1 > const getIyy() const
ndarray::Array< double, 1 > getModelInstFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
ndarray::Array< double, 1 > const getIxx() const
ndarray::Array< double, 1 > getCalibInstFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
Record class that contains measurements made on a single exposure.
FluxSlotDefinition::ErrValue getCalibInstFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied.
double getIxx() const
Return the shape slot Ixx value.
std::shared_ptr< SourceTable const > getTable() const
SourceRecord & operator=(SourceRecord &&)=delete
bool getCalibFluxFlag() const
Return true if the measurement in the CalibFlux slot failed.
FluxSlotDefinition::ErrValue getGaussianInstFluxErr() const
Get the uncertainty on the GaussianFlux slot measurement.
SourceRecord & operator=(const SourceRecord &)=delete
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
SortedCatalogT< SourceRecord const > ConstCatalog
double getX() const
Return the centroid slot x coordinate.
void updateCoord(geom::SkyWcs const &wcs)
Update the coord field using the given Wcs and the field in the centroid slot.
double getY() const
Return the centroid slot y coordinate.
FluxSlotDefinition::MeasValue getGaussianInstFlux() const
Get the value of the GaussianFlux slot measurement.
double getIyy() const
Return the shape slot Iyy value.
CentroidSlotDefinition::MeasValue getCentroid() const
Get the value of the Centroid slot measurement.
bool getCentroidFlag() const
Return true if the measurement in the Centroid slot failed.
FluxSlotDefinition::MeasValue getApInstFlux() const
Get the value of the ApFlux slot measurement.
bool getModelFluxFlag() const
Return true if the measurement in the ModelFlux slot failed.
void setParent(RecordId id)
SourceColumnViewT< SourceRecord > ColumnView
FluxSlotDefinition::MeasValue getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
double getIxy() const
Return the shape slot Ixy value.
SourceRecord(const SourceRecord &)=delete
SortedCatalogT< SourceRecord > Catalog
ShapeSlotDefinition::ErrValue getShapeErr() const
Get the uncertainty on the Shape slot measurement.
FluxSlotDefinition::ErrValue getPsfInstFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
ShapeSlotDefinition::MeasValue getShape() const
Get the value of the Shape slot measurement.
RecordId getParent() const
Convenience accessors for the keys in the minimal source schema.
CentroidSlotDefinition::ErrValue getCentroidErr() const
Get the uncertainty on the Centroid slot measurement.
FluxSlotDefinition::MeasValue getPsfInstFlux() const
Get the value of the PsfFlux slot measurement.
FluxSlotDefinition::ErrValue getApInstFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
std::shared_ptr< Footprint > getFootprint() const
SourceRecord(SourceRecord &&)=delete
void setFootprint(std::shared_ptr< Footprint > const &footprint)
bool getGaussianFluxFlag() const
Return true if the measurement in the GaussianFlux slot failed.
FluxSlotDefinition::ErrValue getModelInstFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
FluxSlotDefinition::MeasValue getCalibInstFlux() const
Get the value of the CalibFlux slot measurement.
bool getPsfFluxFlag() const
Return true if the measurement in the PsfFlux slot failed.
SourceRecord(ConstructionToken const &token, detail::RecordData &&data)
Constructor used by SourceTable.
bool getApFluxFlag() const
Return true if the measurement in the ApFlux slot failed.
Table class that contains measurements made on a single exposure.
SourceTable & operator=(SourceTable &&)=delete
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
static std::shared_ptr< SourceTable > make(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
Construct a new table.
std::shared_ptr< SourceTable > clone() const
Return a polymorphic deep copy of the table.
FluxSlotDefinition const & getPsfFluxSlot() const
SourceTable(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
FluxSlotDefinition const & getApFluxSlot() const
FluxSlotDefinition const & getGaussianFluxSlot() const
std::shared_ptr< SourceRecord > copyRecord(BaseRecord const &other, SchemaMapper const &mapper)
Deep-copy a record, requiring that it have the same schema as this table.
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
std::shared_ptr< BaseRecord > _makeRecord() override
Default-construct an associated record (protected implementation).
void definePsfFlux(std::string const &name)
Set the measurement used for the PsfFlux slot.
static Key< RecordId > getParentKey()
Key for the parent ID.
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
static std::shared_ptr< SourceTable > make(Schema const &schema)
Construct a new table.
SourceTable & operator=(SourceTable const &)=delete
SortedCatalogT< Record > Catalog
FluxSlotDefinition const & getModelFluxSlot() const
ShapeSlotDefinition const & getShapeSlot() const
void defineGaussianFlux(std::string const &name)
Set the measurement used for the GaussianFlux slot.
std::shared_ptr< SourceRecord > makeRecord()
Default-construct an associated record.
void defineShape(std::string const &name)
Set the measurement used for the Shape slot.
std::shared_ptr< BaseTable > _clone() const override
Clone implementation with noncovariant return types.
FluxSlotDefinition const & getCalibFluxSlot() const
CentroidSlotDefinition const & getCentroidSlot() const
void handleAliasChange(std::string const &alias) override
void defineCentroid(std::string const &name)
Set the measurement used for the Centroid slot.
SourceColumnViewT< SourceRecord > ColumnView
std::shared_ptr< SourceRecord > copyRecord(BaseRecord const &other)
Deep-copy a record, requiring that it have the same schema as this table.
void defineModelFlux(std::string const &name)
Set the measurement used for the ModelFlux slot.
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid SourceTable schema.
SortedCatalogT< Record const > ConstCatalog
Writer object for FITS binary tables.
lsst::afw::detection::Footprint Footprint
SourceColumnViewT< SourceRecord > SourceColumnView
SourceFitsFlags
Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits.
@ SOURCE_IO_NO_FOOTPRINTS
Do not read/write footprints at all.
@ SOURCE_IO_NO_HEAVY_FOOTPRINTS
Read/write heavy footprints as non-heavy footprints.
A base class for image defects.
An aggregate containing all of the current slots used in SourceTable.
CentroidSlotDefinition defCentroid
FluxSlotDefinition defModelFlux
FluxSlotDefinition defCalibFlux
FluxSlotDefinition defApFlux
FluxSlotDefinition defPsfFlux
ShapeSlotDefinition defShape
FluxSlotDefinition defGaussianFlux
Helper struct that contains the information passed from BaseTable to BaseRecord at construction.