Class SourceTable

Nested Relationships

Inheritance Relationships

Base Type

Class Documentation

class SourceTable : public lsst::afw::table::SimpleTable

Table class that contains measurements made on a single exposure.

Record class that contains measurements made on a single exposure.

Sources provide four additions to SimpleRecord / SimpleRecord:

  • Specific fields that must always be present, with specialized getters. The schema for a SourceTable should always be constructed by starting with the result of SourceTable::makeMinimalSchema.

  • A shared_ptr to a Footprint for each record.

  • A system of aliases (called slots) in which a SourceTable instance stores keys for particular measurements (a centroid, a shape, and a number of different fluxes) and SourceRecord uses this keys to provide custom getters and setters. These are not separate fields, but rather aliases that can point to custom fields. See the SlotDefinition hierarchy for more information.

Public Types

typedef SourceRecord Record
typedef SourceColumnViewT<SourceRecord> ColumnView
typedef SortedCatalogT<Record> Catalog
typedef SortedCatalogT<Record const> ConstCatalog

Public Functions

std::shared_ptr<SourceTable> clone() const

Return a polymorphic deep copy of the table.

Derived classes should reimplement by static-casting the output of _clone to a pointer-to-derived to simulate covariant return types.

Cloning a table does not clone its associated records; the new table produced by clone() does not have any associated records.

std::shared_ptr<SourceRecord> makeRecord()

Default-construct an associated record.

Derived classes should reimplement by static-casting the output of _makeRecord to the appropriate BaseRecord subclass to simulate covariant return types.

std::shared_ptr<SourceRecord> copyRecord(BaseRecord const &other)

Deep-copy a record, requiring that it have the same schema as this table.

Regardless of the type or associated table of the input record, the type of the output record will be the type associated with this table and the record instance will be associated with this table.

Allowing derived-class records to be constructed from base-class records could be considered a form of type-slicing, but because we already demand that all records be constructable from nothing but a table, this isn’t anything new.

Derived classes should reimplement by static-casting the output of BaseTable::copyRecord to the appropriate BaseRecord subclass.

This is implemented using makeRecord and calling record.assign on the results; override those to change the behavior.

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.

Regardless of the type or associated table of the input record, the type of the output record will be the type associated with this table and the record instance will be associated with this table.

Allowing derived-class records to be constructed from base-class records could be considered a form of type-slicing, but because we already demand that all records be constructable from nothing but a table, this isn’t anything new.

Derived classes should reimplement by static-casting the output of BaseTable::copyRecord to the appropriate BaseRecord subclass.

This is implemented using makeRecord and calling record.assign on the results; override those to change the behavior.

FluxSlotDefinition const &getPsfFluxSlot() const
void definePsfFlux(std::string const &name)

Set the measurement used for the PsfFlux slot.

The definitions for slots are actually managed by the Schema object, and its associated AliasMap, so this simply sets the “slot_PsfFlux” alias to point to the given field name prefix. See FluxSlotDefinition for more information.

FluxSlotDefinition const &getModelFluxSlot() const
void defineModelFlux(std::string const &name)

Set the measurement used for the ModelFlux slot.

The definitions for slots are actually managed by the Schema object, and its associated AliasMap, so this simply sets the “slot_ModelFlux” alias to point to the given field name prefix. See FluxSlotDefinition for more information.

FluxSlotDefinition const &getApFluxSlot() const
void defineApFlux(std::string const &name)

Set the measurement used for the ApFlux slot.

The definitions for slots are actually managed by the Schema object, and its associated AliasMap, so this simply sets the “slot_ApFlux” alias to point to the given field name prefix. See FluxSlotDefinition for more information.

FluxSlotDefinition const &getGaussianFluxSlot() const
void defineGaussianFlux(std::string const &name)

Set the measurement used for the GaussianFlux slot.

The definitions for slots are actually managed by the Schema object, and its associated AliasMap, so this simply sets the “slot_GaussianFlux” alias to point to the given field name prefix. See FluxSlotDefinition for more information.

FluxSlotDefinition const &getCalibFluxSlot() const
void defineCalibFlux(std::string const &name)

