LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Types | Public Member Functions | Friends | List of all members
lsst::meas::modelfit::CModelAlgorithm Class Reference

Main public interface class for CModel algorithm. More...

#include <CModel.h>

Public Types

typedef CModelControl Control
 Typedef to the master Control struct. More...
 
typedef CModelResult Result
 Typedef to the master Result struct. More...
 

Public Member Functions

 CModelAlgorithm (std::string const &name, Control const &ctrl, afw::table::Schema &schema)
 Construct an algorithm instance and add its fields to the Schema. More...
 
 CModelAlgorithm (std::string const &name, Control const &ctrl, afw::table::SchemaMapper &schemaMapper)
 Construct an algorithm instance suitable for forced photometry and add its fields to the Schema. More...
 
 CModelAlgorithm (Control const &ctrl)
 Construct an algorithm instance that cannot use SourceRecords for input/output. More...
 
Control const & getControl () const
 Return the control object the algorithm was constructed with. More...
 
Result apply (afw::image::Exposure< Pixel > const &exposure, shapelet::MultiShapeletFunction const &psf, geom::Point2D const &center, afw::geom::ellipses::Quadrupole const &moments, Scalar approxFlux=-1, Scalar kronRadius=-1, int footprintArea=-1) const
 Run the CModel algorithm on an image, supplying inputs directly and returning outputs in a Result. More...
 
Result applyForced (afw::image::Exposure< Pixel > const &exposure, shapelet::MultiShapeletFunction const &psf, geom::Point2D const &center, Result const &reference, Scalar approxFlux=-1) const
 Run the CModel algorithm in forced mode on an image, supplying inputs directly and returning outputs in a Result. More...
 
void measure (afw::table::SourceRecord &measRecord, afw::image::Exposure< Pixel > const &exposure) const
 Run the CModel algorithm on an image, using a SourceRecord for inputs and outputs. More...
 
void measure (afw::table::SourceRecord &measRecord, afw::image::Exposure< Pixel > const &exposure, afw::table::SourceRecord const &refRecord) const
 Run the CModel algorithm in forced mode on an image, using a SourceRecord for inputs and outputs. More...
 
void fail (afw::table::SourceRecord &measRecord, meas::base::MeasurementError *error) const
 Handle an exception thrown by one of the measure() methods, setting the appropriate flag in the given record. More...
 
void writeResultToRecord (Result const &result, afw::table::BaseRecord &record) const
 Copy values from a Result struct to a BaseRecord object. More...
 

Friends

class CModelAlgorithmControl
 

Detailed Description

Main public interface class for CModel algorithm.

See CModel Magnitudes for a full description of the algorithm.

This class provides the methods that actually execute the algorithm, and (depending on how it is constructed) holds the Key objects necessary to use SourceRecords for input and output.

Definition at line 391 of file CModel.h.

Member Typedef Documentation

◆ Control

Typedef to the master Control struct.

Definition at line 394 of file CModel.h.

◆ Result

Typedef to the master Result struct.

Definition at line 395 of file CModel.h.

Constructor & Destructor Documentation

◆ CModelAlgorithm() [1/3]

lsst::meas::modelfit::CModelAlgorithm::CModelAlgorithm ( std::string const &  name,
Control const &  ctrl,
afw::table::Schema schema 
)

Construct an algorithm instance and add its fields to the Schema.

All fields needed to write the outputs of a regular, non-forced fit will be added to the given Schema. In addition, keys needed to retrieve the PSF shapelet approximation (assuming the ShapeletPsfApprox plugin has been run) will be extracted from the Schema.

Parameters
[in]nameName of the algorithm used as a prefix for all fields added to the Schema.
[in]ctrlControl object that configures the algorithm.
[in,out]schemaSchema to which fields will be added, and from which keys for the PSF shapelet approximation will be extacted.

◆ CModelAlgorithm() [2/3]

lsst::meas::modelfit::CModelAlgorithm::CModelAlgorithm ( std::string const &  name,
Control const &  ctrl,
afw::table::SchemaMapper schemaMapper 
)

Construct an algorithm instance suitable for forced photometry and add its fields to the Schema.

All fields needed to write the outputs of a forced fit will be added to the given SchemaMapper's output schema. Keys needed to retrieve the reference ellipses for the exp and dev fits will be extracted from the SchemaMapper's input schema. In addition, keys needed to retrieve the PSF shapelet approximation (assuming the ShapeletPsfApprox plugin has been run) will be extracted from the SchemaMapper's output schema (note that the ShapeletPsfApprox plugin must be run in forced mode as well, to approximate the measurement image's PSF rather than the reference image's PSF, so its outputs are found in the output schema, not the input schema).

Parameters
[in]nameName of the algorithm used as a prefix for all fields added to the Schema.
[in]ctrlControl object that configures the algorithm.
[in,out]schemaMapperSchemaMapper containing input (reference) and output schemas.

◆ CModelAlgorithm() [3/3]

lsst::meas::modelfit::CModelAlgorithm::CModelAlgorithm ( Control const &  ctrl)
explicit

