File Source.h

namespace lsst

Class for a simple mapping implementing a generic AstrometryTransform.

Remove all non-astronomical counts from the Chunk Exposure’s pixels.

Forward declarations for lsst::utils::Cache

For details on the Cache class, see the Cache.h file.

It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.

A base class for image defects

Numeric constants used by the Integrate.h integrator routines.

Compute Image Statistics

Note

Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.

Note

The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.

namespace afw
namespace table

Typedefs

typedef lsst::afw::detection::Footprint Footprint

Enums

enum SourceFitsFlags

Bitflags to be passed to SourceCatalog::readFits and SourceCatalog::writeFits

Note that these flags may also be passed when reading/writing SourceCatalogs via the Butler, by passing a “flags” key/value pair as part of the data ID.

Values:

SOURCE_IO_NO_FOOTPRINTS = 0x1

Do not read/write footprints at all.

SOURCE_IO_NO_HEAVY_FOOTPRINTS = 0x2

Read/write heavy footprints as non-heavy footprints.

class SourceRecord : public lsst::afw::table::SimpleRecord
#include <Source.h>

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.

Unnamed Group

RecordId getParent() const

Convenience accessors for the keys in the minimal source schema.

void setParent(RecordId id)

Public Types

typedef SourceTable Table
typedef SourceColumnViewT<SourceRecord> ColumnView
typedef SortedCatalogT<SourceRecord> Catalog
typedef SortedCatalogT<SourceRecord const> ConstCatalog

Public Functions

SourceRecord(ConstructionToken const &token, detail::RecordData &&data)

Constructor used by SourceTable.

While formally public, this constructor is conceptually and effectively protected, due to the (protected) ConstructionToken argument.

This is to allow make_shared to be used, as that cannot be used on a truly protected or private constructor.

std::shared_ptr<Footprint> getFootprint() const
void setFootprint(std::shared_ptr<Footprint> const &footprint)
std::shared_ptr<SourceTable const> getTable() const
FluxSlotDefinition::MeasValue getPsfInstFlux() const

Get the value of the PsfFlux slot measurement.

FluxSlotDefinition::ErrValue getPsfInstFluxErr() const

Get the uncertainty on the PsfFlux slot measurement.

bool getPsfFluxFlag() const

Return true if the measurement in the PsfFlux slot failed.

FluxSlotDefinition::MeasValue getModelInstFlux() const

Get the value of the ModelFlux slot measurement.

FluxSlotDefinition::ErrValue getModelInstFluxErr() const

Get the uncertainty on the ModelFlux slot measurement.

bool getModelFluxFlag() const

Return true if the measurement in the ModelFlux slot failed.

FluxSlotDefinition::MeasValue getApInstFlux() const

Get the value of the ApFlux slot measurement.

FluxSlotDefinition::ErrValue getApInstFluxErr() const

Get the uncertainty on the ApFlux slot measurement.

bool getApFluxFlag() const

Return true if the measurement in the ApFlux slot failed.

FluxSlotDefinition::MeasValue getGaussianInstFlux() const

Get the value of the GaussianFlux slot measurement.

FluxSlotDefinition::ErrValue getGaussianInstFluxErr() const

Get the uncertainty on the GaussianFlux slot measurement.

bool getGaussianFluxFlag() const

Return true if the measurement in the GaussianFlux slot failed.

FluxSlotDefinition::MeasValue getCalibInstFlux() const

Get the value of the CalibFlux slot measurement.

FluxSlotDefinition::ErrValue getCalibInstFluxErr() const

Get the uncertainty on the CalibFlux slot measurement.

bool getCalibFluxFlag() const

Return true if the measurement in the CalibFlux slot failed.

CentroidSlotDefinition::MeasValue getCentroid() const

Get the value of the Centroid slot measurement.

CentroidSlotDefinition::ErrValue getCentroidErr() const

Get the uncertainty on the Centroid slot measurement.

bool getCentroidFlag() const

Return true if the measurement in the Centroid slot failed.

ShapeSlotDefinition::MeasValue getShape() const

Get the value of the Shape slot measurement.

ShapeSlotDefinition::ErrValue getShapeErr() const

Get the uncertainty on the Shape slot measurement.

bool getShapeFlag() const

Return true if the measurement in the Shape slot failed.

double getX() const

Return the centroid slot x coordinate.

double getY() const

Return the centroid slot y coordinate.

double getIxx() const

Return the shape slot Ixx value.

double getIyy() const

Return the shape slot Iyy value.

double getIxy() const

Return the shape slot Ixy value.

void updateCoord(geom::SkyWcs const &wcs)

Update the coord field using the given Wcs and the field in the centroid slot.

void updateCoord(geom::SkyWcs const &wcs, PointKey<double> const &key)

Update the coord field using the given Wcs and the image center from the given key.

SourceRecord(const SourceRecord&)
SourceRecord &operator=(const SourceRecord&)
SourceRecord(SourceRecord&&)
SourceRecord &operator=(SourceRecord&&)
~SourceRecord()

Protected Functions

virtual void _assign(BaseRecord const &other)

Called by assign() after transferring fields to allow subclass data members to be copied.

Private Members

std::shared_ptr<Footprint> _footprint

Friends

friend lsst::afw::table::SourceTable
class SourceTable : public lsst::afw::table::SimpleTable
#include <Source.h>

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).

Private Functions

std::shared_ptr<io::FitsWriter> makeFitsWriter(fits::Fits *fitsfile, int flags) const

Private Members

SlotSuite _slots

Private Static Functions

static MinimalSchema &getMinimalSchema()

Friends

friend lsst::afw::table::io::FitsWriter
friend lsst::afw::table::SourceRecord
struct MinimalSchema

Public Functions

MinimalSchema()

Public Members

Schema schema
Key<RecordId> parent