Set the measurement used for the CalibFlux slot.

The definitions for slots are actually managed by the Schema object, and its associated AliasMap, so this simply sets the “slot_CalibFlux” alias to point to the given field name prefix. See FluxSlotDefinition for more information.

CentroidSlotDefinition const &getCentroidSlot() const
void defineCentroid(std::string const &name)

Set the measurement used for the Centroid slot.

The definitions for slots are actually managed by the Schema object, and its associated AliasMap, so this simply sets the “slot_Centroid” alias to point to the given field name prefix. See CentroidSlotDefinition for more information.

std::string getCentroidDefinition() const

Return the name of the field used for the Centroid slot.

getSchema().getAliasMap()->get("slot_Centroid")
Exceptions
  • pex::exceptions::NotFoundError: if the slot is not defined.

bool hasCentroidSlot() const

Return true if the Centroid slot corresponds to a valid field.

CentroidSlotDefinition::MeasKey getCentroidKey() const

Return the key used for the Centroid slot measurement value.

CentroidSlotDefinition::ErrKey getCentroidErrKey() const

Return the key used for the Centroid slot uncertainty.

Key<Flag> getCentroidFlagKey() const

Return the key used for the Centroid slot failure flag.

ShapeSlotDefinition const &getShapeSlot() const
void defineShape(std::string const &name)

Set the measurement used for the Shape slot.

The definitions for slots are actually managed by the Schema object, and its associated AliasMap, so this simply sets the “slot_Shape” alias to point to the given field name prefix. See ShapeSlotDefinition for more information.

std::string getShapeDefinition() const

Return the name of the field used for the Shape slot.

getSchema().getAliasMap()->get("slot_Shape")
Exceptions
  • pex::exceptions::NotFoundError: if the slot is not defined.

bool hasShapeSlot() const

Return true if the Shape slot corresponds to a valid field.

ShapeSlotDefinition::MeasKey getShapeKey() const

Return the key used for the Shape slot measurement value.

ShapeSlotDefinition::ErrKey getShapeErrKey() const

Return the key used for the Shape slot uncertainty.

Key<Flag> getShapeFlagKey() const

Return the key used for the Shape slot failure flag.

SourceTable &operator=(SourceTable const&)
SourceTable &operator=(SourceTable&&)

Public Static Functions

static std::shared_ptr<SourceTable> make(Schema const &schema, std::shared_ptr<IdFactory> const &idFactory)

Construct a new table.

Note that not passing an

IdFactory at all will call the other override of make(), which will set the ID factory to IdFactory::makeSimple().
Parameters
  • [in] schema: Schema that defines the fields, offsets, and record size for the table.

  • [in] idFactory: Factory class to generate record IDs when they are not explicitly given. If null, record IDs will default to zero.

static std::shared_ptr<SourceTable> make(Schema const &schema)

Construct a new table.

This overload sets the ID factory to

IdFactory::makeSimple().
Parameters
  • [in] schema: Schema that defines the fields, offsets, and record size for the table.

static Schema makeMinimalSchema()

Return a minimal schema for Source tables and records.

The returned schema can and generally should be modified further, but many operations on sources will assume that at least the fields provided by this routine are present.

Keys for the standard fields added by this routine can be obtained from other static member functions of the SourceTable class.

static bool checkSchema(Schema const &other)

Return true if the given schema is a valid SourceTable schema.

This will always be true if the given schema was originally constructed using makeMinimalSchema(), and will rarely be true otherwise.

static Key<RecordId> getParentKey()

Key for the parent ID.

Protected Functions

SourceTable(Schema const &schema, std::shared_ptr<IdFactory> const &idFactory)
SourceTable(SourceTable const &other)
SourceTable(SourceTable &&other)
void handleAliasChange(std::string const &alias)
std::shared_ptr<BaseTable> _clone() const

Clone implementation with noncovariant return types.

std::shared_ptr<BaseRecord> _makeRecord()

Default-construct an associated record (protected implementation).

Friends

friend lsst::afw::table::SourceTable::io::FitsWriter