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" 41 namespace lsst {
namespace afw {
109 bool getPsfFluxFlag()
const;
118 bool getModelFluxFlag()
const;
127 bool getApFluxFlag()
const;
136 bool getInstFluxFlag()
const;
145 bool getCalibFluxFlag()
const;
154 bool getCentroidFlag()
const;
163 bool getShapeFlag()
const;
173 double getIxx()
const;
176 double getIyy()
const;
179 double getIxy()
const;
197 virtual void _assign(
BaseRecord const & other);
251 Schema r = getMinimalSchema().schema;
296 getSchema().getAliasMap()->set(getPsfFluxSlot().getAlias(), name);
309 return getSchema().getAliasMap()->get(getPsfFluxSlot().getAlias());
318 return getPsfFluxSlot().isValid();
327 return getPsfFluxSlot().getMeasKey();
336 return getPsfFluxSlot().getErrKey();
345 return getPsfFluxSlot().getFlagKey();
359 getSchema().getAliasMap()->set(getModelFluxSlot().getAlias(), name);
372 return getSchema().getAliasMap()->get(getModelFluxSlot().getAlias());
381 return getModelFluxSlot().isValid();
390 return getModelFluxSlot().getMeasKey();
399 return getModelFluxSlot().getErrKey();
408 return getModelFluxSlot().getFlagKey();
422 getSchema().getAliasMap()->set(getApFluxSlot().getAlias(), name);
435 return getSchema().getAliasMap()->get(getApFluxSlot().getAlias());
444 return getApFluxSlot().isValid();
453 return getApFluxSlot().getMeasKey();
462 return getApFluxSlot().getErrKey();
471 return getApFluxSlot().getFlagKey();
485 getSchema().getAliasMap()->set(getInstFluxSlot().getAlias(), name);
498 return getSchema().getAliasMap()->get(getInstFluxSlot().getAlias());
507 return getInstFluxSlot().isValid();
516 return getInstFluxSlot().getMeasKey();
525 return getInstFluxSlot().getErrKey();
534 return getInstFluxSlot().getFlagKey();
548 getSchema().getAliasMap()->set(getCalibFluxSlot().getAlias(), name);
561 return getSchema().getAliasMap()->get(getCalibFluxSlot().getAlias());
570 return getCalibFluxSlot().isValid();
579 return getCalibFluxSlot().getMeasKey();
588 return getCalibFluxSlot().getErrKey();
597 return getCalibFluxSlot().getFlagKey();
611 getSchema().getAliasMap()->set(getCentroidSlot().getAlias(), name);
624 return getSchema().getAliasMap()->get(getCentroidSlot().getAlias());
633 return getCentroidSlot().isValid();
642 return getCentroidSlot().getMeasKey();
651 return getCentroidSlot().getErrKey();
660 return getCentroidSlot().getFlagKey();
674 getSchema().getAliasMap()->set(getShapeSlot().getAlias(), name);
687 return getSchema().getAliasMap()->get(getShapeSlot().getAlias());
696 return getShapeSlot().isValid();
705 return getShapeSlot().getMeasKey();
714 return getShapeSlot().getErrKey();
723 return getShapeSlot().getFlagKey();
737 void handleAliasChange(
std::string const & alias)
override;
746 struct MinimalSchema {
754 static MinimalSchema & getMinimalSchema();
765 template <
typename RecordT>
770 typedef typename RecordT::Table
Table;
777 return this->operator[](this->getTable()->getPsfFluxSlot().getMeasKey());
781 return this->operator[](this->getTable()->getPsfFluxSlot().getErrKey());
786 return this->operator[](this->getTable()->getApFluxSlot().getMeasKey());
790 return this->operator[](this->getTable()->getApFluxSlot().getErrKey());
795 return this->operator[](this->getTable()->getModelFluxSlot().getMeasKey());
799 return this->operator[](this->getTable()->getModelFluxSlot().getErrKey());
804 return this->operator[](this->getTable()->getInstFluxSlot().getMeasKey());
808 return this->operator[](this->getTable()->getInstFluxSlot().getErrKey());
813 return this->operator[](this->getTable()->getCalibFluxSlot().getMeasKey());
817 return this->operator[](this->getTable()->getCalibFluxSlot().getErrKey());
821 ndarray::Array<double,1>
const getX()
const {
822 return this->operator[](this->getTable()->getCentroidKey().getX());
824 ndarray::Array<double,1>
const getY()
const {
825 return this->operator[](this->getTable()->getCentroidKey().getY());
828 ndarray::Array<double,1>
const getIxx()
const {
829 return this->operator[](this->getTable()->getShapeKey().getIxx());
831 ndarray::Array<double,1>
const getIyy()
const {
832 return this->operator[](this->getTable()->getShapeKey().getIyy());
834 ndarray::Array<double,1>
const getIxy()
const {
835 return this->operator[](this->getTable()->getShapeKey().getIxy());
839 template <
typename InputIterator>
857 return this->
get(getTable()->getPsfFluxSlot().getMeasKey());
861 return this->
get(getTable()->getPsfFluxSlot().getErrKey());
864 inline bool SourceRecord::getPsfFluxFlag()
const {
865 return this->
get(getTable()->getPsfFluxSlot().getFlagKey());
869 return this->
get(getTable()->getModelFluxSlot().getMeasKey());
873 return this->
get(getTable()->getModelFluxSlot().getErrKey());
876 inline bool SourceRecord::getModelFluxFlag()
const {
877 return this->
get(getTable()->getModelFluxSlot().getFlagKey());
881 return this->
get(getTable()->getApFluxSlot().getMeasKey());
885 return this->
get(getTable()->getApFluxSlot().getErrKey());
888 inline bool SourceRecord::getApFluxFlag()
const {
889 return this->
get(getTable()->getApFluxSlot().getFlagKey());
893 return this->
get(getTable()->getInstFluxSlot().getMeasKey());
897 return this->
get(getTable()->getInstFluxSlot().getErrKey());
900 inline bool SourceRecord::getInstFluxFlag()
const {
901 return this->
get(getTable()->getInstFluxSlot().getFlagKey());
905 return this->
get(getTable()->getCalibFluxSlot().getMeasKey());
909 return this->
get(getTable()->getCalibFluxSlot().getErrKey());
912 inline bool SourceRecord::getCalibFluxFlag()
const {
913 return this->
get(getTable()->getCalibFluxSlot().getFlagKey());
917 return this->
get(getTable()->getCentroidSlot().getMeasKey());
921 return this->
get(getTable()->getCentroidSlot().getErrKey());
924 inline bool SourceRecord::getCentroidFlag()
const {
925 return this->
get(getTable()->getCentroidSlot().getFlagKey());
929 return this->
get(getTable()->getShapeSlot().getMeasKey());
933 return this->
get(getTable()->getShapeSlot().getErrKey());
936 inline bool SourceRecord::getShapeFlag()
const {
937 return this->
get(getTable()->getShapeSlot().getFlagKey());
941 inline RecordId SourceRecord::getParent()
const {
return get(SourceTable::getParentKey()); }
942 inline void SourceRecord::setParent(
RecordId id) {
set(SourceTable::getParentKey(), id); }
943 inline double SourceRecord::getX()
const {
944 return get(getTable()->getCentroidKey().getX());
946 inline double SourceRecord::getY()
const {
947 return get(getTable()->getCentroidKey().getY());
949 inline double SourceRecord::getIxx()
const {
950 return get(getTable()->getShapeKey().getIxx());
952 inline double SourceRecord::getIyy()
const {
953 return get(getTable()->getShapeKey().getIyy());
955 inline double SourceRecord::getIxy()
const {
956 return get(getTable()->getShapeKey().getIxy());
961 #endif // !AFW_TABLE_Source_h_INCLUDED 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.
Key< Flag > getPsfFluxFlagKey() const
Return the key used for the PsfFlux slot failure flag.
Column-wise view into a sequence of records that have been allocated contiguously.
Writer object for FITS binary tables.
ndarray::Array< double, 1 > getModelFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
table::Key< std::string > name
Key< Flag > getApFluxFlagKey() const
Return the key used for the ApFlux slot failure flag.
ndarray::Array< double, 1 > getPsfFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
FluxSlotDefinition const & getApFluxSlot() const
ndarray::Array< double, 1 > const getX() const
SortedCatalogT< SourceRecord const > ConstCatalog
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
ndarray::Array< double, 1 > const getY() const
afw::table::Schema schema
A mapping between the keys of two Schemas, used to copy data between them.
ndarray::Array< double, 1 > const getIxy() const
SourceColumnViewT(BaseColumnView const &base)
FluxSlotDefinition const & getInstFluxSlot() const
ndarray::Array< double, 1 > const getIyy() const
FluxSlotDefinition::ErrKey getPsfFluxErrKey() const
Return the key used for the PsfFlux slot uncertainty.
void defineInstFlux(std::string const &name)
Set the measurement used for the InstFlux slot.
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.
ndarray::Array< double, 1 > getApFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
SortedCatalogT< Record > Catalog
Implementation of the WCS standard for a any projection.
std::shared_ptr< SourceRecord > copyRecord(BaseRecord const &other)
Deep-copy a record, requiring that it have the same schema as this table.
FluxSlotDefinition::MeasKey getApFluxKey() const
Return the key used for the ApFlux slot measurement value.
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.
An aggregate containing all of the current slots used in SourceTable.
std::string getApFluxDefinition() const
Return the name of the field used for the ApFlux slot.
std::string getInstFluxDefinition() const
Return the name of the field used for the InstFlux slot.
Table class that must contain a unique ID field and a celestial coordinate field. ...
bool hasModelFluxSlot() const
Return true if the ModelFlux slot corresponds to a valid field.
Key< Flag > getCalibFluxFlagKey() const
Return the key used for the CalibFlux slot failure flag.
A base class for image defects.
ndarray::Array< double, 1 > const getIxx() const
Key< Flag > getInstFluxFlagKey() const
Return the key used for the InstFlux slot failure flag.
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
Key< Flag > getModelFluxFlagKey() const
Return the key used for the ModelFlux slot failure flag.
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.
FluxSlotDefinition::ErrKey getModelFluxErrKey() const
Return the key used for the ModelFlux slot uncertainty.
static SourceColumnViewT make(std::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
FluxSlotDefinition::MeasKey getPsfFluxKey() const
Return the key used for the PsfFlux slot measurement value.
ndarray::Array< double, 1 > getInstFluxErr() const
Get the uncertainty on the InstFlux slot measurement.
CentroidSlotDefinition::MeasKey getCentroidKey() const
Return the key used for the Centroid slot measurement value.
bool hasPsfFluxSlot() const
Return true if the PsfFlux slot corresponds to a valid field.
ndarray::Array< double, 1 > getCalibFlux() const
Get the value of the CalibFlux slot measurement.
bool hasShapeSlot() const
Return true if the Shape slot corresponds to a valid field.
FluxSlotDefinition::ErrKey getCalibFluxErrKey() const
Return the key used for the CalibFlux slot uncertainty.
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
SourceColumnViewT< SourceRecord > SourceColumnView
ndarray::Array< double, 1 > getInstFlux() const
Get the value of the InstFlux slot measurement.
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.
std::string getPsfFluxDefinition() const
Return the name of the field used for the PsfFlux slot.
FluxSlotDefinition::MeasKey getModelFluxKey() const
Return the key used for the ModelFlux slot measurement value.
SortedCatalogT< Record const > ConstCatalog
FluxSlotDefinition::MeasKey getInstFluxKey() const
Return the key used for the InstFlux slot measurement value.
std::string getCalibFluxDefinition() const
Return the name of the field used for the CalibFlux slot.
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.
ndarray::Array< double, 1 > getApFlux() const
Get the value of the ApFlux slot measurement.
FluxSlotDefinition::ErrKey getApFluxErrKey() const
Return the key used for the ApFlux slot uncertainty.
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.
bool hasApFluxSlot() const
Return true if the ApFlux slot corresponds to a valid field.
A class used as a handle to a particular field in a table.
FluxSlotDefinition::MeasKey getCalibFluxKey() const
Return the key used for the CalibFlux slot measurement value.
Key specialization for Flag.
ndarray::Array< double, 1 > getModelFlux() const
Get the value of 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
ndarray::Array< double, 1 > getCalibFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
ShapeSlotDefinition::MeasKey getShapeKey() const
Return the key used for the Shape slot measurement value.
ndarray::Array< double, 1 > getPsfFlux() const
Get the value of the PsfFlux slot measurement.
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
Record class that must contain a unique ID field and a celestial coordinate field.
SlotDefinition specialization for shapes.
CentroidSlotDefinition const & getCentroidSlot() const
bool hasCalibFluxSlot() const
Return true if the CalibFlux slot corresponds to a valid field.
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.
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
bool hasInstFluxSlot() const
Return true if the InstFlux slot corresponds to a valid field.
FluxSlotDefinition::ErrKey getInstFluxErrKey() const
Return the key used for the InstFlux slot uncertainty.
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.
std::string getModelFluxDefinition() const
Return the name of the field used for the ModelFlux slot.
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.