lsst.meas.algorithms  13.0-24-g22030a45+14
Namespaces | Classes | Typedefs | Functions
lsst::meas::algorithms Namespace Reference

Fit spatial kernel using approximate fluxes for candidates, and solving a linear system of equations. More...

Namespaces

 astrometrySourceSelector
 
 coaddPsf
 
 debugger
 
 defects
 
 detection
 
 findCosmicRaysConfig
 
 flaggedStarSelector
 
 gaussianPsfFactory
 
 htmIndexer
 
 indexerRegistry
 
 ingestIndexReferenceTask
 
 installGaussianPsf
 
 interp
 
 loadIndexedReferenceObjects
 
 loadReferenceObjects
 
 makeCoaddApCorrMap
 
 matcherSourceSelector
 
 measureApCorr
 
 measureSourceUtils
 
 objectSizeStarSelector
 
 pcaPsfDeterminer
 
 psfCandidate
 
 psfDeterminer
 
 psfSelectionFromMatchList
 
 readFitsCatalogTask
 
 readTextCatalogTask
 
 secondMomentStarSelector
 
 sourceSelector
 
 starSelector
 
 subtractBackground
 
 testUtils
 
 utils
 
 version
 

Classes

class  BinnedWcs
 
class  CoaddBoundedField
 
struct  CoaddBoundedFieldElement
 Struct used to hold one Exposure's data in a CoaddBoundedField. More...
 
class  CoaddPsf
 CoaddPsf is the Psf derived to be used for non-PSF-matched Coadd images. More...
 
class  CoaddPsfControl
 
class  Defect
 Encapsulate information about a bad portion of a detector. More...
 
class  DoubleGaussianPsf
 Represent a Psf as a circularly symmetrical double Gaussian. More...
 
class  evalChi2Visitor
 A class to pass around to all our PsfCandidates to evaluate the PSF fit's X^2. More...
 
class  ExposurePatch
 A convenience container for the exposure, peak and footprint that will be measured. More...
 
class  ImagePsf
 An intermediate base class for Psfs that use an image representation. More...
 
class  KernelPsf
 A Psf defined by a Kernel. More...
 
class  KernelPsfFactory
 A PersistableFactory for KernelPsf and its subclasses. More...
 
struct  KernelPsfPersistenceHelper
 A read-only singleton struct containing the schema and key used in persistence for KernelPsf. More...
 
class  MinimizeChi2
 
class  NotImplementedException
 An exception that indicates the feature has not been implemented. More...
 
class  PcaPsf
 Represent a PSF as a linear combination of PCA (== Karhunen-Loeve) basis functions. More...
 
class  PsfAttributes
 A class to contain various attributes of the Psf. More...
 
class  PsfCandidate
 Class stored in SpatialCells for spatial Psf fitting. More...
 
class  PsfImagePca
 
class  SingleGaussianPsf
 Represent a PSF as a circularly symmetrical Gaussian. More...
 
class  WarpedPsf
 A Psf class that maps an arbitrary Psf through a coordinate transformation. More...
 

Typedefs

typedef std::vector< Defect::Ptr >::const_iterator DefectCIter
 

Functions

template<typename MaskedImageT >
std::vector< std::shared_ptr< lsst::afw::detection::Footprint > > findCosmicRays (MaskedImageT &image, lsst::afw::detection::Psf const &psf, double const bkgd, lsst::pex::policy::Policy const &policy, bool const keep=false)
 Find cosmic rays in an Image, and mask and remove them. More...
 
template<typename ExposureT >
boost::shared_ptr< ExposurePatch< ExposureT > > makeExposurePatch (boost::shared_ptr< ExposureT const > exp, boost::shared_ptr< afw::detection::Footprint const > foot, afw::geom::Point2D const &center)
 Factory function for ExposurePatch. More...
 
template<typename ExposureT >
boost::shared_ptr< ExposurePatch< ExposureT > > makeExposurePatch (boost::shared_ptr< ExposureT const > exp, afw::detection::Footprint const &standardFoot, afw::geom::Point2D const &standardCenter, afw::image::Wcs const &standardWcs)
 
template<typename MaskedImageT >
void interpolateOverDefects (MaskedImageT &mimage, lsst::afw::detection::Psf const &, std::vector< Defect::Ptr > &_badList, double fallbackValue, bool useFallbackValueAtEdge)
 Process a set of known bad pixels in an image. More...
 
