File SimplePhotometryModel.h

namespace lsst

Class for a simple mapping implementing a generic AstrometryTransform.

Remove all non-astronomical counts from the Chunk Exposure’s pixels.

Forward declarations for lsst::utils::Cache

For details on the Cache class, see the Cache.h file.

It uses a template rather than a pointer so that the derived classes can use the specifics of the transform. The class simplePolyMapping overloads a few routines.

A base class for image defects

Numeric constants used by the Integrate.h integrator routines.

Compute Image Statistics

Note

Gauss-Kronrod-Patterson quadrature coefficients for use in quadpack routine qng. These coefficients were calculated with 101 decimal digit arithmetic by L. W. Fullerton, Bell Labs, Nov 1981.

Note

The Statistics class itself can only handle lsst::afw::image::MaskedImage() types. The philosophy has been to handle other types by making them look like lsst::afw::image::MaskedImage() and reusing that code. Users should have no need to instantiate a Statistics object directly, but should use the overloaded makeStatistics() factory functions.

namespace jointcal
class SimpleFluxModel : public lsst::jointcal::SimplePhotometryModel

Public Functions

SimpleFluxModel(CcdImageList const &ccdImageList, double errorPedestal_ = 0)
void offsetFittedStar(FittedStar &fittedStar, double delta) const

Offset the appropriate flux or magnitude (by -delta).

Parameters
  • fittedStar: The star to update.

  • delta: The amount to update by.

double computeResidual(CcdImage const &ccdImage, MeasuredStar const &measuredStar) const

Compute the residual between the model applied to a star and its associated fittedStar.

\[ residual = Model(measuredStar) - fittedStar \]

Return

The residual.

Parameters
  • ccdImage: The ccdImage where measuredStar resides.

  • measuredStar: The measured star position to compute the residual of.

double transform(CcdImage const &ccdImage, MeasuredStar const &measuredStar) const

Return the on-sky transformed flux for measuredStar on ccdImage.

Return

The on-sky flux transformed from instFlux at measuredStar’s position.

Parameters
  • [in] ccdImage: The ccdImage where measuredStar resides.

  • measuredStar: The measured star position to transform.

double transformError(CcdImage const &ccdImage, MeasuredStar const &measuredStar) const

Return the on-sky transformed flux uncertainty for measuredStar on ccdImage. Identical to transform() until freezeErrorTransform() is called.

Return

The on-sky flux transformed from instFlux at measuredStar’s position.

Parameters
  • [in] ccdImage: The ccdImage where measuredStar resides.

  • measuredStar: The measured star position to transform.

double getRefError(RefStar const &refStar) const

Return the refStar error appropriate for this model (e.g. fluxErr or magErr).

double computeRefResidual(FittedStar const &fittedStar, RefStar const &refStar) const

Return the fittedStar - refStar residual appropriate for this model (e.g. flux - flux or mag - mag).

std::shared_ptr<afw::image::PhotoCalib> toPhotoCalib(CcdImage const &ccdImage) const

Return the mapping of ccdImage represented as a PhotoCalib.

Note

SimplePhotometryModel uses a spatially-invariant transform, so we can simplify the PhotoCalib.

class SimpleMagnitudeModel : public lsst::jointcal::SimplePhotometryModel

Public Functions

SimpleMagnitudeModel(CcdImageList const &ccdImageList, double errorPedestal_ = 0)
void offsetFittedStar(FittedStar &fittedStar, double delta) const

Offset the appropriate flux or magnitude (by -delta).

Parameters
  • fittedStar: The star to update.

  • delta: The amount to update by.

double computeResidual(CcdImage const &ccdImage, MeasuredStar const &measuredStar) const

Compute the residual between the model applied to a star and its associated fittedStar.

\[ residual = Model(measuredStar) - fittedStar \]

Return

The residual.

Parameters
  • ccdImage: The ccdImage where measuredStar resides.

  • measuredStar: The measured star position to compute the residual of.

double transform(CcdImage const &ccdImage, MeasuredStar const &measuredStar) const

