LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::meas::extensions::simpleShape::SimpleShapeResultKey Class Referenceabstract

#include <simpleShape.h>

Inheritance diagram for lsst::meas::extensions::simpleShape::SimpleShapeResultKey:
lsst::afw::table::FunctorKey< SimpleShapeResult > lsst::afw::table::OutputFunctorKey< T > lsst::afw::table::InputFunctorKey< T >

Public Types

using Value = SimpleShapeResult
 The data type for get and set. More...
 

Public Member Functions

 SimpleShapeResultKey ()
 
 SimpleShapeResultKey (lsst::afw::table::SubSchema const &s)
 Construct from a subschema, assuming _xx, _yy, etc. More...
 
virtual SimpleShapeResult get (afw::table::BaseRecord const &record) const
 
virtual void set (afw::table::BaseRecord &record, SimpleShapeResult const &value) const
 
bool operator== (SimpleShapeResultKey const &other) const
 Compare the FunctorKey for equality with another, using the underlying Keys. More...
 
bool operator!= (SimpleShapeResultKey const &other) const
 
bool isValid () const
 Return True if the key is valid. More...
 
lsst::meas::base::FlagHandler const & getFlagHandler () const
 
virtual void set (BaseRecord &record, T const &value) const =0
 

Static Public Member Functions

static SimpleShapeResultKey addFields (afw::table::Schema &schema, std::string const &name)
 

Detailed Description

Definition at line 52 of file simpleShape.h.

Member Typedef Documentation

◆ Value

The data type for get and set.

Definition at line 77 of file FunctorKey.h.

Constructor & Destructor Documentation

◆ SimpleShapeResultKey() [1/2]

lsst::meas::extensions::simpleShape::SimpleShapeResultKey::SimpleShapeResultKey ( )
inline

Definition at line 60 of file simpleShape.h.

60{}

◆ SimpleShapeResultKey() [2/2]

lsst::meas::extensions::simpleShape::SimpleShapeResultKey::SimpleShapeResultKey ( lsst::afw::table::SubSchema const &  s)

Construct from a subschema, assuming _xx, _yy, etc.

subfields

If a schema has "a_xx", "a_yy", etc. fields, this constructor allows you to construct a SimpleShapeResultKey via:

Definition at line 336 of file simpleShape.cc.

336 :
337 _shapeResult(s),
338 _centroidResult(s),
339 _uncertantyResult(s, std::vector<std::string> ({"Ixx", "Iyy", "Ixy", "Ix", "Iy"})),
340 _flagHandler(s, SimpleShape::getFlagDefinitions())
341{}
static base::FlagDefinitionList const & getFlagDefinitions()
Definition: simpleShape.cc:37

Member Function Documentation

◆ addFields()

SimpleShapeResultKey lsst::meas::extensions::simpleShape::SimpleShapeResultKey::addFields ( afw::table::Schema schema,
std::string const &  name 
)
static

Definition at line 319 of file simpleShape.cc.

322 {
325 name, "elliptical Gaussian moments");
327 name, "elliptical Gaussian moments", "pixel");
329 std::vector<std::string> ({"Ixx", "Iyy", "Ixy",
330 "Ix", "Iy"}), "pixel");
333 return r;
334}
static CovarianceMatrixKey addFields(Schema &schema, std::string const &prefix, NameArray const &names, std::string const &unit, bool diagonalOnly=false)
Add covariance matrix fields to a Schema, and return a CovarianceMatrixKey to manage them.
Definition: aggregates.cc:141
static PointKey addFields(Schema &schema, std::string const &name, std::string const &doc, std::string const &unit)
Add a pair of _x, _y fields to a Schema, and return a PointKey that points to them.
Definition: aggregates.cc:36
static QuadrupoleKey addFields(Schema &schema, std::string const &name, std::string const &doc, CoordinateType coordType=CoordinateType::PIXEL)
Add a set of quadrupole subfields to a schema and return a QuadrupoleKey that points to them.
Definition: aggregates.cc:100
static FlagHandler addFields(afw::table::Schema &schema, std::string const &prefix, FlagDefinitionList const &flagDefs, FlagDefinitionList const &exclDefs=FlagDefinitionList::getEmptyList())
Add Flag fields to a schema, creating a FlagHandler object to manage them.
Definition: FlagHandler.cc:37

