LSSTApplications  19.0.0-10-g4a5fae6+3,19.0.0-10-g920eed2,19.0.0-11-g48a0200+2,19.0.0-18-gfc4e62b+16,19.0.0-2-g3b2f90d+2,19.0.0-2-gd671419+6,19.0.0-20-g5a5a17ab+14,19.0.0-21-g2644856+17,19.0.0-24-g0913cb1,19.0.0-24-g878c510+4,19.0.0-25-g6c8df7140+1,19.0.0-25-gb330496+4,19.0.0-3-g2b32d65+6,19.0.0-3-g8227491+15,19.0.0-3-g9c54d0d+15,19.0.0-3-gca68e65+11,19.0.0-3-gcfc5f51+6,19.0.0-3-ge110943+14,19.0.0-3-ge74d124,19.0.0-30-g9c3fd16+5,19.0.0-4-g06f5963+6,19.0.0-4-g10df615,19.0.0-4-g3d16501+17,19.0.0-4-g4a9c019+6,19.0.0-4-g5a8b323,19.0.0-4-g66397f0+1,19.0.0-4-g8557e14,19.0.0-4-g8964aba+16,19.0.0-4-ge404a01+15,19.0.0-5-g40f3a5a,19.0.0-5-g4db63b3,19.0.0-5-gb9eeb60,19.0.0-5-gfb03ce7+16,19.0.0-6-gbaebbfb+15,19.0.0-61-gec4c6e08+5,19.0.0-7-g039c0b5+15,19.0.0-7-gbea9075+4,19.0.0-7-gc567de5+16,19.0.0-72-g37abf38+2,19.0.0-9-g463f923+15,v20.0.0.rc1
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
lsst::afw::detection::PeakRecord Class Reference

Record class that represents a peak in a Footprint. More...

#include <Peak.h>

Inheritance diagram for lsst::afw::detection::PeakRecord:
lsst::afw::table::BaseRecord

Public Types

typedef PeakTable Table
 
typedef afw::table::ColumnViewT< PeakRecordColumnView
 
typedef afw::table::CatalogT< PeakRecordCatalog
 
typedef afw::table::CatalogT< PeakRecord const > ConstCatalog
 

Public Member Functions

 PeakRecord (ConstructionToken const &token, table::detail::RecordData &&data)
 Constructor used by PeakTable. More...
 
 ~PeakRecord () override=default
 
 PeakRecord (PeakRecord const &)=delete
 
 PeakRecord (PeakRecord &&)=delete
 
PeakRecordoperator= (PeakRecord const &)=delete
 
PeakRecordoperator= (PeakRecord &&)=delete
 
std::shared_ptr< PeakTable const > getTable () const
 
afw::table::RecordId getId () const
 Convenience accessors for the keys in the minimal schema. More...
 
void setId (afw::table::RecordId id)
 
int getIx () const
 
int getIy () const
 
void setIx (int ix)
 
void setIy (int iy)
 
lsst::geom::Point2I getI () const
 
lsst::geom::Point2I getCentroid (bool) const
 
float getFx () const
 
float getFy () const
 
void setFx (float fx)
 
void setFy (float fy)
 
lsst::geom::Point2D getF () const
 
lsst::geom::Point2D getCentroid () const
 
float getPeakValue () const
 
void setPeakValue (float peakValue)
 
Schema getSchema () const
 Return the Schema that holds this record's fields and keys. More...
 
template<typename T >
Field< T >::Element * getElement (Key< T > const &key)
 Return a pointer to the underlying elements of a field (non-const). More...
 
template<typename T >
Field< T >::Element const * getElement (Key< T > const &key) const
 Return a pointer to the underlying elements of a field (const). More...
 
template<typename T >
Field< T >::Reference operator[] (Key< T > const &key)
 Return a reference (or reference-like type) to the field's value. More...
 
template<typename T >
Field< T >::ConstReference operator[] (Key< T > const &key) const
 Return a const reference (or const-reference-like type) to the field's value. More...
 
template<typename Ref >
Ref operator[] (ReferenceFunctorKey< Ref > const &key)
 
template<typename ConstRef >
ConstRef operator[] (ConstReferenceFunctorKey< ConstRef > const &key) const
 
