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"
42 namespace lsst {
namespace afw {
243 Schema r = getMinimalSchema().schema;
311 return getPsfFluxSlot().isValid();
320 return getPsfFluxSlot().getMeasKey();
329 return getPsfFluxSlot().getErrKey();
338 return getPsfFluxSlot().getFlagKey();
375 return getModelFluxSlot().isValid();
384 return getModelFluxSlot().getMeasKey();
393 return getModelFluxSlot().getErrKey();
402 return getModelFluxSlot().getFlagKey();
439 return getApFluxSlot().isValid();
448 return getApFluxSlot().getMeasKey();
457 return getApFluxSlot().getErrKey();
466 return getApFluxSlot().getFlagKey();
503 return getInstFluxSlot().isValid();
512 return getInstFluxSlot().getMeasKey();
521 return getInstFluxSlot().getErrKey();
530 return getInstFluxSlot().getFlagKey();
567 return getCalibFluxSlot().isValid();
576 return getCalibFluxSlot().getMeasKey();
585 return getCalibFluxSlot().getErrKey();
594 return getCalibFluxSlot().getFlagKey();
631 return getCentroidSlot().isValid();
640 return getCentroidSlot().getMeasKey();
649 return getCentroidSlot().getErrKey();
658 return getCentroidSlot().getFlagKey();
695 return getShapeSlot().isValid();
704 return getShapeSlot().getMeasKey();
713 return getShapeSlot().getErrKey();
722 return getShapeSlot().getFlagKey();
732 virtual void handleAliasChange(std::string
const & alias);
751 virtual PTR(
io::FitsWriter) makeFitsWriter(fits::Fits * fitsfile,
int flags) const;
756 template <typename RecordT>
761 typedef typename RecordT::Table
Table;
830 template <
typename InputIterator>
844 return this->
get(
getTable()->getPsfFluxSlot().getMeasKey());
848 return this->
get(
getTable()->getPsfFluxSlot().getErrKey());
852 return this->
get(
getTable()->getPsfFluxSlot().getFlagKey());
856 return this->
get(
getTable()->getModelFluxSlot().getMeasKey());
860 return this->
get(
getTable()->getModelFluxSlot().getErrKey());
864 return this->
get(
getTable()->getModelFluxSlot().getFlagKey());
868 return this->
get(
getTable()->getApFluxSlot().getMeasKey());
872 return this->
get(
getTable()->getApFluxSlot().getErrKey());
876 return this->
get(
getTable()->getApFluxSlot().getFlagKey());
880 return this->
get(
getTable()->getInstFluxSlot().getMeasKey());
884 return this->
get(
getTable()->getInstFluxSlot().getErrKey());
888 return this->
get(
getTable()->getInstFluxSlot().getFlagKey());
892 return this->
get(
getTable()->getCalibFluxSlot().getMeasKey());
896 return this->
get(
getTable()->getCalibFluxSlot().getErrKey());
900 return this->
get(
getTable()->getCalibFluxSlot().getFlagKey());
904 return this->
get(
getTable()->getCentroidSlot().getMeasKey());
908 return this->
get(
getTable()->getCentroidSlot().getErrKey());
912 return this->
get(
getTable()->getCentroidSlot().getFlagKey());
916 return this->
get(
getTable()->getShapeSlot().getMeasKey());
920 return this->
get(
getTable()->getShapeSlot().getErrKey());
924 return this->
get(
getTable()->getShapeSlot().getFlagKey());
931 return get(
getTable()->getCentroidKey().getX());
934 return get(
getTable()->getCentroidKey().getY());
937 return get(
getTable()->getShapeKey().getIxx());
940 return get(
getTable()->getShapeKey().getIyy());
943 return get(
getTable()->getShapeKey().getIxy());
950 #endif // !AFW_TABLE_Source_h_INCLUDED
FluxSlotDefinition::MeasValue getInstFlux() const
Get the value of the InstFlux slot measurement.
FluxSlotDefinition const & getInstFluxSlot() const
An ellipse core with quadrupole moments as parameters.
Defines the fields and offsets for a table.
bool getShapeFlag() const
Return true if the measurement in the Shape slot failed.
SortedCatalogT< SourceRecord > Catalog
ShapeSlotDefinition const & getShapeSlot() const
Key< Flag > getModelFluxFlagKey() const
Return the key used for the ModelFlux slot failure flag.
FluxSlotDefinition::MeasValue getApFlux() const
Get the value of the ApFlux slot measurement.
ndarray::Array< double, 1 > const getY() const
CentroidSlotDefinition::MeasValue getCentroid() const
Get the value of the Centroid slot measurement.
void setParent(RecordId id)
Convenience accessors for the keys in the minimal source schema.
void defineCentroid(std::string const &name)
Set the measurement used for the Centroid slot.
Schema getSchema() const
Return the Schema that holds this record's fields and keys.
void updateCoord(image::Wcs const &wcs)
Update the coord field using the given Wcs and the field in the centroid slot.
ndarray::Array< double, 1 > getPsfFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
Column-wise view into a sequence of records that have been allocated contiguously.
Writer object for FITS binary tables.
ndarray::Array< double, 1 > getPsfFlux() const
Get the value of the PsfFlux slot measurement.
ndarray::Array< double, 1 > const getX() const
static BaseColumnView make(boost::shared_ptr< BaseTable > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
boost::shared_ptr< SourceTable const > getTable() const
table::Key< std::string > name
FluxSlotDefinition::ErrValue getModelFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
FluxSlotDefinition::ErrKey getCalibFluxErrKey() const
Return the key used for the CalibFlux slot uncertainty.
double ErrValue
Type returned by accessing the slot uncertainty.
void defineApFlux(std::string const &name)
Set the measurement used for the ApFlux slot.
double getX() const
Return the centroid slot x coordinate.
CentroidSlotDefinition::MeasKey getCentroidKey() const
Return the key used for the Centroid slot measurement value.
ShapeSlotDefinition::ErrKey getShapeErrKey() const
Return the key used for the Shape slot uncertainty.
A mapping between the keys of two Schemas, used to copy data between them.
ndarray::Array< double, 1 > const getIyy() const
SourceColumnViewT(BaseColumnView const &base)
ndarray::Array< double, 1 > getModelFluxErr() const
Get the uncertainty on the ModelFlux slot measurement.
boost::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
bool getInstFluxFlag() const
Return true if the measurement in the InstFlux slot failed.
double getY() const
Return the centroid slot y coordinate.
Key< Flag > getApFluxFlagKey() const
Return the key used for the ApFlux slot failure flag.
bool getCalibFluxFlag() const
Return true if the measurement in the CalibFlux slot failed.
lsst::afw::detection::Footprint Footprint
FluxSlotDefinition::ErrValue getInstFluxErr() const
Get the uncertainty on the InstFlux slot measurement.
Field< T >::Reference operator[](Key< T > const &key)
Return a reference (or reference-like type) to the field's value.
SortedCatalogT< Record const > ConstCatalog
Key< Flag > getInstFluxFlagKey() const
Return the key used for the InstFlux slot failure flag.
FluxSlotDefinition::MeasKey getApFluxKey() const
Return the key used for the ApFlux slot measurement value.
FluxSlotDefinition::ErrValue getPsfFluxErr() const
Get the uncertainty on the PsfFlux slot measurement.
FluxSlotDefinition::MeasValue getPsfFlux() const
Get the value of the PsfFlux slot measurement.
FluxSlotDefinition const & getCalibFluxSlot() const
boost::shared_ptr< AliasMap > getAliasMap() const
ShapeSlotDefinition::ErrValue getShapeErr() const
Get the uncertainty on the Shape slot measurement.
Implementation of the WCS standard for a any projection.
bool hasModelFluxSlot() const
Return true if the ModelFlux slot corresponds to a valid field.
FluxSlotDefinition::MeasKey getPsfFluxKey() const
Return the key used for the PsfFlux slot measurement value.
static boost::shared_ptr< IdFactory > makeSimple()
Return a simple IdFactory that simply counts from 1.
CentroidSlotDefinition::ErrValue getCentroidErr() const
Get the uncertainty on the Centroid slot measurement.
FluxSlotDefinition::ErrValue getApFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
void definePsfFlux(std::string const &name)
Set the measurement used for the PsfFlux slot.
static Schema makeMinimalSchema()
Return a minimal schema for Source tables and records.
FluxSlotDefinition::ErrKey getModelFluxErrKey() const
Return the key used for the ModelFlux slot uncertainty.
Eigen::Matrix< float, 3, 3 > ErrValue
Type returned by accessing the slot uncertainty.
std::map< Citizen const *, CitizenInfo > table
std::string getPsfFluxDefinition() const
Return the name of the field used for the PsfFlux slot.
table::Key< table::Array< Kernel::Pixel > > image
double getIyy() const
Return the shape slot Iyy value.
bool getCentroidFlag() const
Return true if the measurement in the Centroid slot failed.
static Key< RecordId > getParentKey()
Key for the parent ID.
std::string getShapeDefinition() const
Return the name of the field used for the Shape slot.
SortedCatalogT< Record > Catalog
ndarray::Array< double, 1 > getApFlux() const
Get the value of the ApFlux slot measurement.
static bool checkSchema(Schema const &other)
Return true if the given schema is a valid SourceTable schema.
ndarray::Array< double, 1 > getInstFlux() const
Get the value of the InstFlux slot measurement.
void defineCalibFlux(std::string const &name)
Set the measurement used for the CalibFlux slot.
Table class that must contain a unique ID field and a celestial coordinate field. ...
FluxSlotDefinition::ErrValue getCalibFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
double getIxx() const
Return the shape slot Ixx value.
int contains(Schema const &other, int flags=EQUAL_KEYS) const
Test whether the given schema is a subset of this.
std::string getInstFluxDefinition() const
Return the name of the field used for the InstFlux slot.
Custom catalog class for record/table subclasses that are guaranteed to have an ID, and should generally be sorted by that ID.
FluxSlotDefinition const & getPsfFluxSlot() const
bool hasApFluxSlot() const
Return true if the ApFlux slot corresponds to a valid field.
FluxSlotDefinition const & getModelFluxSlot() const
void defineInstFlux(std::string const &name)
Set the measurement used for the InstFlux slot.
FluxSlotDefinition::MeasKey getCalibFluxKey() const
Return the key used for the CalibFlux slot measurement value.
RecordId getParent() const
Convenience accessors for the keys in the minimal source schema.
SortedCatalogT< SourceRecord const > ConstCatalog
ndarray::Array< double, 1 > const getIxx() const
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied...
Key< Flag > getPsfFluxFlagKey() const
Return the key used for the PsfFlux slot failure flag.
boost::shared_ptr< Footprint > _footprint
Key< Flag > getCalibFluxFlagKey() const
Return the key used for the CalibFlux slot failure flag.
SourceColumnViewT< SourceRecord > SourceColumnView
bool hasCalibFluxSlot() const
Return true if the CalibFlux slot corresponds to a valid field.
ShapeSlotDefinition::MeasValue getShape() const
Get the value of the Shape slot measurement.
ndarray::Array< double, 1 > getInstFluxErr() const
Get the uncertainty on the InstFlux slot measurement.
A polymorphic functor base class for generating record IDs for a table.
void defineShape(std::string const &name)
Set the measurement used for the Shape slot.
Key< Flag > getShapeFlagKey() const
Return the key used for the Shape slot failure flag.
bool getApFluxFlag() const
Return true if the measurement in the ApFlux slot failed.
boost::shared_ptr< BaseRecord > copyRecord(BaseRecord const &input)
Deep-copy a record, requiring that it have the same schema as this table.
ndarray::Array< double, 1 > const getIxy() const
SourceFitsFlags
Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits.
Table class that contains measurements made on a single exposure.
FluxSlotDefinition::MeasKey getModelFluxKey() const
Return the key used for the ModelFlux slot measurement value.
Eigen::Matrix< float, 2, 2 > ErrValue
Type returned by accessing the slot uncertainty.
bool hasShapeSlot() const
Return true if the Shape slot corresponds to a valid field.
A multidimensional strided array.
double getIxy() const
Return the shape slot Ixy value.
Base class for all records.
std::string getCentroidDefinition() const
Return the name of the field used for the Centroid slot.
bool getModelFluxFlag() const
Return true if the measurement in the ModelFlux slot failed.
CentroidSlotDefinition const & getCentroidSlot() const
bool hasInstFluxSlot() const
Return true if the InstFlux slot corresponds to a valid field.
Do not read/write footprints at all.
bool hasPsfFluxSlot() const
Return true if the PsfFlux slot corresponds to a valid field.
ndarray::Array< double, 1 > getApFluxErr() const
Get the uncertainty on the ApFlux slot measurement.
FluxSlotDefinition::ErrKey getPsfFluxErrKey() const
Return the key used for the PsfFlux slot uncertainty.
void disconnectAliases()
Sever the connection between this schema and any others with which it shares aliases.
Key specialization for Flag.
ndarray::Array< double, 1 > getCalibFlux() const
Get the value of the CalibFlux slot measurement.
FluxSlotDefinition::ErrKey getInstFluxErrKey() const
Return the key used for the InstFlux slot uncertainty.
SlotDefinition specialization for centroids.
ndarray::Array< double, 1 > getModelFlux() const
Get the value of the ModelFlux slot measurement.
bool hasCentroidSlot() const
Return true if the Centroid slot corresponds to a valid field.
boost::shared_ptr< Footprint > getFootprint() const
double MeasValue
Type returned by accessing the slot measurement.
bool getPsfFluxFlag() const
Return true if the measurement in the PsfFlux slot failed.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
SourceColumnViewT< SourceRecord > ColumnView
FluxSlotDefinition const & getApFluxSlot() const
Key< Flag > getCentroidFlagKey() const
Return the key used for the Centroid slot failure flag.
Record class that contains measurements made on a single exposure.
static SourceColumnViewT make(boost::shared_ptr< Table > const &table, InputIterator first, InputIterator last)
Construct a BaseColumnView from an iterator range.
SourceRecord(boost::shared_ptr< SourceTable > const &table)
void defineModelFlux(std::string const &name)
Set the measurement used for the ModelFlux slot.
FluxSlotDefinition::ErrKey getApFluxErrKey() const
Return the key used for the ApFlux slot uncertainty.
void setFootprint(boost::shared_ptr< Footprint > const &footprint)
Record class that must contain a unique ID field and a celestial coordinate field.
boost::int64_t RecordId
Type used for unique IDs for records.
ShapeSlotDefinition::MeasKey getShapeKey() const
Return the key used for the Shape slot measurement value.
ndarray::Array< double, 1 > getCalibFluxErr() const
Get the uncertainty on the CalibFlux slot measurement.
SlotDefinition specialization for shapes.
A FunctorKey used to get or set a geom::ellipses::Quadrupole from a tuple of constituent Keys...
FluxSlotDefinition::MeasValue getModelFlux() const
Get the value of the ModelFlux slot measurement.
CentroidSlotDefinition::ErrKey getCentroidErrKey() const
Return the key used for the Centroid slot uncertainty.
FluxSlotDefinition::MeasKey getInstFluxKey() const
Return the key used for the InstFlux slot measurement value.
SlotDefinition specialization for fluxes.
SourceColumnViewT< SourceRecord > ColumnView
Read/write heavy footprints as non-heavy footprints.
FluxSlotDefinition::MeasValue getCalibFlux() const
Get the value of the CalibFlux slot measurement.
std::string getCalibFluxDefinition() const
Return the name of the field used for the CalibFlux slot.
std::string getApFluxDefinition() const
Return the name of the field used for the ApFlux slot.
static boost::shared_ptr< SourceTable > make(Schema const &schema)
Construct a new table.
std::string getModelFluxDefinition() const
Return the name of the field used for the ModelFlux slot.