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>
121 bool getPsfFluxFlag()
const;
130 bool getModelFluxFlag()
const;
139 bool getApFluxFlag()
const;
148 bool getGaussianFluxFlag()
const;
157 bool getCalibFluxFlag()
const;
166 bool getCentroidFlag()
const;
175 bool getShapeFlag()
const;
184 double getIxx()
const;
187 double getIyy()
const;
190 double getIxy()
const;
193 void updateCoord(geom::SkyWcs
const &
wcs);
247 return make(schema, IdFactory::makeSimple());
261 Schema r = getMinimalSchema().schema;
305 getSchema().getAliasMap()->set(getPsfFluxSlot().getAlias(), name);
318 getSchema().getAliasMap()->set(getModelFluxSlot().getAlias(), name);
331 getSchema().getAliasMap()->set(getApFluxSlot().getAlias(), name);
344 getSchema().getAliasMap()->set(getGaussianFluxSlot().getAlias(), name);
357 getSchema().getAliasMap()->set(getCalibFluxSlot().getAlias(), name);
370 getSchema().getAliasMap()->set(getCentroidSlot().getAlias(), name);
383 [deprecated(
"Use `getSchema().getAliasMap()->get(\"slot_Centroid\")` instead. To be removed " 387 return getSchema().getAliasMap()->get(getCentroidSlot().getAlias());
395 [[deprecated(
"Use `getCentroidSlot().isValid()` instead. To be removed after 20.0.0.")]]
398 return getCentroidSlot().isValid();
407 [deprecated(
"Use `getCentroidSlot().getMeasKey()` instead. To be removed after " 411 return getCentroidSlot().getMeasKey();
420 [deprecated(
"Use `getCentroidSlot().getErrKey()` instead. To be removed after " 424 return getCentroidSlot().getErrKey();
432 [[deprecated(
"Use `getCentroidSlot().getFlagKey()` instead. To be removed after 20.0.0.")]]
435 return getCentroidSlot().getFlagKey();
448 getSchema().getAliasMap()->set(getShapeSlot().getAlias(), name);
461 [deprecated(
"Use `getSchema().getAliasMap()->get(\"slot_Shape\")` instead. To be removed after " 465 return getSchema().getAliasMap()->get(getShapeSlot().getAlias());
473 [[deprecated(
"Use `getShapeSlot().isValid()` instead. To be removed after 20.0.0.")]]
476 return getShapeSlot().isValid();
484 [[deprecated(
"Use `getShapeSlot().getMeasKey()` instead. To be removed after 20.0.0.")]]
487 return getShapeSlot().getMeasKey();
495 [[deprecated(
"Use `getShapeSlot().getErrKey()` instead. To be removed after 20.0.0.")]]
498 return getShapeSlot().getErrKey();
506 [[deprecated(
"Use `getShapeSlot().getFlagKey()` instead. To be removed after 20.0.0.")]]
509 return getShapeSlot().getFlagKey();
521 void handleAliasChange(
std::string const &alias)
override;
529 struct MinimalSchema {
537 static MinimalSchema &getMinimalSchema();
548 template <
typename RecordT>
552 typedef typename RecordT::Table
Table;
559 return this->operator[](this->getTable()->getPsfFluxSlot().getMeasKey());
563 return this->operator[](this->getTable()->getPsfFluxSlot().getErrKey());
568 return this->operator[](this->getTable()->getApFluxSlot().getMeasKey());
572 return this->operator[](this->getTable()->getApFluxSlot().getErrKey());
577 return this->operator[](this->getTable()->getModelFluxSlot().getMeasKey());
581 return this->operator[](this->getTable()->getModelFluxSlot().getErrKey());
586 return this->operator[](this->getTable()->getGaussianFluxSlot().getMeasKey());
590 return this->operator[](this->getTable()->getGaussianFluxSlot().getErrKey());
595 return this->operator[](this->getTable()->getCalibFluxSlot().getMeasKey());
599 return this->operator[](this->getTable()->getCalibFluxSlot().getErrKey());
602 ndarray::Array<double, 1>
const getX()
const {
603 return this->operator[](this->getTable()->getCentroidKey().getX());
605 ndarray::Array<double, 1>
const getY()
const {
606 return this->operator[](this->getTable()->getCentroidKey().getY());
609 ndarray::Array<double, 1>
const getIxx()
const {
610 return this->operator[](this->getTable()->getShapeKey().getIxx());
612 ndarray::Array<double, 1>
const getIyy()
const {
613 return this->operator[](this->getTable()->getShapeKey().getIyy());
615 ndarray::Array<double, 1>
const getIxy()
const {
616 return this->operator[](this->getTable()->getShapeKey().getIxy());
620 template <
typename InputIterator>
622 InputIterator last) {
639 return this->
get(getTable()->getPsfFluxSlot().getMeasKey());
643 return this->
get(getTable()->getPsfFluxSlot().getErrKey());
646 inline bool SourceRecord::getPsfFluxFlag()
const {
647 return this->
get(getTable()->getPsfFluxSlot().getFlagKey());
651 return this->
get(getTable()->getModelFluxSlot().getMeasKey());
655 return this->
get(getTable()->getModelFluxSlot().getErrKey());
658 inline bool SourceRecord::getModelFluxFlag()
const {
659 return this->
get(getTable()->getModelFluxSlot().getFlagKey());
663 return this->
get(getTable()->getApFluxSlot().getMeasKey());
667 return this->
get(getTable()->getApFluxSlot().getErrKey());
670 inline bool SourceRecord::getApFluxFlag()
const {
671 return this->
get(getTable()->getApFluxSlot().getFlagKey());
675 return this->
get(getTable()->getGaussianFluxSlot().getMeasKey());
679 return this->
get(getTable()->getGaussianFluxSlot().getErrKey());
682 inline bool SourceRecord::getGaussianFluxFlag()
const {
683 return this->
get(getTable()->getGaussianFluxSlot().getFlagKey());
687 return this->
get(getTable()->getCalibFluxSlot().getMeasKey());
691 return this->
get(getTable()->getCalibFluxSlot().getErrKey());
694 inline bool SourceRecord::getCalibFluxFlag()
const {
695 return this->
get(getTable()->getCalibFluxSlot().getFlagKey());
699 return this->
get(getTable()->getCentroidSlot().getMeasKey());
703 return this->
get(getTable()->getCentroidSlot().getErrKey());
706 inline bool SourceRecord::getCentroidFlag()
const {
707 return this->
get(getTable()->getCentroidSlot().getFlagKey());
711 return this->
get(getTable()->getShapeSlot().getMeasKey());
715 return this->
get(getTable()->getShapeSlot().getErrKey());
718 inline bool SourceRecord::getShapeFlag()
const {
return this->
get(getTable()->getShapeSlot().getFlagKey()); }
720 inline RecordId SourceRecord::getParent()
const {
return get(SourceTable::getParentKey()); }
721 inline void SourceRecord::setParent(
RecordId id) {
set(SourceTable::getParentKey(),
id); }
722 inline double SourceRecord::getX()
const {
return get(getTable()->getCentroidKey().getX()); }
723 inline double SourceRecord::getY()
const {
return get(getTable()->getCentroidKey().getY()); }
724 inline double SourceRecord::getIxx()
const {
return get(getTable()->getShapeKey().getIxx()); }
725 inline double SourceRecord::getIyy()
const {
return get(getTable()->getShapeKey().getIyy()); }
726 inline double SourceRecord::getIxy()
const {
return get(getTable()->getShapeKey().getIxy()); }
732 #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.