LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
LSSTDataManagementBasePackage
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< SimpleShapeResult > lsst::afw::table::InputFunctorKey< SimpleShapeResult >

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, SimpleShapeResult 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 {}

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 }

◆ get()

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

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

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 }

◆ 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 }

◆ 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 }

◆ set() [2/2]

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

The documentation for this class was generated from the following files:
schema
table::Schema schema
Definition: Amplifier.cc:115
lsst::afw::table::PointKey< double >::addFields
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
std::vector< std::string >
lsst::meas::base::FlagHandler::getValue
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
lsst::meas::extensions::simpleShape::SimpleShapeResultKey::SimpleShapeResultKey
SimpleShapeResultKey()
Definition: simpleShape.h:60
lsst::afw::table::CovarianceMatrixKey::isValid
bool isValid() const noexcept
Return True if all the constituent error Keys are valid.
Definition: aggregates.cc:294
lsst::afw::table::PointKey::isValid
bool isValid() const noexcept
Return True if both the x and y Keys are valid.
Definition: aggregates.h:104
lsst::meas::base::FlagHandler::setValue
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
lsst::meas::extensions::simpleShape::SimpleShape::N_FLAGS
static unsigned int const N_FLAGS
Definition: simpleShape.h:100
lsst::afw::table::QuadrupoleKey::addFields
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
other
ItemVariant const * other
Definition: Schema.cc:56
result
py::object result
Definition: _schema.cc:429
lsst::afw::table::CovarianceMatrixKey::addFields
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
lsst::meas::extensions::simpleShape.name
name
Definition: __init__.py:8
std::size_t
lsst::meas::extensions::simpleShape::SimpleShape::getFlagDefinitions
static base::FlagDefinitionList const & getFlagDefinitions()
Definition: simpleShape.cc:37
lsst::meas::base::FlagHandler::addFields
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
lsst::afw::table::QuadrupoleKey::isValid
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
Definition: aggregates.h:342