template<typename PixelT >
std::shared_ptr< PsfCandidate< PixelT > > makePsfCandidate (boost::shared_ptr< afw::table::SourceRecord > const &source, boost::shared_ptr< afw::image::Exposure< PixelT > > image)
 Return a PsfCandidate of the right sort. More...
 
template<typename PixelT >
std::pair< std::shared_ptr< lsst::afw::math::LinearCombinationKernel >, std::vector< double > > createKernelFromPsfCandidates (lsst::afw::math::SpatialCellSet const &psfCells, lsst::afw::geom::Extent2I const &dims, lsst::afw::geom::Point2I const &xy0, int const nEigenComponents, int const spatialOrder, int const ksize, int const nStarPerCell=-1, bool const constantWeight=true, int const border=3)
 Return a Kernel pointer and a list of eigenvalues resulting from analysing the provided SpatialCellSet. More...
 
template<typename PixelT >
int countPsfCandidates (afwMath::SpatialCellSet const &psfCells, int const nStarPerCell)
 Count the number of candidates in use. More...
 
template<typename PixelT >
std::pair< bool, double > fitSpatialKernelFromPsfCandidates (afwMath::Kernel *kernel, afwMath::SpatialCellSet const &psfCells, int const nStarPerCell, double const tolerance, double const lambda)
 Fit spatial kernel using full-nonlinear optimization to estimate candidate amplitudes. More...
 
template<typename PixelT >
std::pair< bool, double > fitSpatialKernelFromPsfCandidates (lsst::afw::math::Kernel *kernel, lsst::afw::math::SpatialCellSet const &psfCells, bool const doNonLinearFit, int const nStarPerCell=-1, double const tolerance=1e-5, double const lambda=0.0)
 
template<typename ImageT >
double subtractPsf (lsst::afw::detection::Psf const &psf, ImageT *data, double x, double y, double psfFlux=std::numeric_limits< double >::quiet_NaN())
 
template<typename Image >
std::pair< std::vector< double >, lsst::afw::math::KernelListfitKernelParamsToImage (lsst::afw::math::LinearCombinationKernel const &kernel, Image const &image, lsst::afw::geom::Point2D const &pos)
 Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary. More...
 
template<typename Image >
std::pair< std::shared_ptr< lsst::afw::math::Kernel >, std::pair< double, double > > fitKernelToImage (lsst::afw::math::LinearCombinationKernel const &kernel, Image const &image, lsst::afw::geom::Point2D const &pos)
 Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary. More...
 
afw::geom::Box2I getOverallBBox (std::vector< boost::shared_ptr< afw::image::Image< double > >> const &imgVector)
 
void addToImage (boost::shared_ptr< afw::image::Image< double > > image, std::vector< boost::shared_ptr< afw::image::Image< double > >> const &imgVector, std::vector< double > const &weightVector)
 
template<typename MaskedImageT >
std::vector< std::shared_ptr< detection::Footprint > > findCosmicRays (MaskedImageT &mimage, detection::Psf const &psf, double const bkgd, lsst::pex::policy::Policy const &policy, bool const keep)
 Find cosmic rays in an Image, and mask and remove them. More...
 
template<typename PixelT >
std::pair< std::shared_ptr< afwMath::LinearCombinationKernel >, std::vector< double > > createKernelFromPsfCandidates (afwMath::SpatialCellSet const &psfCells, lsst::afw::geom::Extent2I const &dims, lsst::afw::geom::Point2I const &xy0, int const nEigenComponents, int const spatialOrder, int const ksize, int const nStarPerCell, bool const constantWeight, int const border)
 Return a Kernel pointer and a list of eigenvalues resulting from analysing the provided SpatialCellSet. More...
 
void setSpatialParameters (afwMath::Kernel *kernel, std::vector< double > const &coeffs)
 Fit a Kernel's spatial variability from a set of stars. More...
 
void setSpatialParameters (afwMath::Kernel *kernel, Eigen::VectorXd const &vec)
 Fit a Kernel's spatial variability from a set of stars. More...
 
template<typename MaskedImageT >
double subtractPsf (afwDetection::Psf const &psf, MaskedImageT *data, double x, double y, double psfFlux)
 Subtract a PSF from an image at a given position. More...
 
template<typename Image >
std::pair< std::vector< double >, afwMath::KernelListfitKernelParamsToImage (afwMath::LinearCombinationKernel const &kernel, Image const &image, afwGeom::Point2D const &pos)
 Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary. More...
 
