LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+80768bd682,g04242d3e92+8eaa23c173,g06b2ea86fd+734f9505a2,g2079a07aa2+14824f138e,g212a7c68fe+5f4fc2ea00,g2305ad1205+293ab1327e,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+8eaa23c173,g487adcacf7+abec5a19c5,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+97ef3b4495,g5a732f18d5+66d966b544,g5d7b63bc56+636c3c3fd8,g64a986408d+80768bd682,g858d7b2824+80768bd682,g8a8a8dda67+a6fc98d2e7,g99cad8db69+6282a5f541,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+9e3c062e8e,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gba4ed39666+9664299f35,gbb8dafda3b+60f904e7bc,gc120e1dc64+1bf26d0180,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+8eaa23c173,gd2a12a3803+f8351bc914,gdaeeff99f8+a38ce5ea23,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+80768bd682,v24.1.5.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lsst::meas::base::FluxTransform Class Reference

Base for instFlux measurement transformations. More...

#include <FluxUtilities.h>

Inheritance diagram for lsst::meas::base::FluxTransform:
lsst::meas::base::BaseTransform lsst::meas::base::GaussianFluxTransform lsst::meas::base::LocalBackgroundTransform lsst::meas::base::PeakLikelihoodFluxTransform lsst::meas::base::PsfFluxTransform lsst::meas::base::ScaledApertureFluxTransform

Public Member Functions

 FluxTransform (std::string const &name, afw::table::SchemaMapper &mapper)
 
virtual void operator() (afw::table::SourceCatalog const &inputCatalog, afw::table::BaseCatalog &outputCatalog, afw::geom::SkyWcs const &wcs, afw::image::PhotoCalib const &photoCalib) const
 

Protected Member Functions

void checkCatalogSize (afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
 Ensure that catalogs have the same size.
 

Protected Attributes

std::string _name
 

Detailed Description

Base for instFlux measurement transformations.

Provides a basic transform from instFlux plus associated uncertainty to magnitude with uncertainty. The basic "flag" attribute for the measurement algorithm is propagated to the output

Subclasses should define a constructor which take a Control argument corresponding to the measurement algorithm being transformed and ensure that any other necessary flags are propagated.

Definition at line 187 of file FluxUtilities.h.

Constructor & Destructor Documentation

◆ FluxTransform()

lsst::meas::base::FluxTransform::FluxTransform ( std::string const & name,
afw::table::SchemaMapper & mapper )

Definition at line 79 of file FluxUtilities.cc.

80 : BaseTransform{name} {
81 // Map the flag through to the output
82 mapper.addMapping(mapper.getInputSchema().find<afw::table::Flag>(name + "_flag").key);
83
84 // Add keys for the magnitude and associated error
85 _magKey = MagResultKey::addFields(mapper.editOutputSchema(), name);
86}
SchemaMapper * mapper
static MagResultKey addFields(afw::table::Schema &schema, std::string const &name)
Add a pair of _mag, _magErr fields to a Schema, and return a MagResultKey that points to them.

Member Function Documentation

◆ checkCatalogSize()

void lsst::meas::base::BaseTransform::checkCatalogSize ( afw::table::BaseCatalog const & cat1,
afw::table::BaseCatalog const & cat2 ) const
inlineprotectedinherited

Ensure that catalogs have the same size.

Parameters
[in]cat1Catalog for comparison
[in]cat2Catalog for comparison
Exceptions
LengthErrorCatalog sizes do not match

Definition at line 102 of file Transform.h.

102 {
103 if (cat1.size() != cat2.size()) {
104 throw LSST_EXCEPT(pex::exceptions::LengthError, "Catalog size mismatch");
105 }
106 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48

◆ operator()()

void lsst::meas::base::FluxTransform::operator() ( afw::table::SourceCatalog const & inputCatalog,
afw::table::BaseCatalog & outputCatalog,
afw::geom::SkyWcs const & wcs,
afw::image::PhotoCalib const & photoCalib ) const
virtual

Implements lsst::meas::base::BaseTransform.

Definition at line 88 of file FluxUtilities.cc.

90 {
91 checkCatalogSize(inputCatalog, outputCatalog);
92 FluxResultKey instFluxKey(inputCatalog.getSchema()[_name]);
93 afw::table::SourceCatalog::const_iterator inSrc = inputCatalog.begin();
94 afw::table::BaseCatalog::iterator outSrc = outputCatalog.begin();
95 {
96 for (; inSrc != inputCatalog.end() && outSrc != outputCatalog.end(); ++inSrc, ++outSrc) {
97 FluxResult instFluxResult = instFluxKey.get(*inSrc);
98 _magKey.set(*outSrc,
99 photoCalib.instFluxToMagnitude(instFluxResult.instFlux, instFluxResult.instFluxErr));
100 }
101 }
102}
CatalogIterator< typename Internal::iterator > iterator
Definition Catalog.h:110
typename Base::const_iterator const_iterator
void checkCatalogSize(afw::table::BaseCatalog const &cat1, afw::table::BaseCatalog const &cat2) const
Ensure that catalogs have the same size.
Definition Transform.h:102
virtual void set(afw::table::BaseRecord &record, MagResult const &magResult) const
Set a MagResult in the given record.

Member Data Documentation

◆ _name

std::string lsst::meas::base::BaseTransform::_name
protectedinherited

Definition at line 107 of file Transform.h.


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