24#ifndef AFW_TABLE_Source_h_INCLUDED
25#define AFW_TABLE_Source_h_INCLUDED
62template <
typename RecordT>
191 void updateCoord(geom::SkyWcs
const &wcs,
bool include_covariance =
true);
259 Schema r = getMinimalSchema().schema;
260 r.disconnectAliases();
400 struct MinimalSchema {
408 static MinimalSchema &getMinimalSchema();
419template <
typename RecordT>
423 using Table =
typename RecordT::Table;
473 ndarray::Array<double, 1>
const getX()
const {
476 ndarray::Array<double, 1>
const getY()
const {
480 ndarray::Array<double, 1>
const getIxx()
const {
483 ndarray::Array<double, 1>
const getIyy()
const {
486 ndarray::Array<double, 1>
const getIxy()
const {
491 template <
typename InputIterator>
493 InputIterator last) {
510 return this->
get(
getTable()->getPsfFluxSlot().getMeasKey());
514 return this->
get(
getTable()->getPsfFluxSlot().getErrKey());
518 return this->
get(
getTable()->getPsfFluxSlot().getFlagKey());
522 return this->
get(
getTable()->getModelFluxSlot().getMeasKey());
526 return this->
get(
getTable()->getModelFluxSlot().getErrKey());
530 return this->
get(
getTable()->getModelFluxSlot().getFlagKey());
534 return this->
get(
getTable()->getApFluxSlot().getMeasKey());
538 return this->
get(
getTable()->getApFluxSlot().getErrKey());
542 return this->
get(
getTable()->getApFluxSlot().getFlagKey());
546 return this->
get(
getTable()->getGaussianFluxSlot().getMeasKey());
550 return this->
get(
getTable()->getGaussianFluxSlot().getErrKey());
554 return this->
get(
getTable()->getGaussianFluxSlot().getFlagKey());
558 return this->
get(
getTable()->getCalibFluxSlot().getMeasKey());
562 return this->
get(
getTable()->getCalibFluxSlot().getErrKey());
566 return this->
get(
getTable()->getCalibFluxSlot().getFlagKey());
570 return this->
get(
getTable()->getCentroidSlot().getMeasKey());
574 return this->
get(
getTable()->getCentroidSlot().getErrKey());
578 return this->
get(
getTable()->getCentroidSlot().getFlagKey());
582 return this->
get(
getTable()->getShapeSlot().getMeasKey());
586 return this->
get(
getTable()->getShapeSlot().getErrKey());
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixel...
Column-wise view into a sequence of records that have been allocated contiguously.
static BaseColumnView make(std::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
ndarray::ArrayRef< T, 1 > const operator[](Key< T > const &key) const
Return a 1-d array corresponding to a scalar field (or subfield).
Base class for all records.
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
std::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
Schema getSchema() const
Return the table's schema.
std::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
SlotDefinition specialization for centroids.
lsst::geom::Point2D MeasValue
Type returned by accessing the slot measurement.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
std::shared_ptr< Table > getTable() const
Return the table that owns the records.
ColumnViewT(ColumnViewT const &)=default
SlotDefinition specialization for fluxes.
double ErrValue
Type returned by accessing the slot uncertainty.
double MeasValue
Type returned by accessing the slot measurement.
static std::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
A class used as a handle to a particular field in a table.
A FunctorKey used to get or set a lsst::geom::Point from an (x,y) pair of int or double Keys.
Defines the fields and offsets for a table.
std::shared_ptr< AliasMap > getAliasMap() const
Return the map of aliases.
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
A mapping between the keys of two Schemas, used to copy data between them.
SlotDefinition specialization for shapes.
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
geom::ellipses::Quadrupole MeasValue
Type returned by accessing the slot measurement.
SimpleRecord(ConstructionToken const &token, detail::RecordData &&data)
Constructor used by SimpleTable.
SimpleTable(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
Custom catalog class for record/table subclasses that are guaranteed to have an ID,...
ndarray::Array< double, 1 > getApInstFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
typename SourceRecord::Table Table
ndarray::Array< double, 1 > const getY() const
ndarray::Array< double, 1 > getModelInstFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
ndarray::Array< double, 1 > getPsfInstFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
SourceColumnViewT(BaseColumnView const &base)
ndarray::Array< double, 1 > getGaussianInstFluxErr() const
Get the uncertainty on the GaussianFlux slot measurement.
SourceColumnViewT & operator=(SourceColumnViewT const &)=default
SourceColumnViewT & operator=(SourceColumnViewT &&)=default
ndarray::Array< double, 1 > getCalibInstFlux() const
Get the value of the CalibFlux slot measurement.
~SourceColumnViewT()=default
static SourceColumnViewT make(std::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
ndarray::Array< double, 1 > getCalibInstFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
ndarray::Array< double, 1 > getApInstFlux() const
Get the value of the ApFlux slot measurement.
ndarray::Array< double, 1 > const getIyy() const
SourceColumnViewT(SourceColumnViewT &&)=default
ndarray::Array< double, 1 > getGaussianInstFlux() const
Get the value of the GaussianFlux slot measurement.
SourceColumnViewT(SourceColumnViewT const &)=default
ndarray::Array< double, 1 > const getX() const
ndarray::Array< double, 1 > const getIxx() const
ndarray::Array< double, 1 > const getIxy() const
ndarray::Array< double, 1 > getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
ndarray::Array< double, 1 > getPsfInstFlux() const
Get the value of the PsfFlux slot measurement.
Record class that contains measurements made on a single exposure.
FluxSlotDefinition::ErrValue getCalibInstFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied.
double getIxx() const
Return the shape slot Ixx value.
bool getCalibFluxFlag() const
Return true if the measurement in the CalibFlux slot failed.
FluxSlotDefinition::ErrValue getGaussianInstFluxErr() const
Get the uncertainty on the GaussianFlux slot measurement.
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
double getX() const
Return the centroid slot x coordinate.
SourceRecord & operator=(const SourceRecord &)=delete
double getY() const
Return the centroid slot y coordinate.
FluxSlotDefinition::MeasValue getGaussianInstFlux() const
Get the value of the GaussianFlux slot measurement.
double getIyy() const
Return the shape slot Iyy value.
CentroidSlotDefinition::MeasValue getCentroid() const
Get the value of the Centroid slot measurement.
bool getCentroidFlag() const
Return true if the measurement in the Centroid slot failed.
FluxSlotDefinition::MeasValue getApInstFlux() const
Get the value of the ApFlux slot measurement.
std::shared_ptr< SourceTable const > getTable() const
bool getModelFluxFlag() const
Return true if the measurement in the ModelFlux slot failed.
void setParent(RecordId id)
FluxSlotDefinition::MeasValue getModelInstFlux() const
Get the value of the ModelFlux slot measurement.
SortedCatalogT< SourceRecord > Catalog
double getIxy() const
Return the shape slot Ixy value.
SourceRecord(const SourceRecord &)=delete
ShapeSlotDefinition::ErrValue getShapeErr() const
Get the uncertainty on the Shape slot measurement.
FluxSlotDefinition::ErrValue getPsfInstFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
std::shared_ptr< Footprint > getFootprint() const
ShapeSlotDefinition::MeasValue getShape() const
Get the value of the Shape slot measurement.
RecordId getParent() const
Convenience accessors for the keys in the minimal source schema.
CentroidSlotDefinition::ErrValue getCentroidErr() const
Get the uncertainty on the Centroid slot measurement.
FluxSlotDefinition::MeasValue getPsfInstFlux() const
Get the value of the PsfFlux slot measurement.
SourceRecord & operator=(SourceRecord &&)=delete
FluxSlotDefinition::ErrValue getApInstFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
SourceRecord(SourceRecord &&)=delete
void setFootprint(std::shared_ptr< Footprint > const &footprint)
SortedCatalogT< const SourceRecord > ConstCatalog
bool getGaussianFluxFlag() const
Return true if the measurement in the GaussianFlux slot failed.
FluxSlotDefinition::ErrValue getModelInstFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
FluxSlotDefinition::MeasValue getCalibInstFlux() const
Get the value of the CalibFlux slot measurement.
bool getPsfFluxFlag() const
Return true if the measurement in the PsfFlux slot failed.
SourceRecord(ConstructionToken const &token, detail::RecordData &&data)
Constructor used by SourceTable.
bool getApFluxFlag() const
Return true if the measurement in the ApFlux slot failed.
void updateCoord(geom::SkyWcs const &wcs, bool include_covariance=true)
Update the coord field using the given Wcs and the field in the centroid slot.
SourceColumnViewT< SourceRecord > ColumnView
Table class that contains measurements made on a single exposure.
std::shared_ptr< SourceRecord > copyRecord(BaseRecord const &other)
Deep-copy a record, requiring that it have the same schema as this table.
SourceTable & operator=(SourceTable const &)=delete
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
static std::shared_ptr< SourceTable > make(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
Construct a new table.
SourceTable(SourceTable const &other)
SourceTable & operator=(SourceTable &&)=delete
std::shared_ptr< SourceRecord > makeRecord()
Default-construct an associated record.
friend class SourceRecord
SourceTable(Schema const &schema, std::shared_ptr< IdFactory > const &idFactory)
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
std::shared_ptr< BaseRecord > _makeRecord() override
Default-construct an associated record (protected implementation).
void definePsfFlux(std::string const &name)
Set the measurement used for the PsfFlux slot.
FluxSlotDefinition const & getModelFluxSlot() const
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
static Key< RecordId > getParentKey()
Key for the parent ID.
void defineGaussianFlux(std::string const &name)
Set the measurement used for the GaussianFlux slot.
SortedCatalogT< const Record > ConstCatalog
FluxSlotDefinition const & getGaussianFluxSlot() const
std::shared_ptr< SourceTable > clone() const
Return a polymorphic deep copy of the table.
void defineShape(std::string const &name)
Set the measurement used for the Shape slot.
std::shared_ptr< io::FitsWriter > makeFitsWriter(fits::Fits *fitsfile, int flags) const override
std::shared_ptr< BaseTable > _clone() const override
Clone implementation with noncovariant return types.
SourceColumnViewT< SourceRecord > ColumnView
CentroidSlotDefinition const & getCentroidSlot() const
FluxSlotDefinition const & getPsfFluxSlot() const
void handleAliasChange(std::string const &alias) override
FluxSlotDefinition const & getApFluxSlot() const
ShapeSlotDefinition const & getShapeSlot() const
void defineCentroid(std::string const &name)
Set the measurement used for the Centroid slot.
static std::shared_ptr< SourceTable > make(Schema const &schema)
Construct a new table.
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.
void defineModelFlux(std::string const &name)
Set the measurement used for the ModelFlux slot.
FluxSlotDefinition const & getCalibFluxSlot() const
SortedCatalogT< Record > Catalog
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid SourceTable schema.
Writer object for FITS binary tables.
lsst::afw::detection::Footprint Footprint
SourceFitsFlags
Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits.
@ SOURCE_IO_NO_FOOTPRINTS
Do not read/write footprints at all.
@ SOURCE_IO_NO_HEAVY_FOOTPRINTS
Read/write heavy footprints as non-heavy footprints.
std::int64_t RecordId
Type used for unique IDs for records.
SourceColumnViewT< SourceRecord > SourceColumnView
T static_pointer_cast(T... args)
An aggregate containing all of the current slots used in SourceTable.
Helper struct that contains the information passed from BaseTable to BaseRecord at construction.