template<typename Image >
std::pair< std::shared_ptr< afwMath::Kernel >, std::pair< double, double > > fitKernelToImage (afwMath::LinearCombinationKernel const &kernel, Image const &image, afwGeom::Point2D const &pos)
 Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary. More...
 

Detailed Description

Fit spatial kernel using approximate fluxes for candidates, and solving a linear system of equations.

Typedef Documentation

◆ DefectCIter

Definition at line 52 of file Interp.cc.

Function Documentation

◆ addToImage()

void lsst::meas::algorithms::addToImage ( boost::shared_ptr< afw::image::Image< double > >  image,
std::vector< boost::shared_ptr< afw::image::Image< double > >> const &  imgVector,
std::vector< double > const &  weightVector 
)

Definition at line 202 of file CoaddPsf.cc.

◆ countPsfCandidates()

template<typename PixelT >
int lsst::meas::algorithms::countPsfCandidates ( lsst::afw::math::SpatialCellSet const &  psfCells,
int const  nStarPerCell = -1 
)

Count the number of candidates in use.

Definition at line 352 of file SpatialModelPsf.cc.

◆ createKernelFromPsfCandidates() [1/2]

template<typename PixelT >
std::pair<std::shared_ptr<lsst::afw::math::LinearCombinationKernel>, std::vector<double> > lsst::meas::algorithms::createKernelFromPsfCandidates ( afwMath::SpatialCellSet const &  psfCells,
lsst::afw::geom::Extent2I const &  dims,
lsst::afw::geom::Point2I const &  xy0,
int const  nEigenComponents,
int const  spatialOrder,
int const  ksize,
int const  nStarPerCell,
bool const  constantWeight,
int const  border 
)

Return a Kernel pointer and a list of eigenvalues resulting from analysing the provided SpatialCellSet.

The Kernel is a LinearCombinationKernel of the first nEigenComponents eigenImages

N.b. This is templated over the Pixel type of the science image

Parameters
psfCellsA SpatialCellSet containing PsfCandidates
dimsDimensions of image
xy0Origin of image
nEigenComponentsnumber of eigen components to keep; <= 0 => infty
spatialOrderOrder of spatial variation (cf. afw::math::PolynomialFunction2)
ksizeSize of generated Kernel images
nStarPerCellmax no. of stars per cell; <= 0 => infty
constantWeightshould each star have equal weight in the fit?
borderBorder size for background subtraction

Definition at line 206 of file SpatialModelPsf.cc.

◆ createKernelFromPsfCandidates() [2/2]

template<typename PixelT >
std::pair<std::shared_ptr<afwMath::LinearCombinationKernel>, std::vector<double> > lsst::meas::algorithms::createKernelFromPsfCandidates ( afwMath::SpatialCellSet const &  psfCells,
lsst::afw::geom::Extent2I const &  dims,
lsst::afw::geom::Point2I const &  xy0,
int const  nEigenComponents,
int const  spatialOrder,
int const  ksize,
int const  nStarPerCell,
bool const  constantWeight,
int const  border 
)

Return a Kernel pointer and a list of eigenvalues resulting from analysing the provided SpatialCellSet.

The Kernel is a LinearCombinationKernel of the first nEigenComponents eigenImages

N.b. This is templated over the Pixel type of the science image

Parameters
psfCellsA SpatialCellSet containing PsfCandidates
dimsDimensions of image
xy0Origin of image
nEigenComponentsnumber of eigen components to keep; <= 0 => infty
spatialOrderOrder of spatial variation (cf. afw::math::PolynomialFunction2)
ksizeSize of generated Kernel images
nStarPerCellmax no. of stars per cell; <= 0 => infty
constantWeightshould each star have equal weight in the fit?
borderBorder size for background subtraction

Definition at line 206 of file SpatialModelPsf.cc.

◆ findCosmicRays() [1/2]

template<typename MaskedImageT >
std::vector<std::shared_ptr<lsst::afw::detection::Footprint> > lsst::meas::algorithms::findCosmicRays ( MaskedImageT &  mimage,
detection::Psf const &  psf,
double const  bkgd,
lsst::pex::policy::Policy const &  policy,
bool const  keep 
)

Find cosmic rays in an Image, and mask and remove them.

Returns
vector of CR's Footprints

In this loop, we look for strings of CRpixels on the same row and adjoining columns; each of these becomes a Span with a unique ID.

