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
boost::shared_ptr< Footprint > _footprint
FluxSlotDefinition::ErrKey getCalibFluxErrKey() const
Return the key used for the CalibFlux slot uncertainty.
An ellipse core with quadrupole moments as parameters.
std::string getPsfFluxDefinition() const
Return the name of the field used for the PsfFlux slot.
Defines the fields and offsets for a table.
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
double getX() const
Return the centroid slot x coordinate.
static BaseColumnView make(boost::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
CentroidSlotDefinition::ErrKey getCentroidErrKey() const
Return the key used for the Centroid slot uncertainty.
FluxSlotDefinition::MeasValue getInstFlux() const
Get the value of the InstFlux slot measurement.
ndarray::Array< double, 1 > getModelFlux() const
Get the value of the ModelFlux slot measurement.
void setFootprint(boost::shared_ptr< Footprint > const &footprint)
Column-wise view into a sequence of records that have been allocated contiguously.
Writer object for FITS binary tables.
bool getCalibFluxFlag() const
Return true if the measurement in the CalibFlux slot failed.
double getIxy() const
Return the shape slot Ixy value.
static boost::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
ndarray::Array< double, 1 > const getY() const
table::Key< std::string > name
ndarray::Array< double, 1 > getCalibFlux() const
Get the value of the CalibFlux slot measurement.
CentroidSlotDefinition::MeasValue getCentroid() const
Get the value of the Centroid slot measurement.
Field< T >::Reference operator[](Key< T > const &key)
Return a reference (or reference-like type) to the field's value.
ndarray::Array< double, 1 > const getIxx() const
bool hasCentroidSlot() const
Return true if the Centroid slot corresponds to a valid field.
FluxSlotDefinition::ErrValue getPsfFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
SourceColumnViewT< SourceRecord > ColumnView
void defineShape(std::string const &name)
Set the measurement used for the Shape slot.
ShapeSlotDefinition::ErrKey getShapeErrKey() const
Return the key used for the Shape slot uncertainty.
afw::table::Schema schema
A mapping between the keys of two Schemas, used to copy data between them.
void defineModelFlux(std::string const &name)
Set the measurement used for the ModelFlux slot.
CentroidSlotDefinition::MeasKey getCentroidKey() const
Return the key used for the Centroid slot measurement value.
lsst::afw::detection::Footprint Footprint
std::string getModelFluxDefinition() const
Return the name of the field used for the ModelFlux slot.
SortedCatalogT< SourceRecord > Catalog
FluxSlotDefinition::MeasValue getPsfFlux() const
Get the value of the PsfFlux slot measurement.
SortedCatalogT< Record > Catalog
bool getCentroidFlag() const
Return true if the measurement in the Centroid slot failed.
Implementation of the WCS standard for a any projection.
bool getModelFluxFlag() const
Return true if the measurement in the ModelFlux slot failed.
std::string getInstFluxDefinition() const
Return the name of the field used for the InstFlux slot.
bool hasModelFluxSlot() const
Return true if the ModelFlux slot corresponds to a valid field.
ndarray::Array< double, 1 > const getX() const
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
FluxSlotDefinition::ErrValue getCalibFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
An aggregate containing all of the current slots used in SourceTable.
FluxSlotDefinition const & getPsfFluxSlot() const
bool hasApFluxSlot() const
Return true if the ApFlux slot corresponds to a valid field.
table::Key< table::Array< Kernel::Pixel > > image
bool getInstFluxFlag() const
Return true if the measurement in the InstFlux slot failed.
ndarray::Array< double, 1 > getModelFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
ndarray::Array< double, 1 > getInstFluxErr() const
Get the uncertainty on the InstFlux slot measurement.
FluxSlotDefinition::ErrKey getInstFluxErrKey() const
Return the key used for the InstFlux slot uncertainty.
ndarray::Array< double, 1 > getCalibFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
std::string getApFluxDefinition() const
Return the name of the field used for the ApFlux slot.
CentroidSlotDefinition const & getCentroidSlot() const
bool getApFluxFlag() const
Return true if the measurement in the ApFlux slot failed.
std::int64_t RecordId
Type used for unique IDs for records.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
bool hasPsfFluxSlot() const
Return true if the PsfFlux slot corresponds to a valid field.
FluxSlotDefinition::ErrValue getApFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
Table class that must contain a unique ID field and a celestial coordinate field. ...
Key< Flag > getCalibFluxFlagKey() const
Return the key used for the CalibFlux slot failure flag.
FluxSlotDefinition::ErrValue getModelFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
FluxSlotDefinition::MeasValue getCalibFlux() const
Get the value of the CalibFlux slot measurement.
FluxSlotDefinition const & getApFluxSlot() const
FluxSlotDefinition const & getInstFluxSlot() const
FluxSlotDefinition const & getCalibFluxSlot() const
static boost::shared_ptr< SourceTable > make(Schema const &schema)
Construct a new table.
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 > getInstFlux() const
Get the value of the InstFlux slot measurement.
double getIxx() const
Return the shape slot Ixx value.
SourceColumnViewT< SourceRecord > ColumnView
double ErrValue
Type returned by accessing the slot uncertainty.
std::map< Citizen const *, CitizenInfo > table
ndarray::Array< double, 1 > getApFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
Key< Flag > getPsfFluxFlagKey() const
Return the key used for the PsfFlux slot failure flag.
FluxSlotDefinition::MeasValue getApFlux() const
Get the value of the ApFlux slot measurement.
CentroidSlotDefinition::ErrValue getCentroidErr() const
Get the uncertainty on the Centroid slot measurement.
Key< Flag > getInstFluxFlagKey() const
Return the key used for the InstFlux slot failure flag.
void updateCoord(image::Wcs const &wcs)
Update the coord field using the given Wcs and the field in the centroid slot.
std::string getShapeDefinition() const
Return the name of the field used for the Shape slot.
SortedCatalogT< Record const > ConstCatalog
SourceColumnViewT< SourceRecord > SourceColumnView
double MeasValue
Type returned by accessing the slot measurement.
bool getPsfFluxFlag() const
Return true if the measurement in the PsfFlux slot failed.
bool hasCalibFluxSlot() const
Return true if the CalibFlux slot corresponds to a valid field.
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
void definePsfFlux(std::string const &name)
Set the measurement used for the PsfFlux slot.
void setParent(RecordId id)
Convenience accessors for the keys in the minimal source schema.
FluxSlotDefinition::MeasValue getModelFlux() const
Get the value of the ModelFlux slot measurement.
FluxSlotDefinition::MeasKey getCalibFluxKey() const
Return the key used for the CalibFlux slot measurement value.
A polymorphic functor base class for generating record IDs for a table.
void defineCentroid(std::string const &name)
Set the measurement used for the Centroid slot.
ShapeSlotDefinition::ErrValue getShapeErr() const
Get the uncertainty on the Shape slot measurement.
SourceFitsFlags
Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits.
boost::shared_ptr< AliasMap > getAliasMap() const
Return the map of aliases.
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
Table class that contains measurements made on a single exposure.
FluxSlotDefinition::MeasKey getApFluxKey() const
Return the key used for the ApFlux slot measurement value.
boost::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
Base class for all records.
FluxSlotDefinition::MeasKey getPsfFluxKey() const
Return the key used for the PsfFlux slot measurement value.
boost::shared_ptr< SourceTable const > getTable() const
SourceRecord(boost::shared_ptr< SourceTable > const &table)
Do not read/write footprints at all.
Key specialization for Flag.
FluxSlotDefinition::ErrKey getPsfFluxErrKey() const
Return the key used for the PsfFlux slot uncertainty.
bool hasInstFluxSlot() const
Return true if the InstFlux slot corresponds to a valid field.
Schema getSchema() const
Return the Schema that holds this record's fields and keys.
ndarray::Array< double, 1 > getPsfFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
Key< Flag > getModelFluxFlagKey() const
Return the key used for the ModelFlux slot failure flag.
SlotDefinition specialization for centroids.
double getY() const
Return the centroid slot y coordinate.
ShapeSlotDefinition const & getShapeSlot() const
FluxSlotDefinition::ErrKey getApFluxErrKey() const
Return the key used for the ApFlux slot uncertainty.
double getIyy() const
Return the shape slot Iyy value.
FluxSlotDefinition const & getModelFluxSlot() const
ndarray::Array< double, 1 > const getIxy() const
boost::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied...
bool hasShapeSlot() const
Return true if the Shape slot corresponds to a valid field.
FluxSlotDefinition::ErrValue getInstFluxErr() const
Get the uncertainty on the InstFlux slot measurement.
static Key< RecordId > getParentKey()
Key for the parent ID.
std::string getCentroidDefinition() const
Return the name of the field used for the Centroid slot.
ShapeSlotDefinition::MeasKey getShapeKey() const
Return the key used for the Shape slot measurement value.
SourceColumnViewT(BaseColumnView const &base)
ndarray::Array< double, 1 > getPsfFlux() const
Get the value of the PsfFlux slot measurement.
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
ndarray::Array< double, 1 > const getIyy() const
static SourceColumnViewT make(boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
Record class that contains measurements made on a single exposure.
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid SourceTable schema.
SortedCatalogT< SourceRecord const > ConstCatalog
Key< Flag > getApFluxFlagKey() const
Return the key used for the ApFlux slot failure flag.
ShapeSlotDefinition::MeasValue getShape() const
Get the value of the Shape slot measurement.
FluxSlotDefinition::ErrKey getModelFluxErrKey() const
Return the key used for the ModelFlux slot uncertainty.
#define CONST_PTR(...)
A shared pointer to a const object.
Key< Flag > getShapeFlagKey() const
Return the key used for the Shape slot failure flag.
Record class that must contain a unique ID field and a celestial coordinate field.
void defineInstFlux(std::string const &name)
Set the measurement used for the InstFlux slot.
FluxSlotDefinition::MeasKey getModelFluxKey() const
Return the key used for the ModelFlux slot measurement value.
RecordId getParent() const
Convenience accessors for the keys in the minimal source schema.
SlotDefinition specialization for shapes.
boost::shared_ptr< Footprint > getFootprint() const
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys...
SlotDefinition specialization for fluxes.
std::string getCalibFluxDefinition() const
Return the name of the field used for the CalibFlux slot.
FluxSlotDefinition::MeasKey getInstFluxKey() const
Return the key used for the InstFlux slot measurement value.
Read/write heavy footprints as non-heavy footprints.
ndarray::Array< double, 1 > getApFlux() const
Get the value of the ApFlux slot measurement.
Key< Flag > getCentroidFlagKey() const
Return the key used for the Centroid slot failure flag.
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.