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 {
242 Schema r = getMinimalSchema().schema;
310 return getPsfFluxSlot().isValid();
319 return getPsfFluxSlot().getMeasKey();
328 return getPsfFluxSlot().getErrKey();
337 return getPsfFluxSlot().getFlagKey();
374 return getModelFluxSlot().isValid();
383 return getModelFluxSlot().getMeasKey();
392 return getModelFluxSlot().getErrKey();
401 return getModelFluxSlot().getFlagKey();
438 return getApFluxSlot().isValid();
447 return getApFluxSlot().getMeasKey();
456 return getApFluxSlot().getErrKey();
465 return getApFluxSlot().getFlagKey();
502 return getInstFluxSlot().isValid();
511 return getInstFluxSlot().getMeasKey();
520 return getInstFluxSlot().getErrKey();
529 return getInstFluxSlot().getFlagKey();
566 return getCalibFluxSlot().isValid();
575 return getCalibFluxSlot().getMeasKey();
584 return getCalibFluxSlot().getErrKey();
593 return getCalibFluxSlot().getFlagKey();
630 return getCentroidSlot().isValid();
639 return getCentroidSlot().getMeasKey();
648 return getCentroidSlot().getErrKey();
657 return getCentroidSlot().getFlagKey();
694 return getShapeSlot().isValid();
703 return getShapeSlot().getMeasKey();
712 return getShapeSlot().getErrKey();
721 return getShapeSlot().getFlagKey();
731 virtual void handleAliasChange(std::string
const & alias);
750 virtual PTR(
io::FitsWriter) makeFitsWriter(fits::Fits * fitsfile,
int flags) const;
755 template <typename RecordT>
760 typedef typename RecordT::Table
Table;
811 ndarray::Array<double,1>
const getX()
const {
814 ndarray::Array<double,1>
const getY()
const {
818 ndarray::Array<double,1>
const getIxx()
const {
821 ndarray::Array<double,1>
const getIyy()
const {
824 ndarray::Array<double,1>
const getIxy()
const {
829 template <
typename InputIterator>
843 return this->
get(
getTable()->getPsfFluxSlot().getMeasKey());
847 return this->
get(
getTable()->getPsfFluxSlot().getErrKey());
851 return this->
get(
getTable()->getPsfFluxSlot().getFlagKey());
855 return this->
get(
getTable()->getModelFluxSlot().getMeasKey());
859 return this->
get(
getTable()->getModelFluxSlot().getErrKey());
863 return this->
get(
getTable()->getModelFluxSlot().getFlagKey());
867 return this->
get(
getTable()->getApFluxSlot().getMeasKey());
871 return this->
get(
getTable()->getApFluxSlot().getErrKey());
875 return this->
get(
getTable()->getApFluxSlot().getFlagKey());
879 return this->
get(
getTable()->getInstFluxSlot().getMeasKey());
883 return this->
get(
getTable()->getInstFluxSlot().getErrKey());
887 return this->
get(
getTable()->getInstFluxSlot().getFlagKey());
891 return this->
get(
getTable()->getCalibFluxSlot().getMeasKey());
895 return this->
get(
getTable()->getCalibFluxSlot().getErrKey());
899 return this->
get(
getTable()->getCalibFluxSlot().getFlagKey());
903 return this->
get(
getTable()->getCentroidSlot().getMeasKey());
907 return this->
get(
getTable()->getCentroidSlot().getErrKey());
911 return this->
get(
getTable()->getCentroidSlot().getFlagKey());
915 return this->
get(
getTable()->getShapeSlot().getMeasKey());
919 return this->
get(
getTable()->getShapeSlot().getErrKey());
923 return this->
get(
getTable()->getShapeSlot().getFlagKey());
930 return get(
getTable()->getCentroidKey().getX());
933 return get(
getTable()->getCentroidKey().getY());
936 return get(
getTable()->getShapeKey().getIxx());
939 return get(
getTable()->getShapeKey().getIyy());
942 return get(
getTable()->getShapeKey().getIxy());
949 #endif // !AFW_TABLE_Source_h_INCLUDED
std::int64_t RecordId
Type used for unique IDs for records.
FluxSlotDefinition::MeasValue getInstFlux() const
Get the value of the InstFlux slot measurement.
An ellipse core with quadrupole moments as parameters.
Defines the fields and offsets for a table.
boost::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
FluxSlotDefinition::MeasKey getModelFluxKey() const
Return the key used for the ModelFlux slot measurement value.
Key< Flag > getModelFluxFlagKey() const
Return the key used for the ModelFlux slot failure flag.
std::string getInstFluxDefinition() const
Return the name of the field used for the InstFlux slot.
Column-wise view into a sequence of records that have been allocated contiguously.
Writer object for FITS binary tables.
bool hasApFluxSlot() const
Return true if the ApFlux slot corresponds to a valid field.
Field< T >::Reference operator[](Key< T > const &key)
Return a reference (or reference-like type) to the field's value.
FluxSlotDefinition const & getModelFluxSlot() const
ndarray::Array< double, 1 > const getY() const
table::Key< std::string > name
ndarray::Array< double, 1 > getModelFlux() const
Get the value of the ModelFlux slot measurement.
ndarray::Array< double, 1 > getModelFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
SortedCatalogT< SourceRecord const > ConstCatalog
ndarray::Array< double, 1 > getApFlux() const
Get the value of the ApFlux slot measurement.
SourceRecord(boost::shared_ptr< SourceTable > const &table)
FluxSlotDefinition::MeasValue getCalibFlux() const
Get the value of the CalibFlux slot measurement.
ndarray::Array< double, 1 > getCalibFlux() const
Get the value of the CalibFlux slot measurement.
boost::shared_ptr< AliasMap > getAliasMap() const
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
std::string getShapeDefinition() const
Return the name of the field used for the Shape slot.
afw::table::Schema schema
A mapping between the keys of two Schemas, used to copy data between them.
SourceColumnViewT(BaseColumnView const &base)
ndarray::Array< double, 1 > getPsfFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
double getY() const
Return the centroid slot y coordinate.
bool getModelFluxFlag() const
Return true if the measurement in the ModelFlux slot failed.
bool getPsfFluxFlag() const
Return true if the measurement in the PsfFlux slot failed.
ndarray::Array< double, 1 > const getIxx() const
FluxSlotDefinition::ErrKey getApFluxErrKey() const
Return the key used for the ApFlux slot uncertainty.
ndarray::Array< double, 1 > getCalibFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
ndarray::Array< double, 1 > getInstFluxErr() const
Get the uncertainty on the InstFlux slot measurement.
void defineInstFlux(std::string const &name)
Set the measurement used for the InstFlux slot.
SourceColumnViewT< SourceRecord > ColumnView
FluxSlotDefinition::ErrValue getModelFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
FluxSlotDefinition::ErrValue getPsfFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
Key< Flag > getPsfFluxFlagKey() const
Return the key used for the PsfFlux slot failure flag.
ShapeSlotDefinition::MeasValue getShape() const
Get the value of the Shape slot measurement.
boost::shared_ptr< Footprint > getFootprint() const
bool getCalibFluxFlag() const
Return true if the measurement in the CalibFlux slot failed.
FluxSlotDefinition const & getCalibFluxSlot() const
SortedCatalogT< Record > Catalog
Implementation of the WCS standard for a any projection.
CentroidSlotDefinition::ErrValue getCentroidErr() const
Get the uncertainty on the Centroid slot measurement.
std::string getApFluxDefinition() const
Return the name of the field used for the ApFlux slot.
bool getInstFluxFlag() const
Return true if the measurement in the InstFlux slot failed.
static SourceColumnViewT make(boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
static boost::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
void definePsfFlux(std::string const &name)
Set the measurement used for the PsfFlux slot.
FluxSlotDefinition::MeasKey getInstFluxKey() const
Return the key used for the InstFlux slot measurement value.
FluxSlotDefinition::ErrValue getInstFluxErr() const
Get the uncertainty on the InstFlux slot measurement.
ndarray::Array< double, 1 > getPsfFlux() const
Get the value of the PsfFlux slot measurement.
double getX() const
Return the centroid slot x coordinate.
void setFootprint(boost::shared_ptr< Footprint > const &footprint)
CentroidSlotDefinition::ErrKey getCentroidErrKey() const
Return the key used for the Centroid slot uncertainty.
FluxSlotDefinition::ErrKey getModelFluxErrKey() const
Return the key used for the ModelFlux slot uncertainty.
bool hasCentroidSlot() const
Return true if the Centroid slot corresponds to a valid field.
Key< Flag > getCentroidFlagKey() const
Return the key used for the Centroid slot failure flag.
std::map< Citizen const *, CitizenInfo > table
table::Key< table::Array< Kernel::Pixel > > image
FluxSlotDefinition::ErrKey getCalibFluxErrKey() const
Return the key used for the CalibFlux slot uncertainty.
CentroidSlotDefinition::MeasValue getCentroid() const
Get the value of the Centroid slot measurement.
Table class that must contain a unique ID field and a celestial coordinate field. ...
boost::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
ndarray::Array< double, 1 > const getIxy() const
ShapeSlotDefinition::MeasKey getShapeKey() const
Return the key used for the Shape slot measurement value.
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
ndarray::Array< double, 1 > const getX() const
Key< Flag > getShapeFlagKey() const
Return the key used for the Shape slot failure flag.
Key< Flag > getInstFluxFlagKey() const
Return the key used for the InstFlux slot failure flag.
FluxSlotDefinition::MeasValue getModelFlux() const
Get the value of the ModelFlux slot measurement.
FluxSlotDefinition::ErrValue getCalibFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
ShapeSlotDefinition const & getShapeSlot() const
FluxSlotDefinition::ErrKey getInstFluxErrKey() const
Return the key used for the InstFlux slot uncertainty.
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
std::string getModelFluxDefinition() const
Return the name of the field used for the ModelFlux slot.
FluxSlotDefinition::MeasKey getCalibFluxKey() const
Return the key used for the CalibFlux slot measurement value.
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
FluxSlotDefinition::MeasKey getApFluxKey() const
Return the key used for the ApFlux slot measurement value.
static BaseColumnView make(boost::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
SourceColumnViewT< SourceRecord > SourceColumnView
FluxSlotDefinition const & getApFluxSlot() const
SortedCatalogT< SourceRecord > Catalog
Key< Flag > getApFluxFlagKey() const
Return the key used for the ApFlux slot failure flag.
SortedCatalogT< Record const > ConstCatalog
bool hasInstFluxSlot() const
Return true if the InstFlux slot corresponds to a valid field.
bool hasShapeSlot() const
Return true if the Shape slot corresponds to a valid field.
A polymorphic functor base class for generating record IDs for a table.
RecordId getParent() const
Convenience accessors for the keys in the minimal source schema.
Key< Flag > getCalibFluxFlagKey() const
Return the key used for the CalibFlux slot failure flag.
ndarray::Array< double, 1 > getApFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
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.
static boost::shared_ptr< SourceTable > make(Schema const &schema)
Construct a new table.
Table class that contains measurements made on a single exposure.
boost::shared_ptr< Footprint > _footprint
ShapeSlotDefinition::ErrKey getShapeErrKey() const
Return the key used for the Shape slot uncertainty.
boost::shared_ptr< SourceTable const > getTable() const
bool hasModelFluxSlot() const
Return true if the ModelFlux slot corresponds to a valid field.
Base class for all records.
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
CentroidSlotDefinition::MeasKey getCentroidKey() const
Return the key used for the Centroid slot measurement value.
void updateCoord(image::Wcs const &wcs)
Update the coord field using the given Wcs and the field in the centroid slot.
Key specialization for Flag.
FluxSlotDefinition::MeasKey getPsfFluxKey() const
Return the key used for the PsfFlux slot measurement value.
FluxSlotDefinition::MeasValue getPsfFlux() const
Get the value of the PsfFlux slot measurement.
SlotDefinition specialization for centroids.
Read/write heavy footprints as non-heavy footprints.
lsst::afw::detection::Footprint Footprint
double getIxy() const
Return the shape slot Ixy value.
FluxSlotDefinition const & getPsfFluxSlot() const
bool hasPsfFluxSlot() const
Return true if the PsfFlux slot corresponds to a valid field.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
bool getCentroidFlag() const
Return true if the measurement in the Centroid slot failed.
bool getApFluxFlag() const
Return true if the measurement in the ApFlux slot failed.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
std::string getPsfFluxDefinition() const
Return the name of the field used for the PsfFlux slot.
void setParent(RecordId id)
Convenience accessors for the keys in the minimal source schema.
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.
FluxSlotDefinition const & getInstFluxSlot() const
ShapeSlotDefinition::ErrValue getShapeErr() const
Get the uncertainty on the Shape slot measurement.
void defineCentroid(std::string const &name)
Set the measurement used for the Centroid slot.
double ErrValue
Type returned by accessing the slot uncertainty.
double getIyy() const
Return the shape slot Iyy value.
Record class that must contain a unique ID field and a celestial coordinate field.
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied...
FluxSlotDefinition::ErrKey getPsfFluxErrKey() const
Return the key used for the PsfFlux slot uncertainty.
SlotDefinition specialization for shapes.
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.
std::string getCalibFluxDefinition() const
Return the name of the field used for the CalibFlux slot.
SlotDefinition specialization for fluxes.
ndarray::Array< double, 1 > getInstFlux() const
Get the value of the InstFlux slot measurement.
CentroidSlotDefinition const & getCentroidSlot() const
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
Schema getSchema() const
Return the Schema that holds this record's fields and keys.
FluxSlotDefinition::ErrValue getApFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
bool hasCalibFluxSlot() const
Return true if the CalibFlux slot corresponds to a valid field.
FluxSlotDefinition::MeasValue getApFlux() const
Get the value of the ApFlux slot measurement.
double getIxx() const
Return the shape slot Ixx value.
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid SourceTable schema.
std::string getCentroidDefinition() const
Return the name of the field used for the Centroid slot.
SourceColumnViewT< SourceRecord > ColumnView
ndarray::Array< double, 1 > const getIyy() const