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.
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.
A multidimensional strided array.
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.
boost::int64_t RecordId
Type used for unique IDs for records.
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