Class PeakTable

Nested Relationships

Inheritance Relationships

Base Type

Class Documentation

class PeakTable : public lsst::afw::table::BaseTable

Table class for Peaks in Footprints.

Unnamed Group

static afw::table::Key<afw::table::RecordId> getIdKey()

Get keys for standard fields shared by all peaks.

These keys are used to implement getters and setters on PeakRecord.

static afw::table::Key<int> getIxKey()
static afw::table::Key<int> getIyKey()
static afw::table::Key<float> getFxKey()
static afw::table::Key<float> getFyKey()
static afw::table::Key<float> getPeakValueKey()

Public Types

typedef PeakRecord Record
typedef afw::table::ColumnViewT<PeakRecord> ColumnView
typedef afw::table::CatalogT<Record> Catalog
typedef afw::table::CatalogT<Record const> ConstCatalog

Public Functions

~PeakTable()
PeakTable &operator=(PeakTable const&)
PeakTable &operator=(PeakTable&&)
std::shared_ptr<afw::table::IdFactory> getIdFactory()

Return the object that generates IDs for the table (may be null).

std::shared_ptr<afw::table::IdFactory const> getIdFactory() const

Return the object that generates IDs for the table (may be null).

void setIdFactory(std::shared_ptr<afw::table::IdFactory> f)

Switch to a new IdFactory object that generates IDs for the table (may be null).

std::shared_ptr<PeakTable> 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<PeakRecord> 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<PeakRecord> copyRecord(afw::table::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<PeakRecord> copyRecord(afw::table::BaseRecord const &other, afw::table::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.

Public Static Functions

static std::shared_ptr<PeakTable> make(afw::table::Schema const &schema, bool forceNew = false)

Obtain a table that can be used to create records with given schema

If a

PeakTable already exists that uses this Schema, that PeakTable will be returned instead of creating a new one. This is different from how most Record/Table classes work, but it is an important memory optimization for Peaks, for which we expect to have very few distinct Schemas as well as many catalogs (one per Footprint) with a small number of Peaks; we don’t want to have a different PeakTable for each one of those catalogs if they all share the same Schema. This behavior can be disabled by setting forceNewTable=true or by cloning an existing table (in both of these cases, the new table will not be reused in the future, either)
Parameters
  • [in] schema: Schema that defines the fields, offsets, and record size for the table.

  • [in] forceNew: If true, guarantee that the returned PeakTable will be a new one, rather than attempting to reuse an existing PeakTable with the same Schema.

static afw::table::Schema makeMinimalSchema()

Return a minimal schema for Peak tables and records.

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

static bool checkSchema(afw::table::Schema const &other)

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

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

Protected Functions

PeakTable(afw::table::Schema const &schema, std::shared_ptr<afw::table::IdFactory> const &idFactory)
PeakTable(PeakTable const &other)
PeakTable(PeakTable &&other)
std::shared_ptr<afw::table::BaseTable> _clone() const

Clone implementation with noncovariant return types.

std::shared_ptr<afw::table::BaseRecord> _makeRecord()

Default-construct an associated record (protected implementation).

Friends

friend lsst::afw::detection::PeakTable::afw::table::io::FitsWriter