template<typename T >
Field< T >::Value get (Key< T > const &key) const
 Return the value of a field for the given key. More...
 
template<typename T >
get (OutputFunctorKey< T > const &key) const
 Compute a calculated or aggregate field. More...
 
template<typename T , typename U >
void set (Key< T > const &key, U const &value)
 Set value of a field for the given key. More...
 
template<typename T , typename U >
void set (InputFunctorKey< T > const &key, U const &value)
 Set a calculated or aggregate field. More...
 
void assign (BaseRecord const &other)
 Copy all field values from other to this, requiring that they have equal schemas. More...
 
void assign (BaseRecord const &other, SchemaMapper const &mapper)
 Copy field values from other to this, using a mapper. More...
 
ndarray::Manager::Ptr getManager () const
 

Protected Member Functions

virtual void _assign (BaseRecord const &other)
 Called by assign() after transferring fields to allow subclass data members to be copied. More...
 
virtual void _stream (std::ostream &os) const
 Called by operator<<. More...
 

Friends

class PeakTable
 

Detailed Description

Record class that represents a peak in a Footprint.

Definition at line 42 of file Peak.h.

Member Typedef Documentation

◆ Catalog

Definition at line 46 of file Peak.h.

◆ ColumnView

Definition at line 45 of file Peak.h.

◆ ConstCatalog

Definition at line 47 of file Peak.h.

◆ Table

Definition at line 44 of file Peak.h.

Constructor & Destructor Documentation

◆ PeakRecord() [1/3]

lsst::afw::detection::PeakRecord::PeakRecord ( ConstructionToken const &  token,
table::detail::RecordData &&  data 
)
inline

Constructor used by PeakTable.

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.

Definition at line 58 of file Peak.h.

58  :
59  BaseRecord(token, std::move(data))
60  {}

◆ ~PeakRecord()

lsst::afw::detection::PeakRecord::~PeakRecord ( )
overridedefault

◆ PeakRecord() [2/3]

lsst::afw::detection::PeakRecord::PeakRecord ( PeakRecord const &  )
delete

◆ PeakRecord() [3/3]

lsst::afw::detection::PeakRecord::PeakRecord ( PeakRecord &&  )
delete

Member Function Documentation

◆ _assign()

virtual void lsst::afw::table::BaseRecord::_assign ( BaseRecord const &  other)
inlineprotectedvirtualinherited

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

Reimplemented in lsst::afw::table::ExposureRecord, and lsst::afw::table::SourceRecord.

Definition at line 209 of file BaseRecord.h.

209 {}

◆ _stream()

void lsst::afw::table::BaseRecord::_stream ( std::ostream os) const
protectedvirtualinherited

Called by operator<<.

Overrides should call the base class implementation and append additional fields on new lines, with the syntax "%(name)s: %(value)s".

Definition at line 153 of file BaseRecord.cc.

153  {
154  getSchema().forEach([&os, this](auto const& item) {
155  os << item.field.getName() << ": " << this->get(item.key) << std::endl;
156  });
157 }

◆ assign() [1/2]

void lsst::afw::table::BaseRecord::assign ( BaseRecord const &  other)
inherited

Copy all field values from other to this, requiring that they have equal schemas.

Definition at line 123 of file BaseRecord.cc.

123  {
124  if (this->getSchema() != other.getSchema()) {
125  throw LSST_EXCEPT(lsst::pex::exceptions::LogicError, "Unequal schemas in record assignment.");
126  }
127  this->getSchema().forEach(CopyValue(&other, this));
128  this->_assign(other); // let derived classes assign their own stuff
129 }

◆ assign() [2/2]

void lsst::afw::table::BaseRecord::assign ( BaseRecord const &  other,
SchemaMapper const &  mapper 
)
inherited

Copy field values from other to this, using a mapper.

Definition at line 131 of file BaseRecord.cc.

131  {
132  if (!other.getSchema().contains(mapper.getInputSchema())) {
134  "Unequal schemas between input record and mapper.");
135  }
136  if (!this->getSchema().contains(mapper.getOutputSchema())) {
138  "Unequal schemas between output record and mapper.");
139  }
140  mapper.forEach(CopyValue(&other, this)); // use the functor we defined above
141  this->_assign(other); // let derived classes assign their own stuff
142 }