Parameters
mimageImage to search
psfthe Image's PSF
bkgdunsubtracted background of frame, DN
policyPolicy directing the behavior
keepif true, don't remove the CRs

Definition at line 344 of file CR.cc.

◆ findCosmicRays() [2/2]

template<typename MaskedImageT >
std::vector<std::shared_ptr<detection::Footprint> > lsst::meas::algorithms::findCosmicRays ( MaskedImageT &  mimage,
detection::Psf const &  psf,
double const  bkgd,
lsst::pex::policy::Policy const &  policy,
bool const  keep 
)

Find cosmic rays in an Image, and mask and remove them.

Returns
vector of CR's Footprints

In this loop, we look for strings of CRpixels on the same row and adjoining columns; each of these becomes a Span with a unique ID.

Parameters
mimageImage to search
psfthe Image's PSF
bkgdunsubtracted background of frame, DN
policyPolicy directing the behavior
keepif true, don't remove the CRs

Definition at line 344 of file CR.cc.

◆ fitKernelParamsToImage() [1/2]

template<typename Image >
std::pair<std::vector<double>, lsst::afw::math::KernelList> lsst::meas::algorithms::fitKernelParamsToImage ( afwMath::LinearCombinationKernel const &  kernel,
Image const &  image,
afwGeom::Point2D const &  pos 
)

Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary.

Returns
std::pair(coefficients, std::pair(kernels, center amplitude))
Parameters
kernelthe Kernel to fit
imagethe image to be fit
posthe position of the object

Definition at line 1071 of file SpatialModelPsf.cc.

◆ fitKernelParamsToImage() [2/2]

template<typename Image >
std::pair<std::vector<double>, afwMath::KernelList> lsst::meas::algorithms::fitKernelParamsToImage ( afwMath::LinearCombinationKernel const &  kernel,
Image const &  image,
afwGeom::Point2D const &  pos 
)

Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary.

Returns
std::pair(coefficients, std::pair(kernels, center amplitude))
Parameters
kernelthe Kernel to fit
imagethe image to be fit
posthe position of the object

Definition at line 1071 of file SpatialModelPsf.cc.

◆ fitKernelToImage() [1/2]

template<typename Image >
std::pair<std::shared_ptr<lsst::afw::math::Kernel>, std::pair<double, double> > lsst::meas::algorithms::fitKernelToImage ( afwMath::LinearCombinationKernel const &  kernel,
Image const &  image,
afwGeom::Point2D const &  pos 
)

Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary.

Returns
std::pair(best-fit kernel, std::pair(amp, chi^2))
Parameters
kernelthe Kernel to fit
imagethe image to be fit
posthe position of the object

Definition at line 1143 of file SpatialModelPsf.cc.

◆ fitKernelToImage() [2/2]

template<typename Image >
std::pair<std::shared_ptr<afwMath::Kernel>, std::pair<double, double> > lsst::meas::algorithms::fitKernelToImage ( afwMath::LinearCombinationKernel const &  kernel,
Image const &  image,
afwGeom::Point2D const &  pos 
)

Fit a LinearCombinationKernel to an Image, allowing the coefficients of the components to vary.

Returns
std::pair(best-fit kernel, std::pair(amp, chi^2))
Parameters
kernelthe Kernel to fit
imagethe image to be fit
posthe position of the object

Definition at line 1143 of file SpatialModelPsf.cc.

◆ fitSpatialKernelFromPsfCandidates() [1/2]

template<typename PixelT >
std::pair< bool, double > lsst::meas::algorithms::fitSpatialKernelFromPsfCandidates ( lsst::afw::math::Kernel kernel,
lsst::afw::math::SpatialCellSet const &  psfCells,
int const  nStarPerCell = -1,
double const  tolerance = 1e-5,
double const  lambda = 0.0 
)

Fit spatial kernel using full-nonlinear optimization to estimate candidate amplitudes.

Parameters
kernelthe Kernel to fit
psfCellsA SpatialCellSet containing PsfCandidates
nStarPerCellmax no. of stars per cell; <= 0 => infty
toleranceTolerance; how close chi^2 should be to true minimum
lambdafloor for variance is lambda*data

Definition at line 621 of file SpatialModelPsf.cc.

◆ fitSpatialKernelFromPsfCandidates() [2/2]