◆ get()

SimpleShapeResult lsst::meas::extensions::simpleShape::SimpleShapeResultKey::get ( afw::table::BaseRecord const &  record) const
virtual

Implements lsst::afw::table::OutputFunctorKey< T >.

Definition at line 343 of file simpleShape.cc.

343 {
344 SimpleShapeResult result;
345 result.ellipse = record.get(_shapeResult);
346 result.center = record.get(_centroidResult);
347 result.covariance = record.get(_uncertantyResult);
348 for (std::size_t n = 0; n < SimpleShape::N_FLAGS; ++n) {
349 result.flags[n] = _flagHandler.getValue(record, n);
350 }
351 return result;
352}
py::object result
Definition: _schema.cc:429
bool getValue(afw::table::BaseRecord const &record, std::size_t i) const
Return the value of the flag field corresponding to the given flag index.
Definition: FlagHandler.h:242

◆ getFlagHandler()

lsst::meas::base::FlagHandler const & lsst::meas::extensions::simpleShape::SimpleShapeResultKey::getFlagHandler ( ) const
inline

Definition at line 85 of file simpleShape.h.

85{ return _flagHandler; }

◆ isValid()

bool lsst::meas::extensions::simpleShape::SimpleShapeResultKey::isValid ( ) const

Return True if the key is valid.

Definition at line 370 of file simpleShape.cc.

370 {
371 return _shapeResult.isValid() &&
372 _centroidResult.isValid() &&
373 _uncertantyResult.isValid();
374 //don't bother with flags - if we've gotten this far, it's basically impossible the flags don't match
375}
bool isValid() const noexcept
Return True if both the x and y Keys are valid.
Definition: aggregates.h:104
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
Definition: aggregates.h:342

◆ operator!=()

bool lsst::meas::extensions::simpleShape::SimpleShapeResultKey::operator!= ( SimpleShapeResultKey const &  other) const
inline

Definition at line 79 of file simpleShape.h.

79{ return !(*this == other); }

◆ operator==()

bool lsst::meas::extensions::simpleShape::SimpleShapeResultKey::operator== ( SimpleShapeResultKey const &  other) const

Compare the FunctorKey for equality with another, using the underlying Keys.

Definition at line 363 of file simpleShape.cc.

363 {
364 return _shapeResult == other._shapeResult &&
365 _centroidResult == other._centroidResult &&
366 _uncertantyResult == other._uncertantyResult;
367 //don't bother with flags - if we've gotten this far, it's basically impossible the flags don't match
368}

◆ set() [1/2]

void lsst::meas::extensions::simpleShape::SimpleShapeResultKey::set ( afw::table::BaseRecord record,
SimpleShapeResult const &  value 
) const
virtual

Definition at line 354 of file simpleShape.cc.

354 {
355 record.set(_shapeResult, value.ellipse);
356 record.set(_centroidResult, value.center);
357 record.set(_uncertantyResult, value.covariance);
358 for (std::size_t n = 0; n < SimpleShape::N_FLAGS; ++n) {
359 _flagHandler.setValue(record, n, value.flags[n]);
360 }
361}
void setValue(afw::table::BaseRecord &record, std::size_t i, bool value) const
Set the flag field corresponding to the given flag index.
Definition: FlagHandler.h:262

◆ set() [2/2]

template<typename T >
virtual void lsst::afw::table::InputFunctorKey< T >::set ( BaseRecord record,
T const &  value 
) const
pure virtualinherited

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