lsst.afw  13.0-98-g5a654715e+2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
lsst::afw::detection::PeakTable Class Reference

Table class for Peaks in Footprints. More...

#include <Peak.h>

Inheritance diagram for lsst::afw::detection::PeakTable:
lsst::afw::table::BaseTable

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 Member Functions

std::shared_ptr
< afw::table::IdFactory > 
getIdFactory ()
 Return the object that generates IDs for the table (may be null). More...
 
std::shared_ptr
< afw::table::IdFactory const > 
getIdFactory () const
 Return the object that generates IDs for the table (may be null). More...
 
void setIdFactory (std::shared_ptr< afw::table::IdFactory > f)
 Switch to a new IdFactory – object that generates IDs for the table (may be null). More...
 
std::shared_ptr< PeakTable > clone () const
 
std::shared_ptr< PeakRecord > makeRecord ()
 
std::shared_ptr< PeakRecord > copyRecord (afw::table::BaseRecord const &other)
 
std::shared_ptr< PeakRecord > copyRecord (afw::table::BaseRecord const &other, afw::table::SchemaMapper const &mapper)
 
std::shared_ptr
< daf::base::PropertyList > 
getMetadata () const
 Return the flexible metadata associated with the table. May be null. More...
 
void setMetadata (std::shared_ptr< daf::base::PropertyList > const &metadata)
 Set the flexible metadata associated with the table. May be null. More...
 
std::shared_ptr
< daf::base::PropertyList > 
popMetadata ()
 Return the metadata and set the internal metadata to a null pointer. More...
 
Schema getSchema () const
 Return the table's schema. More...
 
void preallocate (std::size_t nRecords)
 Allocate contiguous space for new records in advance. More...
 
std::size_t getBufferSize () const
 Return the number of additional records space has been already been allocated for. More...
 

Static Public Member 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. More...
 
static afw::table::Schema makeMinimalSchema ()
 Return a minimal schema for Peak tables and records. More...
 
static bool checkSchema (afw::table::Schema const &other)
 Return true if the given schema is a valid PeakTable schema. More...
 
static std::shared_ptr< BaseTable > make (Schema const &schema)
 Construct a new table. More...
 
static afw::table::Key
< afw::table::RecordId > 
getIdKey ()
 Get keys for standard fields shared by all peaks. More...
 
static afw::table::Key< int > getIxKey ()
 Get keys for standard fields shared by all peaks. More...
 
static afw::table::Key< int > getIyKey ()
 Get keys for standard fields shared by all peaks. More...
 
static afw::table::Key< float > getFxKey ()
 Get keys for standard fields shared by all peaks. More...
 
static afw::table::Key< float > getFyKey ()
 Get keys for standard fields shared by all peaks. More...
 
static afw::table::Key< float > getPeakValueKey ()
 Get keys for standard fields shared by all peaks. More...
 

Static Public Attributes

static int nRecordsPerBlock
 Number of records in each memory block. More...
 

Protected Member Functions

 PeakTable (afw::table::Schema const &schema, std::shared_ptr< afw::table::IdFactory > const &idFactory)
 
 PeakTable (PeakTable const &other)
 
std::shared_ptr
< afw::table::BaseTable > 
_clone () const override
 Clone implementation with noncovariant return types. More...
 
std::shared_ptr
< afw::table::BaseRecord > 
_makeRecord () override
 Default-construct an associated record (protected implementation). More...
 
template<typename Derived >
std::shared_ptr< Derived > getSelf ()
 Convenience function for static-casting shared_from_this for use by derived classes. More...
 
template<typename Derived >
std::shared_ptr< Derived const > getSelf () const
 Convenience function for static-casting shared_from_this for use by derived classes. More...
 
virtual void handleAliasChange (std::string const &alias)
 

Friends

class afw::table::io::FitsWriter
 

Detailed Description

Table class for Peaks in Footprints.

Definition at line 86 of file Peak.h.

Member Typedef Documentation

Definition at line 90 of file Peak.h.

Definition at line 89 of file Peak.h.

Definition at line 91 of file Peak.h.

Definition at line 88 of file Peak.h.

Constructor & Destructor Documentation

lsst::afw::detection::PeakTable::PeakTable ( afw::table::Schema const &  schema,
std::shared_ptr< afw::table::IdFactory > const &  idFactory 
)
protected

Definition at line 134 of file Peak.cc.

lsst::afw::detection::PeakTable::PeakTable ( PeakTable const &  other)
protected

Definition at line 138 of file Peak.cc.

Member Function Documentation

std::shared_ptr< afw::table::BaseTable > lsst::afw::detection::PeakTable::_clone ( ) const
overrideprotectedvirtual

Clone implementation with noncovariant return types.

Reimplemented from lsst::afw::table::BaseTable.

Definition at line 161 of file Peak.cc.

std::shared_ptr< afw::table::BaseRecord > lsst::afw::detection::PeakTable::_makeRecord ( )
overrideprotectedvirtual

Default-construct an associated record (protected implementation).

Reimplemented from lsst::afw::table::BaseTable.

Definition at line 165 of file Peak.cc.

static bool lsst::afw::detection::PeakTable::checkSchema ( afw::table::Schema const &  other)
inlinestatic

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.

Definition at line 125 of file Peak.h.

std::shared_ptr<PeakTable> lsst::afw::detection::PeakTable::clone ( ) const
inline

Definition at line 153 of file Peak.h.

std::shared_ptr<PeakRecord> lsst::afw::detection::PeakTable::copyRecord ( afw::table::BaseRecord const &  other)
inline

Definition at line 159 of file Peak.h.

std::shared_ptr<PeakRecord> lsst::afw::detection::PeakTable::copyRecord ( afw::table::BaseRecord const &  other,
afw::table::SchemaMapper const &  mapper 
)
inline

