LSSTApplications  19.0.0-10-g920eed2,19.0.0-11-g48a0200+2,19.0.0-18-gfc4e62b+11,19.0.0-2-g3b2f90d+2,19.0.0-2-gd671419+5,19.0.0-20-g5a5a17ab+9,19.0.0-21-g2644856+11,19.0.0-22-gc5dc5b1+6,19.0.0-23-gdc29a50+3,19.0.0-24-g923e380+11,19.0.0-25-g6c8df7140,19.0.0-28-g9b887e2,19.0.0-3-g2b32d65+5,19.0.0-3-g8227491+10,19.0.0-3-g9c54d0d+10,19.0.0-3-gca68e65+6,19.0.0-3-gcfc5f51+5,19.0.0-3-ge110943+9,19.0.0-3-ge74d124,19.0.0-3-gfe04aa6+11,19.0.0-4-g06f5963+5,19.0.0-4-g3d16501+11,19.0.0-4-g4a9c019+5,19.0.0-4-g5a8b323,19.0.0-4-g66397f0+1,19.0.0-4-g8278b9b+1,19.0.0-4-g8557e14,19.0.0-4-g8964aba+11,19.0.0-4-ge404a01+10,19.0.0-5-g40f3a5a,19.0.0-5-g4db63b3,19.0.0-5-gfb03ce7+11,19.0.0-6-gbaebbfb+10,19.0.0-60-gafafd468+11,19.0.0-67-g3ab1e6e,19.0.0-7-g039c0b5+9,19.0.0-7-gbea9075+4,19.0.0-7-gc567de5+11,19.0.0-8-g3a3ce09+6,19.0.0-9-g463f923+10,w.2020.21
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::shapelet::ShapeletFunctionKey Class Referenceabstract

Class that maps ShapeletFunction objects to fields in afw::table objects. More...

#include <FunctorKeys.h>

Inheritance diagram for lsst::shapelet::ShapeletFunctionKey:
lsst::afw::table::FunctorKey< ShapeletFunction > lsst::afw::table::OutputFunctorKey< ShapeletFunction > lsst::afw::table::InputFunctorKey< ShapeletFunction >

Public Types

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

Public Member Functions

 ShapeletFunctionKey ()
 Default constructor; instance will not be usuable unless subsequently assigned to. More...
 
 ShapeletFunctionKey (afw::table::EllipseKey const &ellipse, afw::table::ArrayKey< double > const &coefficients, BasisTypeEnum basisType=HERMITE)
 Construct from individual Keys/FunctorKeys. More...
 
 ShapeletFunctionKey (afw::table::SubSchema const &s, BasisTypeEnum basisType=HERMITE)
 Construct from a subschema, assuming the necesary subfields. More...
 
virtual ShapeletFunction get (afw::table::BaseRecord const &record) const
 Get a ShapeletFunction from the given record. More...
 
virtual void set (afw::table::BaseRecord &record, ShapeletFunction const &value) const
 Set a ShapeletFunction in the given record. More...
 
bool operator== (ShapeletFunctionKey const &other) const
 Compare the FunctorKey for equality with another, using the underlying Ixx, Iyy, Ixy Keys. More...
 
bool operator!= (ShapeletFunctionKey const &other) const
 
bool isValid () const
 Return True if all the constituent Keys are valid. More...
 
afw::table::EllipseKey const & getEllipse () const
 Return a FunctorKey that extracts just the Ellipse. More...
 
afw::table::ArrayKey< double > const & getCoefficients () const
 Return a FunctorKey that extracts just the coefficients. More...
 
int getOrder () const
 Return the shapelet order. More...
 
BasisTypeEnum getBasisType () const
 Return the type of the shapelet basis. More...
 
virtual void set (BaseRecord &record, ShapeletFunction const &value) const=0
 

Static Public Member Functions

static ShapeletFunctionKey addFields (afw::table::Schema &schema, std::string const &name, std::string const &doc, std::string const &ellipseUnit, std::string const &coeffUnit, int order, BasisTypeEnum basisType=HERMITE)
 Add the necessary fields for saving a ShapeletFunction to a Schema. More...
 

Detailed Description

Class that maps ShapeletFunction objects to fields in afw::table objects.

A ShapeletFunctionKey manages a set of fields with a common prefix and the following suffixes:

As with all FunctorKeys, a ShapeletFunctorKey can be used to directly get or set objects on an afw::table::BaseRecord, just as with a true Key.

Definition at line 45 of file FunctorKeys.h.

Member Typedef Documentation

◆ Value

The data type for get and set.

Definition at line 77 of file FunctorKey.h.

Constructor & Destructor Documentation

◆ ShapeletFunctionKey() [1/3]

lsst::shapelet::ShapeletFunctionKey::ShapeletFunctionKey ( )
inline

Default constructor; instance will not be usuable unless subsequently assigned to.

Definition at line 74 of file FunctorKeys.h.

74 : _ellipseKey(), _coefficientsKey(), _order(-1), _basisType(HERMITE) {}

◆ ShapeletFunctionKey() [2/3]

lsst::shapelet::ShapeletFunctionKey::ShapeletFunctionKey ( afw::table::EllipseKey const &  ellipse,
afw::table::ArrayKey< double > const &  coefficients,
BasisTypeEnum  basisType = HERMITE 
)
inline

Construct from individual Keys/FunctorKeys.

Definition at line 77 of file FunctorKeys.h.

