LSSTApplications
19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
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());
403 struct MinimalSchema {
411 static MinimalSchema &getMinimalSchema();
422 template <
typename RecordT>
426 typedef typename RecordT::Table
Table;
433 return this->operator[](this->getTable()->getPsfFluxSlot().getMeasKey());
437 return this->operator[](this->getTable()->getPsfFluxSlot().getErrKey());
442 return this->operator[](this->getTable()->getApFluxSlot().getMeasKey());
446 return this->operator[](this->getTable()->getApFluxSlot().getErrKey());
451 return this->operator[](this->getTable()->getModelFluxSlot().getMeasKey());
455 return this->operator[](this->getTable()->getModelFluxSlot().getErrKey());
460 return this->operator[](this->getTable()->getGaussianFluxSlot().getMeasKey());
464 return this->operator[](this->getTable()->getGaussianFluxSlot().getErrKey());
469 return this->operator[](this->getTable()->getCalibFluxSlot().getMeasKey());
473 return this->operator[](this->getTable()->getCalibFluxSlot().getErrKey());
476 ndarray::Array<double, 1>
const getX()
const {
477 return this->operator[](this->getTable()->getCentroidSlot().getMeasKey().
getX());
479 ndarray::Array<double, 1>
const getY()
const {
480 return this->operator[](this->getTable()->getCentroidSlot().getMeasKey().
getY());
483 ndarray::Array<double, 1>
const getIxx()
const {
484 return this->operator[](this->getTable()->getShapeSlot().getMeasKey().
getIxx());
486 ndarray::Array<double, 1>
const getIyy()
const {
487 return this->operator[](this->getTable()->getShapeSlot().getMeasKey().
getIyy());
489 ndarray::Array<double, 1>
const getIxy()
const {
490 return this->operator[](this->getTable()->getShapeSlot().getMeasKey().
getIxy());
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());
606 #endif // !AFW_TABLE_Source_h_INCLUDED
void setParent(RecordId id)
double ErrValue
Type returned by accessing the slot uncertainty.
FluxSlotDefinition const & getModelFluxSlot() const
SourceFitsFlags
Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits.
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.
ndarray::Array< double, 1 > getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
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.
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
SlotDefinition specialization for centroids.
SlotDefinition specialization for fluxes.
SourceColumnViewT(SourceColumnViewT &&)=default
CentroidSlotDefinition defCentroid
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.
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.
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.
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.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
FluxSlotDefinition defGaussianFlux
SortedCatalogT< Record const > ConstCatalog
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
std::shared_ptr< SourceRecord > makeRecord()
Default-construct an associated record.
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,...
ndarray::Array< double, 1 > const getIxy() const
ShapeSlotDefinition defShape
FluxSlotDefinition defModelFlux
SourceRecord & operator=(SourceRecord &&)=delete
void handleAliasChange(std::string const &alias) override