LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
lsst::meas::base::MagResultKey Class Reference

A FunctorKey for MagResult. More...

#include <FluxUtilities.h>

Inheritance diagram for lsst::meas::base::MagResultKey:
lsst::afw::table::FunctorKey< MagResult > lsst::afw::table::OutputFunctorKey< MagResult > lsst::afw::table::InputFunctorKey< MagResult >

Public Member Functions

 MagResultKey ()
 Default constructor; instance will not be usuable unless subsequently assigned to. More...
 
 MagResultKey (afw::table::SubSchema const &s)
 Construct from a subschema, assuming mag and magErr subfields. More...
 
virtual MagResult get (afw::table::BaseRecord const &record) const
 Get a MagResult from the given record. More...
 
virtual void set (afw::table::BaseRecord &record, MagResult const &magResult) const
 Set a MagResult in the given record. More...
 
virtual void set (afw::table::BaseRecord &record, std::pair< double, double > const &magPair) const
 Set a MagResult in the record given the result of afw::image::Calib::getMagnitude(double, double). More...
 
- Public Member Functions inherited from lsst::afw::table::OutputFunctorKey< MagResult >
virtual ~OutputFunctorKey ()
 
- Public Member Functions inherited from lsst::afw::table::InputFunctorKey< MagResult >
virtual void set (BaseRecord &record, MagResultconst &value) const =0
 
virtual ~InputFunctorKey ()
 

Static Public Member Functions

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

Private Attributes

afw::table::Key< Mag_magKey
 
afw::table::Key< MagErrElement_magErrKey
 

Detailed Description

A FunctorKey for MagResult.

This class makes it easy to copy magnitudes and their uncertainties to and from records, and provides a method to add the appropriate fields to a Schema.

Definition at line 139 of file FluxUtilities.h.

Constructor & Destructor Documentation

lsst::meas::base::MagResultKey::MagResultKey ( )
inline

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

Definition at line 154 of file FluxUtilities.h.

154 : _magKey(), _magErrKey() {}
afw::table::Key< Mag > _magKey
afw::table::Key< MagErrElement > _magErrKey
lsst::meas::base::MagResultKey::MagResultKey ( afw::table::SubSchema const &  s)
inline

Construct from a subschema, assuming mag and magErr subfields.

If a schema has "a_mag" and "a_magErr" fields, this enables construction of a MagResultKey via:

* MagResultKey k(schema["a"]);
*

Definition at line 164 of file FluxUtilities.h.

164 : _magKey(s["mag"]), _magErrKey(s["magErr"]) {}
afw::table::Key< Mag > _magKey
afw::table::Key< MagErrElement > _magErrKey

Member Function Documentation

MagResultKey lsst::meas::base::MagResultKey::addFields ( afw::table::Schema schema,
std::string const &  name 
)
static

Add a pair of _mag, _magErr fields to a Schema, and return a MagResultKey that points to them.

Parameters
[in,out]schemaSchema to add fields to.
[in]nameName prefix for all fields; "_mag", "_magErr" will be appended to this to form the full field names.

Definition at line 59 of file FluxUtilities.cc.

62  {
63  MagResultKey result;
64  result._magKey = schema.addField<Mag>(schema.join(name, "mag"), "Magnitude");
65  result._magErrKey = schema.addField<MagErrElement>(schema.join(name, "magErr"), "Error on magnitude");
66  return result;
67 }
table::Key< std::string > name
Definition: ApCorrMap.cc:71
afw::table::Schema schema
Definition: GaussianPsf.cc:41
double MagErrElement
Definition: constants.h:52
MagResultKey()
Default constructor; instance will not be usuable unless subsequently assigned to.
MagResult lsst::meas::base::MagResultKey::get ( afw::table::BaseRecord const &  record) const
virtual

Get a MagResult from the given record.

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

Definition at line 69 of file FluxUtilities.cc.

69  {
70  MagResult result = {record.get(_magKey), record.get(_magErrKey)};
71  return result;
72 }
afw::table::Key< Mag > _magKey
afw::table::Key< MagErrElement > _magErrKey
void lsst::meas::base::MagResultKey::set ( afw::table::BaseRecord record,
MagResult const &  magResult 
) const
virtual

Set a MagResult in the given record.

Definition at line 74 of file FluxUtilities.cc.

74  {
75  record.set(_magKey, magResult.mag);
76  record.set(_magErrKey, magResult.magErr);
77 }
afw::table::Key< Mag > _magKey
afw::table::Key< MagErrElement > _magErrKey
void lsst::meas::base::MagResultKey::set ( afw::table::BaseRecord record,
std::pair< double, double > const &  magPair 
) const
virtual

Set a MagResult in the record given the result of afw::image::Calib::getMagnitude(double, double).

Definition at line 79 of file FluxUtilities.cc.

79  {
80  record.set(_magKey, magResult.first);
81  record.set(_magErrKey, magResult.second);
82 }
afw::table::Key< Mag > _magKey
afw::table::Key< MagErrElement > _magErrKey

Member Data Documentation

afw::table::Key<MagErrElement> lsst::meas::base::MagResultKey::_magErrKey
private

Definition at line 177 of file FluxUtilities.h.

afw::table::Key<Mag> lsst::meas::base::MagResultKey::_magKey
private

Definition at line 176 of file FluxUtilities.h.


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