◆ get() [1/2]

template<typename T >
Field<T>::Value lsst::afw::table::BaseRecord::get ( Key< T > const &  key) const
inlineinherited

Return the value of a field for the given key.

No checking is done to ensure the Key belongs to the correct schema.

Definition at line 151 of file BaseRecord.h.

151  {
152  return key.getValue(getElement(key), _manager);
153  }

◆ get() [2/2]

template<typename T >
T lsst::afw::table::BaseRecord::get ( OutputFunctorKey< T > const &  key) const
inlineinherited

Compute a calculated or aggregate field.

Definition at line 172 of file BaseRecord.h.

172  {
173  return key.get(*this);
174  }

◆ getCentroid() [1/2]

lsst::geom::Point2D lsst::afw::detection::PeakRecord::getCentroid ( ) const
inline

Definition at line 89 of file Peak.h.

89 { return getF(); }

◆ getCentroid() [2/2]

lsst::geom::Point2I lsst::afw::detection::PeakRecord::getCentroid ( bool  ) const
inline

Definition at line 82 of file Peak.h.

82 { return getI(); }

◆ getElement() [1/2]

template<typename T >
Field<T>::Element* lsst::afw::table::BaseRecord::getElement ( Key< T > const &  key)
inlineinherited

Return a pointer to the underlying elements of a field (non-const).

This low-level access is intended mostly for use with serialization; users should generally prefer the safer get(), set() and operator[] member functions.

Definition at line 93 of file BaseRecord.h.

93  {
94  if (!key.isValid()) {
95  throw LSST_EXCEPT(
96  pex::exceptions::LogicError,
97  "Key is not valid (if this is a SourceRecord, make sure slot aliases have been set up).");
98  }
99  return reinterpret_cast<typename Field<T>::Element*>(reinterpret_cast<char*>(_data) +
100  key.getOffset());
101  }

◆ getElement() [2/2]

template<typename T >
Field<T>::Element const* lsst::afw::table::BaseRecord::getElement ( Key< T > const &  key) const
inlineinherited

Return a pointer to the underlying elements of a field (const).

This low-level access is intended mostly for use with serialization; users should generally prefer the safer get(), set() and operator[] member functions.

Definition at line 111 of file BaseRecord.h.

111  {
112  if (!key.isValid()) {
113  throw LSST_EXCEPT(
114  pex::exceptions::LogicError,
115  "Key is not valid (if this is a SourceRecord, make sure slot aliases have been set up).");
116  }
117  return reinterpret_cast<typename Field<T>::Element const*>(reinterpret_cast<char const*>(_data) +
118  key.getOffset());
119  }

◆ getF()

lsst::geom::Point2D lsst::afw::detection::PeakRecord::getF ( ) const
inline

Definition at line 88 of file Peak.h.

88 { return lsst::geom::Point2D(getFx(), getFy()); }

◆ getFx()

float lsst::afw::detection::PeakRecord::getFx ( ) const
inline

Definition at line 235 of file Peak.h.

235 { return get(PeakTable::getFxKey()); }

◆ getFy()

float lsst::afw::detection::PeakRecord::getFy ( ) const
inline

Definition at line 236 of file Peak.h.

236 { return get(PeakTable::getFyKey()); }

◆ getI()

lsst::geom::Point2I lsst::afw::detection::PeakRecord::getI ( ) const
inline

Definition at line 81 of file Peak.h.

81 { return lsst::geom::Point2I(getIx(), getIy()); }

◆ getId()

afw::table::RecordId lsst::afw::detection::PeakRecord::getId ( ) const
inline

Convenience accessors for the keys in the minimal schema.

Definition at line 227 of file Peak.h.

227 { return get(PeakTable::getIdKey()); }

◆ getIx()

int lsst::afw::detection::PeakRecord::getIx ( ) const
inline

Definition at line 230 of file Peak.h.

230 { return get(PeakTable::getIxKey()); }

◆ getIy()

int lsst::afw::detection::PeakRecord::getIy ( ) const
inline

Definition at line 231 of file Peak.h.

231 { return get(PeakTable::getIyKey()); }

◆ getManager()

