LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
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());
383 [deprecated(
"Use `getSchema().getAliasMap()->get(\"slot_Centroid\")` instead. To be removed "
395 [[deprecated(
"Use `getCentroidSlot().isValid()` instead. To be removed after 20.0.0.")]]
407 [deprecated(
"Use `getCentroidSlot().getMeasKey()` instead. To be removed after "
420 [deprecated(
"Use `getCentroidSlot().getErrKey()` instead. To be removed after "
432 [[deprecated(
"Use `getCentroidSlot().getFlagKey()` instead. To be removed after 20.0.0.")]]
461 [deprecated(
"Use `getSchema().getAliasMap()->get(\"slot_Shape\")` instead. To be removed after "
473 [[deprecated(
"Use `getShapeSlot().isValid()` instead. To be removed after 20.0.0.")]]
484 [[deprecated(
"Use `getShapeSlot().getMeasKey()` instead. To be removed after 20.0.0.")]]
495 [[deprecated(
"Use `getShapeSlot().getErrKey()` instead. To be removed after 20.0.0.")]]
506 [[deprecated(
"Use `getShapeSlot().getFlagKey()` instead. To be removed after 20.0.0.")]]
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());
647 return this->
get(
getTable()->getPsfFluxSlot().getFlagKey());
651 return this->
get(
getTable()->getModelFluxSlot().getMeasKey());
655 return this->
get(
getTable()->getModelFluxSlot().getErrKey());
659 return this->
get(
getTable()->getModelFluxSlot().getFlagKey());
663 return this->
get(
getTable()->getApFluxSlot().getMeasKey());
667 return this->
get(
getTable()->getApFluxSlot().getErrKey());
671 return this->
get(
getTable()->getApFluxSlot().getFlagKey());
675 return this->
get(
getTable()->getGaussianFluxSlot().getMeasKey());
679 return this->
get(
getTable()->getGaussianFluxSlot().getErrKey());
683 return this->
get(
getTable()->getGaussianFluxSlot().getFlagKey());
687 return this->
get(
getTable()->getCalibFluxSlot().getMeasKey());
691 return this->
get(
getTable()->getCalibFluxSlot().getErrKey());
695 return this->
get(
getTable()->getCalibFluxSlot().getFlagKey());
699 return this->
get(
getTable()->getCentroidSlot().getMeasKey());
703 return this->
get(
getTable()->getCentroidSlot().getErrKey());
707 return this->
get(
getTable()->getCentroidSlot().getFlagKey());
711 return this->
get(
getTable()->getShapeSlot().getMeasKey());
715 return this->
get(
getTable()->getShapeSlot().getErrKey());
732 #endif // !AFW_TABLE_Source_h_INCLUDED
void setParent(RecordId id)
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
double ErrValue
Type returned by accessing the slot uncertainty.
FluxSlotDefinition const & getModelFluxSlot() const
SourceFitsFlags
Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits.
bool isValid() const
Return true if the key associated with the measurement is valid.
std::shared_ptr< BaseTable > _clone() const override
Clone implementation with noncovariant return types.
static std::shared_ptr< SourceTable > make(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
Construct a new table.
CentroidSlotDefinition const & getCentroidSlot() const
void defineCentroid(std::string const &name)
Set the measurement used for the Centroid slot.
SourceColumnViewT(SourceColumnViewT const &)=default
Record class that contains measurements made on a single exposure.
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
bool getApFluxFlag() const
Return true if the measurement in the ApFlux slot failed.
CentroidSlotDefinition::MeasValue getCentroid() const
Get the value of the Centroid slot measurement.
bool getPsfFluxFlag() const
Return true if the measurement in the PsfFlux slot failed.
ndarray::Array< double, 1 > getPsfInstFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
FluxSlotDefinition::MeasValue getCalibInstFlux() const
Get the value of the CalibFlux slot measurement.
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...
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
ndarray::Array< double, 1 > getApInstFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
double getIyy() const
Return the shape slot Iyy value.
static std::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
FluxSlotDefinition defApFlux
static SourceColumnViewT make(std::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
bool hasShapeSlot() const
Return true if the Shape slot corresponds to a valid field.
ndarray::Array< double, 1 > getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
ShapeSlotDefinition::MeasKey getShapeKey() const
Return the key used for the Shape slot measurement value.
FluxSlotDefinition defCalibFlux
SourceColumnViewT< SourceRecord > SourceColumnView
static Key< RecordId > getParentKey()
Key for the parent ID.
SlotDefinition specialization for shapes.
SourceRecord(ConstructionToken const &token, detail::RecordData &&data)
Constructor used by SourceTable.
Defines the fields and offsets for a table.
Column-wise view into a sequence of records that have been allocated contiguously.
FluxSlotDefinition::ErrValue getGaussianInstFluxErr() const
Get the uncertainty on the GaussianFlux slot measurement.
Helper struct that contains the information passed from BaseTable to BaseRecord at construction.
Key< Flag > getCentroidFlagKey() const
Return the key used for the Centroid slot failure flag.
FluxSlotDefinition::ErrValue getCalibInstFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
SourceTable(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
SourceTable & operator=(SourceTable &&)=delete
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied.
double getIxy() const
Return the shape slot Ixy value.
ndarray::Array< double, 1 > const getX() const
SortedCatalogT< Record > Catalog
FluxSlotDefinition::MeasValue getGaussianInstFlux() const
Get the value of the GaussianFlux slot measurement.
SourceRecord(const SourceRecord &)=delete
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.
FluxSlotDefinition::MeasValue getPsfInstFlux() const
Get the value of the PsfFlux slot measurement.
std::shared_ptr< Footprint > getFootprint() const
Key< Flag > getShapeFlagKey() const
Return the key used for the Shape slot failure flag.
CentroidSlotDefinition::ErrKey getCentroidErrKey() const
Return the key used for the Centroid slot uncertainty.
SlotDefinition specialization for centroids.
SlotDefinition specialization for fluxes.
SourceColumnViewT(SourceColumnViewT &&)=default
CentroidSlotDefinition defCentroid
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
SortedCatalogT< SourceRecord const > ConstCatalog
SourceColumnViewT< SourceRecord > ColumnView
void defineModelFlux(std::string const &name)
Set the measurement used for the ModelFlux slot.
CentroidSlotDefinition::ErrValue getCentroidErr() const
Get the uncertainty on the Centroid slot measurement.
ShapeSlotDefinition::MeasValue getShape() const
Get the value of the Shape slot measurement.
FluxSlotDefinition::MeasValue getApInstFlux() const
Get the value of the ApFlux slot measurement.
ndarray::Array< double, 1 > getApInstFlux() const
Get the value of the ApFlux slot measurement.
@ SOURCE_IO_NO_FOOTPRINTS
Do not read/write footprints at all.
ndarray::Array< double, 1 > const getY() const
RecordId getParent() const
Convenience accessors for the keys in the minimal source schema.
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys.
FluxSlotDefinition const & getApFluxSlot() const
SourceColumnViewT & operator=(SourceColumnViewT const &)=default
SourceColumnViewT & operator=(SourceColumnViewT &&)=default
lsst::afw::detection::Footprint Footprint
ItemVariant const * other
Base class for all records.
double getX() const
Return the centroid slot x coordinate.
FluxSlotDefinition defPsfFlux
A mapping between the keys of two Schemas, used to copy data between them.
ndarray::Array< double, 1 > getGaussianInstFlux() const
Get the value of the GaussianFlux slot measurement.
A class used as a handle to a particular field in a table.
double MeasValue
Type returned by accessing the slot measurement.
ShapeSlotDefinition::ErrValue getShapeErr() const
Get the uncertainty on the Shape slot measurement.
SourceColumnViewT< SourceRecord > ColumnView
FluxSlotDefinition::ErrValue getPsfInstFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
bool getModelFluxFlag() const
Return true if the measurement in the ModelFlux slot failed.
ErrKey getErrKey() const
Return the cached Key used to access the slot uncertainty.
double getIxx() const
Return the shape slot Ixx value.
Schema getSchema() const
Return the table's schema.
void setFootprint(std::shared_ptr< Footprint > const &footprint)
FluxSlotDefinition::ErrValue getModelInstFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
std::shared_ptr< SourceTable > clone() const
Return a polymorphic deep copy of the table.
static BaseColumnView make(std::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
bool getCentroidFlag() const
Return true if the measurement in the Centroid slot failed.
SourceRecord(SourceRecord &&)=delete
ndarray::Array< double, 1 > getCalibInstFlux() const
Get the value of the CalibFlux slot measurement.
ndarray::Array< double, 1 > getPsfInstFlux() const
Get the value of the PsfFlux slot measurement.
A base class for image defects.
FluxSlotDefinition const & getCalibFluxSlot() const
double getY() const
Return the centroid slot y coordinate.
std::shared_ptr< SourceTable const > getTable() const
void defineShape(std::string const &name)
Set the measurement used for the Shape slot.
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid SourceTable schema.
void defineGaussianFlux(std::string const &name)
Set the measurement used for the GaussianFlux slot.
Table class that must contain a unique ID field and a celestial coordinate field.
An ellipse core with quadrupole moments as parameters.
ndarray::Array< double, 1 > getCalibInstFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
ndarray::Array< double, 1 > const getIxx() const
SourceColumnViewT(BaseColumnView const &base)
void definePsfFlux(std::string const &name)
Set the measurement used for the PsfFlux slot.
bool getGaussianFluxFlag() const
Return true if the measurement in the GaussianFlux slot failed.
SortedCatalogT< SourceRecord > Catalog
bool getCalibFluxFlag() const
Return true if the measurement in the CalibFlux slot failed.
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
@ SOURCE_IO_NO_HEAVY_FOOTPRINTS
Read/write heavy footprints as non-heavy footprints.
Writer object for FITS binary tables.
bool hasCentroidSlot() const
Return true if the Centroid slot corresponds to a valid field.
FluxSlotDefinition::ErrValue getApInstFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
SourceRecord & operator=(const SourceRecord &)=delete
std::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
Table class that contains measurements made on a single exposure.
ndarray::Array< double, 1 > const getIyy() const
An aggregate containing all of the current slots used in SourceTable.
SourceTable & operator=(SourceTable const &)=delete
ShapeSlotDefinition const & getShapeSlot() const
std::shared_ptr< BaseRecord > _makeRecord() override
Default-construct an associated record (protected implementation).
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
std::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
MeasKey getMeasKey() const
Return the cached Key used to access the slot measurement.
std::string getShapeDefinition() const
Return the name of the field used for the Shape slot.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
Key< Flag > getFlagKey() const
Return the cached Key used to access the slot failure flag.
FluxSlotDefinition defGaussianFlux
SortedCatalogT< Record const > ConstCatalog
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
bool isValid() const
Return true if the key associated with the measurement is valid.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
std::shared_ptr< SourceRecord > makeRecord()
Default-construct an associated record.
ShapeSlotDefinition::ErrKey getShapeErrKey() const
Return the key used for the Shape slot uncertainty.
ndarray::Array< double, 1 > getGaussianInstFluxErr() const
Get the uncertainty on the GaussianFlux slot measurement.
Record class that must contain a unique ID field and a celestial coordinate field.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
std::shared_ptr< SourceRecord > copyRecord(BaseRecord const &other)
Deep-copy a record, requiring that it have the same schema as this table.
FluxSlotDefinition::MeasValue getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
FluxSlotDefinition const & getGaussianFluxSlot() const
std::shared_ptr< AliasMap > getAliasMap() const
Return the map of aliases.
ndarray::Array< double, 1 > getModelInstFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
FluxSlotDefinition const & getPsfFluxSlot() const
static std::shared_ptr< SourceTable > make(Schema const &schema)
Construct a new table.
~SourceColumnViewT()=default
void updateCoord(geom::SkyWcs const &wcs)
Update the coord field using the given Wcs and the field in the centroid slot.
Custom catalog class for record/table subclasses that are guaranteed to have an ID,...
Key specialization for Flag.
CentroidSlotDefinition::MeasKey getCentroidKey() const
Return the key used for the Centroid slot measurement value.
ndarray::Array< double, 1 > const getIxy() const
std::string getCentroidDefinition() const
Return the name of the field used for the Centroid slot.
ShapeSlotDefinition defShape
FluxSlotDefinition defModelFlux
SourceRecord & operator=(SourceRecord &&)=delete
void handleAliasChange(std::string const &alias) override