Construct an algorithm instance that cannot use SourceRecords for input/output.

This constructor initializes the algorithm without initializing any of the keys necessary to operate on SourceRecords. As a result, only methods that take inputs directly and return Result objects may be called.

Member Function Documentation

◆ apply()

Result lsst::meas::modelfit::CModelAlgorithm::apply ( afw::image::Exposure< Pixel > const &  exposure,
shapelet::MultiShapeletFunction const &  psf,
geom::Point2D const &  center,
afw::geom::ellipses::Quadrupole const &  moments,
Scalar  approxFlux = -1,
Scalar  kronRadius = -1,
int  footprintArea = -1 
) const

Run the CModel algorithm on an image, supplying inputs directly and returning outputs in a Result.

Parameters
[in]exposureImage to measure. Must have a valid Psf, Wcs and PhotoCalib.
[in]psfmulti-shapelet approximation to the PSF at the position of the source
[in]centerCentroid of the source to be fit.
[in]momentsNon-PSF-corrected moments of the source, used to initialize the model parameters
[in]approxFluxRough estimate of the flux of the source, used to set the fit coordinate system and ensure internal parameters are of order unity. If less than or equal to zero, the sum of the flux within the footprint will be used.
[in]kronRadiusEstimate of the Kron radius (optional); used as the first choice when estimating the region of pixel to include in the fit.
[in]footprintAreaArea of the detection Fooptrint; used as the fallback when estimating the region of pixel to include in the fit.

◆ applyForced()

Result lsst::meas::modelfit::CModelAlgorithm::applyForced ( afw::image::Exposure< Pixel > const &  exposure,
shapelet::MultiShapeletFunction const &  psf,
geom::Point2D const &  center,
Result const &  reference,
Scalar  approxFlux = -1 
) const

Run the CModel algorithm in forced mode on an image, supplying inputs directly and returning outputs in a Result.

Parameters
[in]exposureImage to measure. Must have a valid Psf, Wcs and PhotoCalib.
[in]psfmulti-shapelet approximation to the PSF at the position of the source
[in]centerCentroid of the source to be fit.
[in]referenceResult object from a previous, non-forced run of CModelAlgorithm.
[in]approxFluxRough estimate of the flux of the source, used to set the fit coordinate system and ensure internal parameters are of order unity. If less than or equal to zero, the sum of the flux within the footprint will be used.

◆ fail()

void lsst::meas::modelfit::CModelAlgorithm::fail ( afw::table::SourceRecord measRecord,
meas::base::MeasurementError error 
) const

Handle an exception thrown by one of the measure() methods, setting the appropriate flag in the given record.

Parameters
[out]measRecordRecord on which the flag should be set.
[in]errorError containing the bit to be set. If null, only the general failure bit will be set.

◆ getControl()

Control const& lsst::meas::modelfit::CModelAlgorithm::getControl ( ) const
inline

Return the control object the algorithm was constructed with.

Definition at line 446 of file CModel.h.

446 { return _ctrl; }

◆ measure() [1/2]

void lsst::meas::modelfit::CModelAlgorithm::measure ( afw::table::SourceRecord measRecord,
afw::image::Exposure< Pixel > const &  exposure 
) const

Run the CModel algorithm on an image, using a SourceRecord for inputs and outputs.

Parameters
[in,out]measRecordA SourceRecord instance used to provide a Footprint, the centroid and shape of the source, a MultiShapeletFunction PSF, and an approximate estimate of the (via the PsfFlux slot), and to which all outputs will be written.
[in]exposureImage to be measured. Must have a valid Psf, Wcs, and PhotoCalib.

To run this method, the CModelAlgorithm instance must have been created using the constructor that takes a Schema argument, and that Schema must match the Schema of the SourceRecord passed here.

◆ measure() [2/2]

void lsst::meas::modelfit::CModelAlgorithm::measure ( afw::table::SourceRecord measRecord,
afw::image::Exposure< Pixel > const &  exposure,
afw::table::SourceRecord const &  refRecord 
) const

Run the CModel algorithm in forced mode on an image, using a SourceRecord for inputs and outputs.

Parameters
[in,out]measRecordA SourceRecord instance used to provide a Footprint, the centroid of the source, a MultiShapeletFunction PSF, and an approximate estimate of the (via the PsfFlux slot), and to which all outputs will be written.
[in]exposureImage to be measured. Must have a valid Psf, Wcs, and PhotoCalib.
[in]refRecordA SourceRecord that contains the outputs of a previous non-forced run of CModelAlgorithm (which may have taken place on an image with a different Wcs).

To run this method, the CModelAlgorithm instance must have been created using the constructor that takes a Schema argument, and that Schema must match the Schema of the SourceRecord passed here.

◆ writeResultToRecord()

void lsst::meas::modelfit::CModelAlgorithm::writeResultToRecord ( Result const &  result,
afw::table::BaseRecord record 
) const

Copy values from a Result struct to a BaseRecord object.

Friends And Related Function Documentation

◆ CModelAlgorithmControl

friend class CModelAlgorithmControl
friend

Definition at line 550 of file CModel.h.


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