ndarray::Manager::Ptr lsst::afw::table::BaseRecord::getManager ( ) const
inlineinherited

Definition at line 200 of file BaseRecord.h.

200 { return _manager; }

◆ getPeakValue()

float lsst::afw::detection::PeakRecord::getPeakValue ( ) const
inline

Definition at line 240 of file Peak.h.

240 { return get(PeakTable::getPeakValueKey()); }

◆ getSchema()

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

Return the Schema that holds this record's fields and keys.

Definition at line 80 of file BaseRecord.h.

80 { return _table->getSchema(); }

◆ getTable()

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

Definition at line 68 of file Peak.h.

68  {
69  return std::static_pointer_cast<PeakTable const>(afw::table::BaseRecord::getTable());
70  }

◆ operator=() [1/2]

PeakRecord& lsst::afw::detection::PeakRecord::operator= ( PeakRecord &&  )
delete

◆ operator=() [2/2]

PeakRecord& lsst::afw::detection::PeakRecord::operator= ( PeakRecord const &  )
delete

◆ operator[]() [1/4]

template<typename ConstRef >
ConstRef lsst::afw::table::BaseRecord::operator[] ( ConstReferenceFunctorKey< ConstRef > const &  key) const
inlineinherited

Definition at line 190 of file BaseRecord.h.

190  {
191  return key.getConstReference(*this);
192  }

◆ operator[]() [2/4]

template<typename T >
Field<T>::Reference lsst::afw::table::BaseRecord::operator[] ( Key< T > const &  key)
inlineinherited

Return a reference (or reference-like type) to the field's value.

Some field types (Point, Moments, Flag, Covariance, and SpherePoint) do not support reference access.

No checking is done to ensure the Key belongs to the correct schema.

Definition at line 129 of file BaseRecord.h.

129  {
130  return key.getReference(getElement(key), _manager);
131  }

◆ operator[]() [3/4]

template<typename T >
Field<T>::ConstReference lsst::afw::table::BaseRecord::operator[] ( Key< T > const &  key) const
inlineinherited

Return a const reference (or const-reference-like type) to the field's value.

Some field types (Point, Moments, Flag, Covariance, and SpherePoint) do not support reference access.

No checking is done to ensure the Key belongs to the correct schema.

Definition at line 141 of file BaseRecord.h.

141  {
142  return key.getConstReference(getElement(key), _manager);
143  }

◆ operator[]() [4/4]

template<typename Ref >
Ref lsst::afw::table::BaseRecord::operator[] ( ReferenceFunctorKey< Ref > const &  key)
inlineinherited

Definition at line 185 of file BaseRecord.h.

185  {
186  return key.getReference(*this);
187  }

◆ set() [1/2]

template<typename T , typename U >
void lsst::afw::table::BaseRecord::set ( InputFunctorKey< T > const &  key,
U const &  value 
)
inlineinherited

Set a calculated or aggregate field.

Definition at line 180 of file BaseRecord.h.

180  {
181  return key.set(*this, value);
182  }

◆ set() [2/2]

template<typename T , typename U >
void lsst::afw::table::BaseRecord::set ( Key< T > const &  key,
U const &  value 
)
inlineinherited

Set value of a field for the given key.

This method has an additional template parameter because some fields accept and convert different types to the stored field type.

No checking is done to ensure the Key belongs to the correct schema.

Definition at line 164 of file BaseRecord.h.

164  {
165  key.setValue(getElement(key), _manager, value);
166  }

◆ setFx()

void lsst::afw::detection::PeakRecord::setFx ( float  fx)
inline

Definition at line 237 of file Peak.h.

237 { set(PeakTable::getFxKey(), fx); }

◆ setFy()

void lsst::afw::detection::PeakRecord::setFy ( float  fy)
inline

Definition at line 238 of file Peak.h.

238 { set(PeakTable::getFyKey(), fy); }

◆ setId()

void lsst::afw::detection::PeakRecord::setId ( afw::table::RecordId  id)
inline

Definition at line 228 of file Peak.h.

228 { set(PeakTable::getIdKey(), id); }

◆ setIx()

void lsst::afw::detection::PeakRecord::setIx ( int  ix)
inline

Definition at line 232 of file Peak.h.

