26 #ifndef AFW_TABLE_Source_h_INCLUDED 27 #define AFW_TABLE_Source_h_INCLUDED 29 #include "boost/array.hpp" 30 #include "boost/type_traits/is_convertible.hpp" 66 template <
typename RecordT>
123 bool getPsfFluxFlag()
const;
132 bool getModelFluxFlag()
const;
141 bool getApFluxFlag()
const;
150 bool getGaussianFluxFlag()
const;
159 bool getCalibFluxFlag()
const;
168 bool getCentroidFlag()
const;
177 bool getShapeFlag()
const;
186 double getIxx()
const;
189 double getIyy()
const;
192 double getIxy()
const;
195 void updateCoord(geom::SkyWcs
const &
wcs);
249 return make(schema, IdFactory::makeSimple());
263 Schema r = getMinimalSchema().schema;
307 getSchema().getAliasMap()->set(getPsfFluxSlot().getAlias(), name);
320 getSchema().getAliasMap()->set(getModelFluxSlot().getAlias(), name);
333 getSchema().getAliasMap()->set(getApFluxSlot().getAlias(), name);
346 getSchema().getAliasMap()->set(getGaussianFluxSlot().getAlias(), name);
359 getSchema().getAliasMap()->set(getCalibFluxSlot().getAlias(), name);
372 getSchema().getAliasMap()->set(getCentroidSlot().getAlias(), name);
385 return getSchema().getAliasMap()->get(getCentroidSlot().getAlias());
426 getSchema().getAliasMap()->set(getShapeSlot().getAlias(), name);
439 return getSchema().getAliasMap()->get(getShapeSlot().getAlias());
479 void handleAliasChange(
std::string const &alias)
override;
487 struct MinimalSchema {
495 static MinimalSchema &getMinimalSchema();
506 template <
typename RecordT>
510 typedef typename RecordT::Table
Table;
517 return this->operator[](this->getTable()->getPsfFluxSlot().getMeasKey());
521 return this->operator[](this->getTable()->getPsfFluxSlot().getErrKey());
526 return this->operator[](this->getTable()->getApFluxSlot().getMeasKey());
530 return this->operator[](this->getTable()->getApFluxSlot().getErrKey());
535 return this->operator[](this->getTable()->getModelFluxSlot().getMeasKey());
539 return this->operator[](this->getTable()->getModelFluxSlot().getErrKey());
544 return this->operator[](this->getTable()->getGaussianFluxSlot().getMeasKey());
548 return this->operator[](this->getTable()->getGaussianFluxSlot().getErrKey());
553 return this->operator[](this->getTable()->getCalibFluxSlot().getMeasKey());
557 return this->operator[](this->getTable()->getCalibFluxSlot().getErrKey());
560 ndarray::Array<double, 1>
const getX()
const {
561 return this->operator[](this->getTable()->getCentroidKey().getX());
563 ndarray::Array<double, 1>
const getY()
const {
564 return this->operator[](this->getTable()->getCentroidKey().getY());
567 ndarray::Array<double, 1>
const getIxx()
const {
568 return this->operator[](this->getTable()->getShapeKey().getIxx());
570 ndarray::Array<double, 1>
const getIyy()
const {
571 return this->operator[](this->getTable()->getShapeKey().getIyy());
573 ndarray::Array<double, 1>
const getIxy()
const {
574 return this->operator[](this->getTable()->getShapeKey().getIxy());
578 template <
typename InputIterator>
580 InputIterator last) {
597 return this->
get(getTable()->getPsfFluxSlot().getMeasKey());
601 return this->
get(getTable()->getPsfFluxSlot().getErrKey());
604 inline bool SourceRecord::getPsfFluxFlag()
const {
605 return this->
get(getTable()->getPsfFluxSlot().getFlagKey());
609 return this->
get(getTable()->getModelFluxSlot().getMeasKey());
613 return this->
get(getTable()->getModelFluxSlot().getErrKey());
616 inline bool SourceRecord::getModelFluxFlag()
const {
617 return this->
get(getTable()->getModelFluxSlot().getFlagKey());
621 return this->
get(getTable()->getApFluxSlot().getMeasKey());
625 return this->
get(getTable()->getApFluxSlot().getErrKey());
628 inline bool SourceRecord::getApFluxFlag()
const {
629 return this->
get(getTable()->getApFluxSlot().getFlagKey());
633 return this->
get(getTable()->getGaussianFluxSlot().getMeasKey());
637 return this->
get(getTable()->getGaussianFluxSlot().getErrKey());
640 inline bool SourceRecord::getGaussianFluxFlag()
const {
641 return this->
get(getTable()->getGaussianFluxSlot().getFlagKey());
645 return this->
get(getTable()->getCalibFluxSlot().getMeasKey());
649 return this->
get(getTable()->getCalibFluxSlot().getErrKey());
652 inline bool SourceRecord::getCalibFluxFlag()
const {
653 return this->
get(getTable()->getCalibFluxSlot().getFlagKey());
657 return this->
get(getTable()->getCentroidSlot().getMeasKey());
661 return this->
get(getTable()->getCentroidSlot().getErrKey());
664 inline bool SourceRecord::getCentroidFlag()
const {
665 return this->
get(getTable()->getCentroidSlot().getFlagKey());
669 return this->
get(getTable()->getShapeSlot().getMeasKey());
673 return this->
get(getTable()->getShapeSlot().getErrKey());
676 inline bool SourceRecord::getShapeFlag()
const {
return this->
get(getTable()->getShapeSlot().getFlagKey()); }
678 inline RecordId SourceRecord::getParent()
const {
return get(SourceTable::getParentKey()); }
679 inline void SourceRecord::setParent(
RecordId id) {
set(SourceTable::getParentKey(),
id); }
680 inline double SourceRecord::getX()
const {
return get(getTable()->getCentroidKey().getX()); }
681 inline double SourceRecord::getY()
const {
return get(getTable()->getCentroidKey().getY()); }
682 inline double SourceRecord::getIxx()
const {
return get(getTable()->getShapeKey().getIxx()); }
683 inline double SourceRecord::getIyy()
const {
return get(getTable()->getShapeKey().getIyy()); }
684 inline double SourceRecord::getIxy()
const {
return get(getTable()->getShapeKey().getIxy()); }
690 #endif // !AFW_TABLE_Source_h_INCLUDED FluxSlotDefinition const & getGaussianFluxSlot() const
An ellipse core with quadrupole moments as parameters.
bool hasCentroidSlot() const
Return true if the Centroid slot corresponds to a valid field.
Defines the fields and offsets for a table.
ndarray::Array< double, 1 > getCalibInstFlux() const
Get the value of the CalibFlux slot measurement.
Column-wise view into a sequence of records that have been allocated contiguously.
Writer object for FITS binary tables.
FluxSlotDefinition const & getApFluxSlot() const
SortedCatalogT< SourceRecord const > ConstCatalog
Helper struct that contains the information passed from BaseTable to BaseRecord at construction...
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
A mapping between the keys of two Schemas, used to copy data between them.
SourceColumnViewT(BaseColumnView const &base)
SourceColumnViewT< SourceRecord > ColumnView
ShapeSlotDefinition const & getShapeSlot() const
std::shared_ptr< Footprint > getFootprint() const
FluxSlotDefinition const & getCalibFluxSlot() const
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
SortedCatalogT< Record > Catalog
void defineGaussianFlux(std::string const &name)
Set the measurement used for the GaussianFlux slot.
std::shared_ptr< SourceRecord > copyRecord(BaseRecord const &other)
Deep-copy a record, requiring that it have the same schema as this table.
ItemVariant const * other
void definePsfFlux(std::string const &name)
Set the measurement used for the PsfFlux slot.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
std::string getCentroidDefinition() const
Return the name of the field used for the Centroid slot.
ndarray::Array< double, 1 > const getY() const
ndarray::Array< double, 1 > const getX() const
table::Key< table::Array< std::uint8_t > > wcs
An aggregate containing all of the current slots used in SourceTable.
SourceRecord(ConstructionToken const &token, detail::RecordData &&data)
Constructor used by SourceTable.
ndarray::Array< double, 1 > const getIxy() const
ndarray::Array< double, 1 > getGaussianInstFluxErr() const
Get the uncertainty on the GaussianFlux slot measurement.
ndarray::Array< double, 1 > getApInstFlux() const
Get the value of the ApFlux slot measurement.
ndarray::Array< double, 1 > getGaussianInstFlux() const
Get the value of the GaussianFlux slot measurement.
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.
std::shared_ptr< SourceTable const > getTable() const
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
static SourceColumnViewT make(std::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
CentroidSlotDefinition::MeasKey getCentroidKey() const
Return the key used for the Centroid slot measurement value.
ndarray::Array< double, 1 > const getIxx() const
bool hasShapeSlot() const
Return true if the Shape slot corresponds to a valid field.
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
SourceColumnViewT< SourceRecord > SourceColumnView
T static_pointer_cast(T... args)
SortedCatalogT< SourceRecord > Catalog
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.
ndarray::Array< double, 1 > getPsfInstFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
SortedCatalogT< Record const > ConstCatalog
void defineModelFlux(std::string const &name)
Set the measurement used for the ModelFlux slot.
SourceFitsFlags
Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits.
Table class that contains measurements made on a single exposure.
static std::shared_ptr< SourceTable > make(Schema const &schema)
Construct a new table.
Key< Flag > getCentroidFlagKey() const
Return the key used for the Centroid slot failure flag.
CentroidSlotDefinition::ErrKey getCentroidErrKey() const
Return the key used for the Centroid slot uncertainty.
Base class for all records.
A class used as a handle to a particular field in a table.
Key specialization for Flag.
ndarray::Array< double, 1 > getModelInstFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
void setFootprint(std::shared_ptr< Footprint > const &footprint)
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
SlotDefinition specialization for centroids.
Read/write heavy footprints as non-heavy footprints.
lsst::afw::detection::Footprint Footprint
ShapeSlotDefinition::MeasKey getShapeKey() const
Return the key used for the Shape slot measurement value.
Do not read/write footprints at all.
Record class that contains measurements made on a single exposure.
void defineShape(std::string const &name)
Set the measurement used for the Shape slot.
static Key< RecordId > getParentKey()
Key for the parent ID.
std::shared_ptr< SourceTable > clone() const
Return a polymorphic deep copy of the table.
FluxSlotDefinition const & getPsfFluxSlot() const
void defineCentroid(std::string const &name)
Set the measurement used for the Centroid slot.
double ErrValue
Type returned by accessing the slot uncertainty.
FluxSlotDefinition const & getModelFluxSlot() const
ndarray::Array< double, 1 > getApInstFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
Record class that must contain a unique ID field and a celestial coordinate field.
ndarray::Array< double, 1 > getPsfInstFlux() const
Get the value of the PsfFlux slot measurement.
SlotDefinition specialization for shapes.
CentroidSlotDefinition const & getCentroidSlot() const
ndarray::Array< double, 1 > const getIyy() const
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys...
double MeasValue
Type returned by accessing the slot measurement.
ShapeSlotDefinition::ErrKey getShapeErrKey() const
Return the key used for the Shape slot uncertainty.
SlotDefinition specialization for fluxes.
Key< Flag > getShapeFlagKey() const
Return the key used for the Shape slot failure flag.
ndarray::Array< double, 1 > getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
ndarray::Array< double, 1 > getCalibInstFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
std::string getShapeDefinition() const
Return the name of the field used for the Shape slot.
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid SourceTable schema.
SourceColumnViewT< SourceRecord > ColumnView
std::shared_ptr< SourceRecord > makeRecord()
Default-construct an associated record.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.