Return the on-sky transformed flux for measuredStar on ccdImage.

Return

The on-sky flux transformed from instFlux at measuredStar’s position.

Parameters
  • [in] ccdImage: The ccdImage where measuredStar resides.

  • measuredStar: The measured star position to transform.

double transformError(CcdImage const &ccdImage, MeasuredStar const &measuredStar) const

Return the on-sky transformed flux uncertainty for measuredStar on ccdImage. Identical to transform() until freezeErrorTransform() is called.

Return

The on-sky flux transformed from instFlux at measuredStar’s position.

Parameters
  • [in] ccdImage: The ccdImage where measuredStar resides.

  • measuredStar: The measured star position to transform.

double getRefError(RefStar const &refStar) const

Return the refStar error appropriate for this model (e.g. fluxErr or magErr).

double computeRefResidual(FittedStar const &fittedStar, RefStar const &refStar) const

Return the fittedStar - refStar residual appropriate for this model (e.g. flux - flux or mag - mag).

std::shared_ptr<afw::image::PhotoCalib> toPhotoCalib(CcdImage const &ccdImage) const

Return the mapping of ccdImage represented as a PhotoCalib.

Note

SimplePhotometryModel uses a spatially-invariant transform, so we can simplify the PhotoCalib.

class SimplePhotometryModel : public lsst::jointcal::PhotometryModel
#include <SimplePhotometryModel.h>

Photometric response model which has a single photometric factor per CcdImage.

Subclassed by lsst::jointcal::SimpleFluxModel, lsst::jointcal::SimpleMagnitudeModel

Public Functions

SimplePhotometryModel(CcdImageList const &ccdImageList, LOG_LOGGER log, double errorPedestal_ = 0)
SimplePhotometryModel(SimplePhotometryModel const&)

No copy or move: there is only ever one instance of a given model.

SimplePhotometryModel(SimplePhotometryModel&&)
SimplePhotometryModel &operator=(SimplePhotometryModel const&)
SimplePhotometryModel &operator=(SimplePhotometryModel&&)
Eigen::Index assignIndices(std::string const &whatToFit, Eigen::Index firstIndex)

Assign indices in the full matrix to the parameters being fit in the mappings, starting at firstIndex.

Return

The highest assigned index.

Parameters
  • [in] whatToFit: String containing parameters to fit.

  • [in] firstIndex: Index to start assigning at.

void offsetParams(Eigen::VectorXd const &delta)

Offset the parameters by the provided amounts (by -delta).

The shifts are applied according to the indices given in assignIndices.

Parameters
  • [in] delta: vector of offsets to apply

void freezeErrorTransform()

Once this routine has been called, the error transform is not modified by offsetParams().

The routine can be called when the mappings are roughly in place. After the call, the transformations used to propagate errors are no longer affected when updating the mappings. This allows an exactly linear fit, which can be necessary for some model+data combinations.

void getMappingIndices(CcdImage const &ccdImage, IndexVector &indices) const

Get how this set of parameters (of length Npar()) map into the “grand” fit.

Parameters
  • [in] ccdImage: The ccdImage to look up.

  • [out] indices: The indices of the mapping associated with ccdImage.

std::size_t getTotalParameters() const

Return the total number of parameters in this model.

void computeParameterDerivatives(MeasuredStar const &measuredStar, CcdImage const &ccdImage, Eigen::VectorXd &derivatives) const

Compute the parametric derivatives of this model.

Parameters
  • [in] measuredStar: The measured star with the position and flux to compute at.

  • [in] ccdImage: The ccdImage containing the measured star, to find the correct mapping.

  • [out] derivatives: The computed derivatives. Must be pre-allocated to the correct size.

void dump(std::ostream &stream = std::cout) const

Dump the contents of the transforms, for debugging.

Protected Types

typedef std::unordered_map<CcdImageKey, std::unique_ptr<PhotometryMapping>> MapType

Protected Functions

PhotometryMappingBase *findMapping(CcdImage const &ccdImage) const

Return the mapping associated with this ccdImage.

Protected Attributes

MapType _myMap