232 { set(PeakTable::getIxKey(), ix); }

◆ setIy()

void lsst::afw::detection::PeakRecord::setIy ( int  iy)
inline

Definition at line 233 of file Peak.h.

233 { set(PeakTable::getIyKey(), iy); }

◆ setPeakValue()

void lsst::afw::detection::PeakRecord::setPeakValue ( float  peakValue)
inline

Definition at line 241 of file Peak.h.

241 { set(PeakTable::getPeakValueKey(), peakValue); }

Friends And Related Function Documentation

◆ PeakTable

friend class PeakTable
friend

Definition at line 96 of file Peak.h.


The documentation for this class was generated from the following file:
std::move
T move(T... args)
lsst::afw::table::BaseRecord::get
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
Definition: BaseRecord.h:151
lsst::afw::detection::PeakTable::getFyKey
static afw::table::Key< float > getFyKey()
Definition: Peak.h:168
lsst::afw::detection::PeakTable::getIyKey
static afw::table::Key< int > getIyKey()
Definition: Peak.h:166
lsst::afw::detection::PeakRecord::getIy
int getIy() const
Definition: Peak.h:231
lsst::geom::Point2D
Point< double, 2 > Point2D
Definition: Point.h:324
lsst::afw::table::BaseRecord::getElement
Field< T >::Element * getElement(Key< T > const &key)
Return a pointer to the underlying elements of a field (non-const).
Definition: BaseRecord.h:93
lsst::afw::table::Schema::forEach
void forEach(F &&func) const
Apply a functor to each SchemaItem in the Schema.
Definition: Schema.h:212
data
char * data
Definition: BaseRecord.cc:62
lsst::afw::table::BaseRecord::_assign
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied.
Definition: BaseRecord.h:209
lsst::afw::detection::PeakTable::getIxKey
static afw::table::Key< int > getIxKey()
Definition: Peak.h:165
lsst::afw::table::BaseRecord::BaseRecord
BaseRecord(ConstructionToken const &, detail::RecordData &&data)
Construct a record with uninitialized data.
Definition: BaseRecord.cc:144
lsst::afw::detection::PeakRecord::getI
lsst::geom::Point2I getI() const
Definition: Peak.h:81
lsst::afw::detection::PeakTable::getFxKey
static afw::table::Key< float > getFxKey()
Definition: Peak.h:167
astshim.fitsChanContinued.contains
def contains(self, name)
Definition: fitsChanContinued.py:127
other
ItemVariant const * other
Definition: Schema.cc:56
lsst::pex::exceptions::LogicError
Reports errors in the logical structure of the program.
Definition: Runtime.h:46
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::afw::detection::PeakRecord::getFx
float getFx() const
Definition: Peak.h:235
os
std::ostream * os
Definition: Schema.cc:746
std::endl
T endl(T... args)
lsst::afw::detection::PeakRecord::getF
lsst::geom::Point2D getF() const
Definition: Peak.h:88
lsst::afw::detection::PeakTable::getIdKey
static afw::table::Key< afw::table::RecordId > getIdKey()
Get keys for standard fields shared by all peaks.
Definition: Peak.h:164
key
Key< U > key
Definition: Schema.cc:281
lsst::geom::Point2I
Point< int, 2 > Point2I
Definition: Point.h:321
mapper
SchemaMapper * mapper
Definition: SchemaMapper.cc:78
lsst::afw::detection::PeakRecord::getIx
int getIx() const
Definition: Peak.h:230
lsst::afw::table::BaseRecord::getTable
std::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
Definition: BaseRecord.h:83
lsst::afw::table::BaseRecord::getSchema
Schema getSchema() const
Return the Schema that holds this record's fields and keys.
Definition: BaseRecord.h:80
lsst::afw::table::Field::Element
FieldBase< T >::Element Element
Type used to store field data in the table (a field may have multiple elements).
Definition: Field.h:26
lsst::afw::table::BaseRecord::set
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
Definition: BaseRecord.h:164
lsst::afw::detection::PeakTable::getPeakValueKey
static afw::table::Key< float > getPeakValueKey()
Definition: Peak.h:169
lsst::afw::detection::PeakRecord::getFy
float getFy() const
Definition: Peak.h:236