81  :
82  _ellipseKey(ellipse),
83  _coefficientsKey(coefficients),
84  _order(computeOrder(coefficients.getSize())),
85  _basisType(basisType)
86  {}

◆ ShapeletFunctionKey() [3/3]

lsst::shapelet::ShapeletFunctionKey::ShapeletFunctionKey ( afw::table::SubSchema const &  s,
BasisTypeEnum  basisType = HERMITE 
)
inline

Construct from a subschema, assuming the necesary subfields.

If a schema has e.g. "a_xx", "a_0", etc. fields, this constructor allows you to construct a ShapeletFunctionKey via:

Definition at line 97 of file FunctorKeys.h.

97  :
98  _ellipseKey(s), _coefficientsKey(s),
99  _order(computeOrder(_coefficientsKey.getSize())),
100  _basisType(basisType)
101  {}

Member Function Documentation

◆ addFields()

static ShapeletFunctionKey lsst::shapelet::ShapeletFunctionKey::addFields ( afw::table::Schema schema,
std::string const &  name,
std::string const &  doc,
std::string const &  ellipseUnit,
std::string const &  coeffUnit,
int  order,
BasisTypeEnum  basisType = HERMITE 
)
static

Add the necessary fields for saving a ShapeletFunction to a Schema.

Parameters
[in,out]schemaSchema to add fields to.
[in]nameName prefix for all fields.
[in]docString used as the documentation for the fields.
[in]ellipseUnitString used as the unit for the ellipse ("<ellipseUnit>^2" will be used for the Quadrupole moments).
[in]coeffUnitString used as the unit for the coefficient vector
[in]orderOrder of the ShapeletFunction to be saved.
[in]basisTypeType of shapelet basis (HERMITE or LAGUERRE) to be saved.

This method provides only basic exception safety - the schema may be (partially) modified even if an exception is thrown.

◆ get()

virtual ShapeletFunction lsst::shapelet::ShapeletFunctionKey::get ( afw::table::BaseRecord const &  record) const
virtual

◆ getBasisType()

BasisTypeEnum lsst::shapelet::ShapeletFunctionKey::getBasisType ( ) const
inline

Return the type of the shapelet basis.

Definition at line 131 of file FunctorKeys.h.

131 { return _basisType; }

◆ getCoefficients()

afw::table::ArrayKey<double> const& lsst::shapelet::ShapeletFunctionKey::getCoefficients ( ) const
inline

Return a FunctorKey that extracts just the coefficients.

Definition at line 125 of file FunctorKeys.h.

125 { return _coefficientsKey; }

◆ getEllipse()

afw::table::EllipseKey const& lsst::shapelet::ShapeletFunctionKey::getEllipse ( ) const
inline

Return a FunctorKey that extracts just the Ellipse.

Definition at line 122 of file FunctorKeys.h.

122 { return _ellipseKey; }

◆ getOrder()

int lsst::shapelet::ShapeletFunctionKey::getOrder ( ) const
inline

Return the shapelet order.

Definition at line 128 of file FunctorKeys.h.

128 { return _order; }

◆ isValid()

bool lsst::shapelet::ShapeletFunctionKey::isValid ( ) const
inline

Return True if all the constituent Keys are valid.

Definition at line 119 of file FunctorKeys.h.

119 { return _ellipseKey.isValid() && _coefficientsKey.isValid(); }

◆ operator!=()

bool lsst::shapelet::ShapeletFunctionKey::operator!= ( ShapeletFunctionKey const &  other) const
inline

Definition at line 115 of file FunctorKeys.h.

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

◆ operator==()

bool lsst::shapelet::ShapeletFunctionKey::operator== ( ShapeletFunctionKey const &  other) const
inline

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

Definition at line 111 of file FunctorKeys.h.

111  {
112  return _order == other._order && _ellipseKey == other._ellipseKey
113  && _coefficientsKey == other._coefficientsKey;
114  }

◆ set() [1/2]

virtual void lsst::shapelet::ShapeletFunctionKey::set ( afw::table::BaseRecord record,
ShapeletFunction const &  value 
) const
virtual

Set a ShapeletFunction in the given record.

◆ set() [2/2]

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

The documentation for this class was generated from the following file:
schema
table::Schema schema
Definition: Amplifier.cc:115
lsst::shapelet::computeOrder
int computeOrder(int size)
Infer the order of a shapelet expansion from the number of coefficients.
Definition: constants.h:104
coefficients
ndarray::Array< double const, 2, 2 > coefficients
Definition: ChebyshevBoundedField.cc:276
lsst::afw::table::EllipseKey::isValid
bool isValid() const noexcept
Return True if all the constituent Keys are valid.
Definition: aggregates.h:418
lsst::shapelet::HERMITE
@ HERMITE
Cartesian shapelets or Gauss-Hermite functions, as defined in Refregier, 2003.
Definition: constants.h:53
other
ItemVariant const * other
Definition: Schema.cc:56
lsst::afw::table::ArrayKey::getSize
int getSize() const noexcept
Return the number of elements in the array.
Definition: arrays.h:108
lsst::shapelet::ShapeletFunctionKey::ShapeletFunctionKey
ShapeletFunctionKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
Definition: FunctorKeys.h:74
lsst::afw::table::ArrayKey::isValid
bool isValid() const noexcept
Return True if the FunctorKey contains valid scalar keys.
Definition: arrays.h:137