template<typename PixelT >
std::pair< bool, double > lsst::meas::algorithms::fitSpatialKernelFromPsfCandidates ( lsst::afw::math::Kernel kernel,
lsst::afw::math::SpatialCellSet const &  psfCells,
bool const  doNonLinearFit,
int const  nStarPerCell = -1,
double const  tolerance = 1e-5,
double const  lambda = 0.0 
)
Parameters
kernelthe Kernel to fit
psfCellsA SpatialCellSet containing PsfCandidates
doNonLinearFitUse the full-up nonlinear fitter
nStarPerCellmax no. of stars per cell; <= 0 => infty
toleranceTolerance; how close chi^2 should be to true minimum
lambdafloor for variance is lambda*data

Definition at line 909 of file SpatialModelPsf.cc.

◆ getOverallBBox()

afw::geom::Box2I lsst::meas::algorithms::getOverallBBox ( std::vector< boost::shared_ptr< afw::image::Image< double > >> const &  imgVector)

Definition at line 187 of file CoaddPsf.cc.

◆ interpolateOverDefects()

template<typename MaskedImageT >
void lsst::meas::algorithms::interpolateOverDefects ( MaskedImageT &  mimage,
lsst::afw::detection::Psf const &  psf,
std::vector< Defect::Ptr > &  _badList,
double  fallbackValue = 0.0,
bool  useFallbackValueAtEdge = false 
)

Process a set of known bad pixels in an image.

Parameters
mimageImage to patch
psfthe Image's PSF
_badListList of Defects to patch
fallbackValueValue to fallback to if all else fails
useFallbackValueAtEdgeUse the fallback value at the image's edge?

Definition at line 2057 of file Interp.cc.

◆ makeExposurePatch() [1/2]

template<typename ExposureT >
boost::shared_ptr< ExposurePatch<ExposureT> > lsst::meas::algorithms::makeExposurePatch ( boost::shared_ptr< ExposureT const >  exp,
boost::shared_ptr< afw::detection::Footprint const >  foot,
afw::geom::Point2D const &  center 
)

Factory function for ExposurePatch.

Definition at line 86 of file ExposurePatch.h.

◆ makeExposurePatch() [2/2]

template<typename ExposureT >
boost::shared_ptr< ExposurePatch<ExposureT> > lsst::meas::algorithms::makeExposurePatch ( boost::shared_ptr< ExposureT const >  exp,
afw::detection::Footprint const &  standardFoot,
afw::geom::Point2D const &  standardCenter,
afw::image::Wcs const &  standardWcs 
)

Definition at line 94 of file ExposurePatch.h.

◆ makePsfCandidate()

template<typename PixelT >
std::shared_ptr<PsfCandidate<PixelT> > lsst::meas::algorithms::makePsfCandidate ( boost::shared_ptr< afw::table::SourceRecord > const &  source,
boost::shared_ptr< afw::image::Exposure< PixelT > >  image 
)

Return a PsfCandidate of the right sort.

Cf. std::make_pair

Parameters
sourceThe detected Source
imageThe image wherein lies the object

Definition at line 182 of file PsfCandidate.h.

◆ setSpatialParameters() [1/2]

void lsst::meas::algorithms::setSpatialParameters ( afwMath::Kernel kernel,
std::vector< double > const &  coeffs 
)

Fit a Kernel's spatial variability from a set of stars.

Definition at line 520 of file SpatialModelPsf.cc.

◆ setSpatialParameters() [2/2]

void lsst::meas::algorithms::setSpatialParameters ( afwMath::Kernel kernel,
Eigen::VectorXd const &  vec 
)

Fit a Kernel's spatial variability from a set of stars.

Definition at line 544 of file SpatialModelPsf.cc.

◆ subtractPsf() [1/2]

template<typename ImageT >
double lsst::meas::algorithms::subtractPsf ( lsst::afw::detection::Psf const &  psf,
ImageT *  data,
double  x,
double  y,
double  psfFlux = std::numeric_limits< double >::quiet_NaN() 
)

◆ subtractPsf() [2/2]

template<typename MaskedImageT >
double lsst::meas::algorithms::subtractPsf ( afwDetection::Psf const &  psf,
MaskedImageT *  data,
double  x,
double  y,
double  psfFlux 
)

Subtract a PSF from an image at a given position.

Parameters
psfthe PSF to subtract
dataImage to subtract PSF from
xcolumn position
yrow position
psfFluxobject's PSF flux (if not NaN)

Definition at line 1009 of file SpatialModelPsf.cc.