Definition at line 164 of file Peak.h.

std::size_t lsst::afw::table::BaseTable::getBufferSize ( ) const
inherited

Return the number of additional records space has been already been allocated for.

Unlike std::vector::capacity, this does not factor in existing records in any way.

static afw::table::Key<float> lsst::afw::detection::PeakTable::getFxKey ( )
inlinestatic

Get keys for standard fields shared by all peaks.

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

Definition at line 147 of file Peak.h.

static afw::table::Key<float> lsst::afw::detection::PeakTable::getFyKey ( )
inlinestatic

Get keys for standard fields shared by all peaks.

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

Definition at line 148 of file Peak.h.

std::shared_ptr<afw::table::IdFactory> lsst::afw::detection::PeakTable::getIdFactory ( )
inline

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

Definition at line 130 of file Peak.h.

std::shared_ptr<afw::table::IdFactory const> lsst::afw::detection::PeakTable::getIdFactory ( ) const
inline

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

Definition at line 133 of file Peak.h.

static afw::table::Key<afw::table::RecordId> lsst::afw::detection::PeakTable::getIdKey ( )
inlinestatic

Get keys for standard fields shared by all peaks.

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

Definition at line 144 of file Peak.h.

static afw::table::Key<int> lsst::afw::detection::PeakTable::getIxKey ( )
inlinestatic

Get keys for standard fields shared by all peaks.

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

Definition at line 145 of file Peak.h.

static afw::table::Key<int> lsst::afw::detection::PeakTable::getIyKey ( )
inlinestatic

Get keys for standard fields shared by all peaks.

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

Definition at line 146 of file Peak.h.

std::shared_ptr<daf::base::PropertyList> lsst::afw::table::BaseTable::getMetadata ( ) const
inlineinherited

Return the flexible metadata associated with the table. May be null.

Definition at line 62 of file BaseTable.h.

static afw::table::Key<float> lsst::afw::detection::PeakTable::getPeakValueKey ( )
inlinestatic

Get keys for standard fields shared by all peaks.

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

Definition at line 149 of file Peak.h.

Schema lsst::afw::table::BaseTable::getSchema ( ) const
inlineinherited

Return the table's schema.

Definition at line 120 of file BaseTable.h.

template<typename Derived >
std::shared_ptr<Derived> lsst::afw::table::BaseTable::getSelf ( )
inlineprotectedinherited

Convenience function for static-casting shared_from_this for use by derived classes.

Definition at line 162 of file BaseTable.h.

template<typename Derived >
std::shared_ptr<Derived const> lsst::afw::table::BaseTable::getSelf ( ) const
inlineprotectedinherited

Convenience function for static-casting shared_from_this for use by derived classes.

Definition at line 168 of file BaseTable.h.

virtual void lsst::afw::table::BaseTable::handleAliasChange ( std::string const &  alias)
inlineprotectedvirtualinherited

Reimplemented in lsst::afw::table::SourceTable.

Definition at line 172 of file BaseTable.h.

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

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

Parameters
[in]schemaSchema that defines the fields, offsets, and record size for the table.
[in]forceNewIf true, guarantee that the returned PeakTable will be a new one, rather than attempting to reuse an existing PeakTable with the same 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)

Definition at line 100 of file Peak.cc.

static std::shared_ptr<BaseTable> lsst::afw::table::BaseTable::make ( Schema const &  schema)
staticinherited

Construct a new table.

Because BaseTable is an abstract class, this actually returns a hidden trivial subclass (which is associated with a hidden trivial subclass of BaseRecord).

Hiding concrete table and record classes in anonymous namespaces is not required, but it makes it easier to ensure instances are always created within shared_ptrs, and it eliminates some multilateral friending that would otherwise be necessary. In some cases it may also serve as a form of pimpl, keeping class implementation details out of header files.

static afw::table::Schema lsst::afw::detection::PeakTable::makeMinimalSchema ( )
inlinestatic

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.

Definition at line 117 of file Peak.h.

std::shared_ptr<PeakRecord> lsst::afw::detection::PeakTable::makeRecord ( )
inline

Definition at line 156 of file Peak.h.

std::shared_ptr<daf::base::PropertyList> lsst::afw::table::BaseTable::popMetadata ( )
inlineinherited

Return the metadata and set the internal metadata to a null pointer.

Definition at line 68 of file BaseTable.h.

void lsst::afw::table::BaseTable::preallocate ( std::size_t  nRecords)
inherited

Allocate contiguous space for new records in advance.

If a contiguous memory block for at least n additional records has already been allocated, this is a no-op. If not, a new block will be allocated, and any remaining space on the old block will go to waste; this ensures the new records will be allocated contiguously. Note that "wasted" memory is not leaked; it will be deallocated along with any records created from that block when those records go out of scope.

Note that unlike std::vector::reserve, this does not factor in existing records in any way; nRecords refers to a number of new records to reserve space for.

void lsst::afw::detection::PeakTable::setIdFactory ( std::shared_ptr< afw::table::IdFactory >  f)
inline

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

Definition at line 136 of file Peak.h.

void lsst::afw::table::BaseTable::setMetadata ( std::shared_ptr< daf::base::PropertyList > const &  metadata)
inlineinherited

Set the flexible metadata associated with the table. May be null.

Definition at line 65 of file BaseTable.h.

Friends And Related Function Documentation

friend class afw::table::io::FitsWriter
friend

Definition at line 195 of file Peak.h.

Member Data Documentation

int lsst::afw::table::BaseTable::nRecordsPerBlock
staticinherited

Number of records in each memory block.

Definition at line 59 of file BaseTable.h.


The documentation for this class was generated from the following files: