LSST Applications 24.1.5,g02d81e74bb+fa3a7a026e,g180d380827+a53a32eff8,g2079a07aa2+86d27d4dc4,g2305ad1205+c0501b3732,g295015adf3+7d3e92f0ec,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+5dd1654d75,g48712c4677+3bf1020dcb,g487adcacf7+065c13d9cf,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+d7ac436cfb,g5a732f18d5+53520f316c,g64a986408d+fa3a7a026e,g858d7b2824+fa3a7a026e,g8a8a8dda67+585e252eca,g99cad8db69+a5a909b84f,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+4cf350ccb2,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+f991a0b59f,gc120e1dc64+9ccbfdb8be,gc28159a63d+0e5473021a,gcf0d15dbbd+5dd1654d75,gd96a1ce819+42fd0ee607,gdaeeff99f8+f9a426f77a,ge6526c86ff+0d71447b4b,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+fa3a7a026e
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
lsst::meas::base Namespace Reference

Namespaces

namespace  _id_generator
 
namespace  apCorrRegistry
 
namespace  applyApCorr
 
namespace  baseMeasurement
 
namespace  catalogCalculation
 
namespace  classification
 
namespace  compensatedGaussian
 
namespace  diaCalculation
 
namespace  diaCalculationPlugins
 
namespace  footprintArea
 
namespace  forcedMeasurement
 
namespace  forcedPhotCcd
 
namespace  measurementInvestigationLib
 
namespace  noiseReplacer
 
namespace  pluginRegistry
 
namespace  plugins
 
namespace  pluginsBase
 
namespace  python
 
namespace  sfm
 
namespace  tests
 
namespace  transforms
 
namespace  version
 
namespace  wrappers
 

Classes

class  ApertureFluxAlgorithm
 Base class for multiple-aperture photometry algorithms. More...
 
class  ApertureFluxControl
 Configuration object for multiple-aperture flux algorithms. More...
 
struct  ApertureFluxResult
 A Result struct for running an aperture flux algorithm with a single radius. More...
 
class  ApertureFluxTransform
 Measurement transformation for aperture fluxes. More...
 
class  BaseAlgorithm
 Ultimate abstract base class for all C++ measurement algorithms. More...
 
class  BaseTransform
 Abstract base class for all C++ measurement transformations. More...
 
class  BlendednessAlgorithm
 Compute metrics that measure how blended objects are. More...
 
class  BlendednessControl
 
class  CentroidChecker
 
struct  CentroidResult
 A reusable struct for centroid measurements. More...
 
class  CentroidResultKey
 A FunctorKey for CentroidResult. More...
 
class  CentroidTransform
 Base for centroid measurement transformations. More...
 
class  CircularApertureFluxAlgorithm
 
class  FatalAlgorithmError
 Exception to be thrown when a measurement algorithm experiences a fatal error. More...
 
struct  FlagDefinition
 Simple class used to define and document flags The name and doc constitute the identity of the FlagDefinition The number is used for indexing, but is assigned arbitrarily. More...
 
class  FlagDefinitionList
 vector-type utility class to build a collection of FlagDefinitions More...
 
class  FlagHandler
 Utility class for handling flag fields that indicate the failure modes of an algorithm. More...
 
struct  FluxResult
 A reusable result struct for instFlux measurements. More...
 
class  FluxResultKey
 A FunctorKey for FluxResult. More...
 
class  FluxTransform
 Base for instFlux measurement transformations. More...
 
class  ForcedAlgorithm
 Base class for algorithms that measure the properties of sources on one image, using previous measurements on another image to hold certain quantities fixed. More...
 
class  GaussianFluxAlgorithm
 A measurement algorithm that estimates instFlux using an elliptical Gaussian weight. More...
 
class  GaussianFluxControl
 A C++ control class to handle GaussianFluxAlgorithm's configuration. More...
 
class  GaussianFluxTransform
 
class  LocalBackgroundAlgorithm
 A measurement algorithm that estimates the local background value per pixel. More...
 
class  LocalBackgroundControl
 Configuration of LocalBackgroundAlgorithm. More...
 
class  LocalBackgroundTransform
 
struct  MagResult
 A reusable result struct for magnitudes. More...
 
class  MagResultKey
 A FunctorKey for MagResult. More...
 
class  MeasurementError
 Exception to be thrown when a measurement algorithm experiences a known failure mode. More...
 
class  NaiveCentroidAlgorithm
 A class that calculates a centroid as a simple unweighted first moment of the 3x3 region around a pixel. More...
 
class  NaiveCentroidControl
 A C++ control class to handle NaiveCentroidAlgorithm's configuration. More...
 
class  NaiveCentroidTransform
 
class  PeakLikelihoodFluxAlgorithm
 A measurement algorithm that estimates the peak instrument flux, using a filtered image which has been convolved with its own PSF. More...
 
class  PeakLikelihoodFluxControl
 C++ control object for peak likelihood instrument flux. More...
 
class  PeakLikelihoodFluxTransform
 
class  PixelFlagsAlgorithm
 A measurement algorithm that gets mask bits from the exposure and sets flag bits to summarize which bits are set within a source's footprint. More...
 
class  PixelFlagsControl
 A C++ control class to handle PixelFlagsAlgorithm's configuration. More...
 
class  PixelValueError
 Exception to be thrown when a measurement algorithm encounters a NaN or infinite pixel. More...
 
class  PsfFluxAlgorithm
 A measurement algorithm that estimates instFlux using a linear least-squares fit with the Psf model. More...
 
class  PsfFluxControl
 A C++ control class to handle PsfFluxAlgorithm's configuration. More...
 
class  PsfFluxTransform
 
class  SafeCentroidExtractor
 Utility class for measurement algorithms that extracts a position from the Centroid slot and handles errors in a safe and consistent way. More...
 
class  SafeShapeExtractor
 Utility class for measurement algorithms that extracts an ellipse from the Shape slot and handles errors in a safe and consistent way. More...
 
class  ScaledApertureFluxAlgorithm
 Measure the instFlux in an aperture scaled to the PSF. More...
 
class  ScaledApertureFluxControl
 
class  ScaledApertureFluxTransform
 
class  SdssCentroidAlgorithm
 The Sdss Centroid Algorithm. More...
 
class  SdssCentroidControl
 A C++ control class to handle SdssCentroidAlgorithm's configuration. More...
 
class  SdssCentroidTransform
 
class  SdssShapeAlgorithm
 Measure the image moments of source using adaptive Gaussian weights. More...
 
class  SdssShapeControl
 A C++ control class to handle SdssShapeAlgorithm's configuration. More...
 
class  SdssShapeResult
 Result object SdssShapeAlgorithm. More...
 
class  SdssShapeResultKey
 A FunctorKey that maps SdssShapeResult to afw::table Records. More...
 
class  SdssShapeTransform
 Transformation for SdssShape measurements. More...
 
struct  ShapeResult
 A reusable struct for moments-based shape measurements. More...
 
class  ShapeResultKey
 A FunctorKey for ShapeResult. More...
 
class  SimpleAlgorithm
 An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm and ForcedAlgorithm. More...
 
class  SincCoeffs
 A singleton to calculate and cache the coefficients for sinc photometry. More...
 
class  SingleFrameAlgorithm
 Base class for algorithms that measure the properties of sources on single image. More...
 

Typedefs

typedef int ElementCount
 
typedef double Flux
 
typedef double FluxErrElement
 
typedef double Mag
 
typedef double MagErrElement
 
typedef float ErrElement
 
typedef double CentroidElement
 
typedef double ShapeElement
 
typedef geom::Point< CentroidElement, 2 > Centroid
 
typedef Eigen::Matrix< ErrElement, 2, 2, Eigen::DontAlign > CentroidCov
 
typedef afw::geom::ellipses::Quadrupole Shape
 
typedef Eigen::Matrix< ErrElement, 3, 3, Eigen::DontAlign > ShapeCov
 
typedef Eigen::Matrix< ShapeElement, 3, 3, Eigen::DontAlign > ShapeTrMatrix
 
using PyApertureFluxClass
 

Enumerations

enum  UncertaintyEnum { NO_UNCERTAINTY = 0 , SIGMA_ONLY = 1 , FULL_COVARIANCE = 2 }
 An enum used to specify how much uncertainty information measurement algorithms provide. More...
 

Functions

ShapeTrMatrix makeShapeTransformMatrix (geom::LinearTransform const &xform)
 Construct a matrix suitable for transforming second moments.
 
void wrapFluxUtilities (WrapperCollection &)
 
void wrapAlgorithm (WrapperCollection &)
 
void wrapApertureFlow (WrapperCollection &)
 
void wrapBlendedness (WrapperCollection &)
 
void wrapCentroidUtilities (WrapperCollection &)
 
void wrapCircularApertureFlux (WrapperCollection &)
 
void wrapExceptions (WrapperCollection &)
 
void wrapFlagHandler (WrapperCollection &)
 
void wrapGaussianFlux (WrapperCollection &)
 
void wrapInputUtilities (WrapperCollection &)
 
void wrapLocalBackground (WrapperCollection &)
 
void wrapNaiveCentroid (WrapperCollection &)
 
void wrapPeakLikelihoodFlux (WrapperCollection &)
 
void wrapPixelFLags (WrapperCollection &)
 
void wrapPsfFlux (WrapperCollection &)
 
void wrapScaledApertureFlux (WrapperCollection &)
 
void wrapSddsCentroid (WrapperCollection &)
 
void wrapShapeUtilities (WrapperCollection &)
 
void wrapSincCoeffs (WrapperCollection &)
 
void wrapSsdsShape (WrapperCollection &)
 
void wrapTransform (WrapperCollection &)
 
void wrapCalcCompensatedGaussian (WrapperCollection &)
 
 PYBIND11_MODULE (_measBaseLib, mod)
 
void wrapAlgorithm (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapApertureFlow (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapBlendedness (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapCentroidUtilities (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapCircularApertureFlux (lsst::cpputils::python::WrapperCollection &wrappers)
 
py::tuple compensated_gaussian_filt_inner_product (py::array_t< double, py::array::c_style|py::array::forcecast > &array, py::array_t< double, py::array::c_style|py::array::forcecast > &variance_array, double x_mean, double y_mean, double sig, double t)
 
void wrapCalcCompensatedGaussian (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapExceptions (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapFlagHandler (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapFluxUtilities (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapGaussianFlux (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapInputUtilities (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapLocalBackground (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapNaiveCentroid (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapPeakLikelihoodFlux (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapPixelFLags (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapPsfFlux (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapScaledApertureFlux (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapSddsCentroid (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapSsdsShape (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapShapeUtilities (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapSincCoeffs (lsst::cpputils::python::WrapperCollection &wrappers)
 
void wrapTransform (lsst::cpputils::python::WrapperCollection &wrappers)
 
template<typename T >
afw::image::MaskedImage< T >::SinglePixel computeShiftedValue (afw::image::MaskedImage< T > const &maskedImage, std::string const &warpingKernelName, geom::Point2D const &fracShift, geom::Point2I const &parentInd)
 Compute the value of one pixel of an image after a fractional pixel shift Since we only want the value at one pixel, there is no need to shift the entire image; instead we simply convolve at one point.
 

Typedef Documentation

◆ Centroid

Definition at line 58 of file constants.h.

◆ CentroidCov

typedef Eigen::Matrix<ErrElement, 2, 2, Eigen::DontAlign> lsst::meas::base::CentroidCov

Definition at line 59 of file constants.h.

◆ CentroidElement

Definition at line 56 of file constants.h.

◆ ElementCount

Definition at line 50 of file constants.h.

◆ ErrElement

Definition at line 55 of file constants.h.

◆ Flux

typedef double lsst::meas::base::Flux

Definition at line 51 of file constants.h.

◆ FluxErrElement

Definition at line 52 of file constants.h.

◆ Mag

typedef double lsst::meas::base::Mag

Definition at line 53 of file constants.h.

◆ MagErrElement

Definition at line 54 of file constants.h.

◆ PyApertureFluxClass

Initial value:
py::class_<CircularApertureFluxAlgorithm,

Definition at line 35 of file circularApertureFlux.cc.

◆ Shape

Definition at line 60 of file constants.h.

◆ ShapeCov

typedef Eigen::Matrix<ErrElement, 3, 3, Eigen::DontAlign> lsst::meas::base::ShapeCov

Definition at line 61 of file constants.h.

◆ ShapeElement

Definition at line 57 of file constants.h.

◆ ShapeTrMatrix

typedef Eigen::Matrix<ShapeElement, 3, 3, Eigen::DontAlign> lsst::meas::base::ShapeTrMatrix

Definition at line 62 of file constants.h.

Enumeration Type Documentation

◆ UncertaintyEnum

An enum used to specify how much uncertainty information measurement algorithms provide.

Currently, only ResultMappers (not Results) make use of these distinctions; Result structs always have data members that could hold the full-covariance, but may set some of these to NaN.

Enumerator
NO_UNCERTAINTY 

Algorithm provides no uncertainy information at all.

SIGMA_ONLY 

Only the diagonal elements of the covariance matrix are provided.

FULL_COVARIANCE 

The full covariance matrix is provided.

Definition at line 43 of file constants.h.

43 {
44 NO_UNCERTAINTY = 0,
45 SIGMA_ONLY = 1,
47};
@ SIGMA_ONLY
Only the diagonal elements of the covariance matrix are provided.
Definition constants.h:45
@ FULL_COVARIANCE
The full covariance matrix is provided.
Definition constants.h:46
@ NO_UNCERTAINTY
Algorithm provides no uncertainy information at all.
Definition constants.h:44

Function Documentation

◆ compensated_gaussian_filt_inner_product()

py::tuple lsst::meas::base::compensated_gaussian_filt_inner_product ( py::array_t< double, py::array::c_style|py::array::forcecast > & array,
py::array_t< double, py::array::c_style|py::array::forcecast > & variance_array,
double x_mean,
double y_mean,
double sig,
double t )

Definition at line 14 of file _calcCompensatedGaussian.cc.

16 {
17 //Verify the input array is conditioned in an appropriate manner.
18 py::buffer_info buffer = array.request();
19 py::buffer_info variance_buffer = variance_array.request();
20
21 if (buffer.ndim != 2) {
22 throw std::runtime_error("Number of dimensions for array must be 2");
23 }
24 if (buffer.shape[0] != buffer.shape[1]){
25 throw std::runtime_error("Array must be square");
26 }
27 if (!(buffer.shape[0] % 2)) {
28 throw std::runtime_error("Number of pixels along array side must be odd");
29 }
30
31 if (variance_buffer.ndim != buffer.ndim) {
32 throw std::runtime_error("Variance array must have same dimensions as image array");
33 }
34 if (variance_buffer.shape[0] != buffer.shape[0] || variance_buffer.shape[1] != buffer.shape[1]) {
35 throw std::runtime_error("Variance array must have same dimensions as image array");
36 }
37
38 double sig_sq = sig*sig;
39 double t_sq_inv = 1./(t*t);
40 double t_inv = 1./t;
41
42 // fast access to array since we know all the bounds are appropriate
43 auto array_unchecked = array.unchecked<2>();
44 auto variance_array_unchecked = variance_array.unchecked<2>();
45
46 // declare most variables that will be used
47 double flux = 0;
48 double x_offset_sq;
49 double y_offset_sq;
50 double y_component;
51 double y_component_out;
52 double tmp_x_div;
53 double tmp_y_div;
54 double two_sig_sq = 2*sig_sq;
55
56 int half_domain = floor(buffer.shape[0] / 2);
57 int stop = buffer.shape[0];
58
59 // adjust the x and y center to be centered about the middle of the array
60 x_mean -= (double) half_domain;
61 y_mean -= (double) half_domain;
62
63 /*
64 create containers to store the 1 dimensional x calculations, these will be
65 accessed for each loop in y, no need to do the same calculations each time
66 */
67 std::vector<float> x_container;
68 std::vector<float> x_container_out;
69 x_container.reserve(stop);
70 x_container_out.reserve(stop);
71
72 // for weighted variance calculation
73 double variance = 0;
74 double var_norm = 0;
75
76 // calculate the x profile
77 for (int j = 0; j < stop; ++j) {
78 double x_pos = j - half_domain;
79 x_offset_sq = -1*pow(x_pos - x_mean, 2);
80 tmp_x_div = x_offset_sq / two_sig_sq;
81 x_container.push_back(exp(tmp_x_div));
82 x_container_out.push_back(t_inv * exp(tmp_x_div * t_sq_inv));
83 }
84
85 // for each y row, go over the saved x vector accumulating the inner
86 // product.
87 for (int i = 0; i < stop; ++i) {
88 double y_pos = i - half_domain;
89 y_offset_sq = -1*pow(y_pos - y_mean, 2);
90 tmp_y_div = y_offset_sq / two_sig_sq;
91 y_component = exp(tmp_y_div);
92 y_component_out = t_inv * exp(tmp_y_div * t_sq_inv);
93 for (int j = 0; j < stop; ++j){
94 double weight = (y_component*x_container[j] - y_component_out*x_container_out[j]);
95 double weighted_value = weight*array_unchecked(i, j);
96 flux += weighted_value;
97
98 variance += weight*weight*variance_array_unchecked(i, j);
99 var_norm += weight*weight;
100 }
101 }
102
103 // Normalization of the normalized Gaussian filter is 4 * pi * sig**2 * (t**2 + 1)/(t**2 - 1)
104 // We have deliberately not applied the normalization factor 1. / (2 * pi * sig**2) in the
105 // inner product, leaving the normalization term as 2 * (t**2 + 1)/(t**2 - 1) for the
106 // flux, and XXX for the variance.
107 flux *= 2 * (t*t + 1) / (t*t - 1);
108
109 // The variance has been normalized and so requires the full normalization term.
110 variance /= var_norm;
111 variance *= (4 * M_PI * sig_sq * (t*t + 1) ) / (t*t);
112
113 return py::make_tuple(flux, variance);
114}
afw::table::Key< afw::table::Array< VariancePixelT > > variance
#define M_PI
Definition ListMatch.cc:31
T floor(T... args)
T pow(T... args)
T push_back(T... args)
T reserve(T... args)
afw::table::Key< double > weight

◆ computeShiftedValue()

template<typename T >
afw::image::MaskedImage< T >::SinglePixel lsst::meas::base::computeShiftedValue ( afw::image::MaskedImage< T > const & maskedImage,
std::string const & warpingKernelName,
geom::Point2D const & fracShift,
geom::Point2I const & parentInd )

Compute the value of one pixel of an image after a fractional pixel shift Since we only want the value at one pixel, there is no need to shift the entire image; instead we simply convolve at one point.

Exceptions
pex::exceptions::RangeErrorif abs(fracShift) > 1 in either dimension
Parameters
maskedImagemasked image
warpingKernelNamewarping kernel name
fracShiftamount of sub-pixel shift (pixels)
parentIndparent index at which to compute pixel

Definition at line 134 of file PeakLikelihoodFlux.cc.

139 {
140 typedef typename afw::image::Exposure<T>::MaskedImageT MaskedImageT;
141 typedef typename afw::image::Image<double> KernelImageT;
142
143std::shared_ptr<afw::math::SeparableKernel> warpingKernelPtr = afw::math::makeWarpingKernel(warpingKernelName);
144
145 if ((std::abs(fracShift[0]) >= 1) || (std::abs(fracShift[1]) >= 1)) {
147 os << "fracShift = " << fracShift << " too large; abs value must be < 1 in both axes";
149 }
150
151 // warping kernels have even dimension and want the peak to the right of center
152 if (fracShift[0] < 0) {
153 warpingKernelPtr->setCtr(warpingKernelPtr->getCtr() + geom::Extent2I(1, 0));
154 }
155 if (fracShift[1] < 0) {
156 warpingKernelPtr->setCtr(warpingKernelPtr->getCtr() + geom::Extent2I(0, 1));
157 }
158 geom::Box2I warpingOverlapBBox(parentInd - geom::Extent2I(warpingKernelPtr->getCtr()),
159 warpingKernelPtr->getDimensions());
160 if (!maskedImage.getBBox().contains(warpingOverlapBBox)) {
162 os << "Warping kernel extends off the edge"
163 << "; kernel bbox = " << warpingOverlapBBox << "; exposure bbox = " << maskedImage.getBBox();
164 throw LSST_EXCEPT(pex::exceptions::RangeError, os.str());
165 }
166 warpingKernelPtr->setKernelParameters(std::make_pair(fracShift[0], fracShift[1]));
167 KernelImageT warpingKernelImage(warpingKernelPtr->getDimensions());
168 warpingKernelPtr->computeImage(warpingKernelImage, true);
169 typename KernelImageT::const_xy_locator const warpingKernelLoc = warpingKernelImage.xy_at(0, 0);
170
171 // Compute imLoc: an image locator that matches kernel locator (0,0) such that
172 // image ctrPix overlaps center of warping kernel
173 geom::Point2I subimMin = warpingOverlapBBox.getMin();
174 typename MaskedImageT::const_xy_locator const mimageLoc =
175 maskedImage.xy_at(subimMin.getX(), subimMin.getY());
176 return afw::math::convolveAtAPoint<MaskedImageT, MaskedImageT>(
177 mimageLoc, warpingKernelLoc, warpingKernelPtr->getWidth(), warpingKernelPtr->getHeight());
178}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
std::ostream * os
Definition Schema.cc:557
A class to represent a 2-dimensional array of pixels.
Definition Image.h:51
A class to manipulate images, masks, and variance as a single object.
Definition MaskedImage.h:74
An integer coordinate rectangle.
Definition Box.h:55
Reports when the result of an operation cannot be represented by the destination type.
Definition Runtime.h:115
T make_pair(T... args)
afw::table::Key< std::string > warpingKernelName
Definition CoaddPsf.cc:354

◆ makeShapeTransformMatrix()

ShapeTrMatrix lsst::meas::base::makeShapeTransformMatrix ( geom::LinearTransform const & xform)

Construct a matrix suitable for transforming second moments.

Given an LinearTransform which maps from positions (x, y) to (a, d), returns a 3-by-3 matrix which transforms (xx, yy, xy) to (aa, dd, ad).

That is, given an input transform described by the matrix

| A11 | A12 | | A21 | A22 |

we return the matrix

| A11*A11 | A12*A12 | 2*A11*A12 | | A21*A21 | A22*A22 | 2*A21*A22 | | A11*A21 | A12*A22 | A11*A22 + A12*A21 |

Parameters
[in]xformLinearTransform describing the coordinate mapping
Returns
A 3-by-3 transformation matrix for the second order moments

Definition at line 143 of file ShapeUtilities.cc.

143 {
144 typedef geom::LinearTransform LT;
145 Eigen::Matrix<ShapeElement, 3, 3, Eigen::DontAlign> m;
146 m << xform[LT::XX] * xform[LT::XX], xform[LT::XY] * xform[LT::XY], 2 * xform[LT::XX] * xform[LT::XY],
147 xform[LT::YX] * xform[LT::YX], xform[LT::YY] * xform[LT::YY], 2 * xform[LT::YX] * xform[LT::YY],
148 xform[LT::XX] * xform[LT::YX], xform[LT::XY] * xform[LT::YY],
149 xform[LT::XX] * xform[LT::YY] + xform[LT::XY] * xform[LT::YX];
150 return m;
151}
int m
Definition SpanSet.cc:48
A 2D linear coordinate transformation.

◆ PYBIND11_MODULE()

lsst::meas::base::PYBIND11_MODULE ( _measBaseLib ,
mod  )

Definition at line 59 of file _measBaseLib.cc.

59 {
60 lsst::cpputils::python::WrapperCollection wrappers(mod, "lsst.meas.base");
61
62 wrappers.addInheritanceDependency("lsst.afw.geom");
63 wrappers.addInheritanceDependency("lsst.afw.image");
64 wrappers.addInheritanceDependency("lsst.afw.table");
65 wrappers.addInheritanceDependency("lsst.pex.exceptions");
66
67 wrappers.addSignatureDependency("lsst.daf.base");
68
69 wrapExceptions(wrappers);
70 wrapFlagHandler(wrappers);
71 wrapFluxUtilities(wrappers);
72 wrapTransform(wrappers);
73 wrapAlgorithm(wrappers);
74 wrapApertureFlow(wrappers);
75 wrapBlendedness(wrappers);
76 wrapCentroidUtilities(wrappers);
78 wrapGaussianFlux(wrappers);
79 wrapInputUtilities(wrappers);
80 wrapLocalBackground(wrappers);
81 wrapNaiveCentroid(wrappers);
82 wrapPeakLikelihoodFlux(wrappers);
83 wrapPixelFLags(wrappers);
84 wrapPsfFlux(wrappers);
85 wrapScaledApertureFlux(wrappers);
86 wrapSddsCentroid(wrappers);
87 wrapShapeUtilities(wrappers);
88 wrapSincCoeffs(wrappers);
89 wrapSsdsShape(wrappers);
91 wrappers.finish();
92}
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
void wrapSsdsShape(WrapperCollection &)
void wrapShapeUtilities(WrapperCollection &)
void wrapFluxUtilities(WrapperCollection &)
void wrapScaledApertureFlux(WrapperCollection &)
void wrapPeakLikelihoodFlux(WrapperCollection &)
void wrapPixelFLags(WrapperCollection &)
void wrapApertureFlow(WrapperCollection &)
void wrapCalcCompensatedGaussian(WrapperCollection &)
void wrapExceptions(WrapperCollection &)
void wrapGaussianFlux(WrapperCollection &)
void wrapCircularApertureFlux(WrapperCollection &)
void wrapCentroidUtilities(WrapperCollection &)
void wrapLocalBackground(WrapperCollection &)
void wrapFlagHandler(WrapperCollection &)
void wrapPsfFlux(WrapperCollection &)
void wrapAlgorithm(WrapperCollection &)
void wrapBlendedness(WrapperCollection &)
void wrapSddsCentroid(WrapperCollection &)
void wrapInputUtilities(WrapperCollection &)
void wrapSincCoeffs(WrapperCollection &)
void wrapNaiveCentroid(WrapperCollection &)

◆ wrapAlgorithm() [1/2]

void lsst::meas::base::wrapAlgorithm ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 65 of file algorithm.cc.

65 {
66 declareBaseAlgorithm(wrappers);
67 declareSingleFrameAlgorithm(wrappers);
68 declareSimpleAlgorithm(wrappers);
69}

◆ wrapAlgorithm() [2/2]

void lsst::meas::base::wrapAlgorithm ( WrapperCollection & )

◆ wrapApertureFlow() [1/2]

void lsst::meas::base::wrapApertureFlow ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 122 of file apertureFlux.cc.

122 {
123 auto clsFluxControl = declareFluxControl(wrappers);
124 auto clsFluxAlgorithm = declareFluxAlgorithm(wrappers);
125 declareFluxResult(wrappers);
126 auto clsFluxTransform = declareFluxTransform(wrappers);
127
128 clsFluxAlgorithm.attr("Control") = clsFluxControl;
129 // no need to make ApertureFluxControl::Result visible to Python
130 clsFluxTransform.attr("Control") = clsFluxControl;
131
132 python::declareAlgorithm<ApertureFluxAlgorithm, ApertureFluxControl, ApertureFluxTransform>(
133 clsFluxAlgorithm, clsFluxControl, clsFluxTransform);
134}

◆ wrapApertureFlow() [2/2]

void lsst::meas::base::wrapApertureFlow ( WrapperCollection & )

◆ wrapBlendedness() [1/2]

void lsst::meas::base::wrapBlendedness ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 77 of file blendedness.cc.

77 {
78 auto clsBlendednessControl = declareBlendednessControl(wrappers);
79 auto clsBlendednessAlgorithm = declareBlendednessAlgorithm(wrappers);
80 clsBlendednessAlgorithm.attr("Control") = clsBlendednessControl;
81
82 python::declareAlgorithm<BlendednessAlgorithm, BlendednessControl>(clsBlendednessAlgorithm,
83 clsBlendednessControl);
84}

◆ wrapBlendedness() [2/2]

void lsst::meas::base::wrapBlendedness ( WrapperCollection & )

◆ wrapCalcCompensatedGaussian() [1/2]

void lsst::meas::base::wrapCalcCompensatedGaussian ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 116 of file _calcCompensatedGaussian.cc.

116 {
117 wrappers.wrap([](auto &mod) {
118 mod.def("_compensatedGaussianFiltInnerProduct", &compensated_gaussian_filt_inner_product,
119R"doc_string(Calculates flux and variance for a Compensated Gaussian filter.
120
121Parameters
void wrap(WrapperCallback function)
Add a set of wrappers without defining a class.
Definition python.h:369

◆ wrapCalcCompensatedGaussian() [2/2]

void lsst::meas::base::wrapCalcCompensatedGaussian ( WrapperCollection & )

◆ wrapCentroidUtilities() [1/2]

void lsst::meas::base::wrapCentroidUtilities ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 122 of file centroidUtilities.cc.

122 {
123 declareCentroidResult(wrappers);
124 declareCentroidResultKey(wrappers);
125 declareCentroidTransform(wrappers);
126 declareCentroidChecker(wrappers);
127 declareUncertaintyEnum(wrappers);
128}

◆ wrapCentroidUtilities() [2/2]

void lsst::meas::base::wrapCentroidUtilities ( WrapperCollection & )

◆ wrapCircularApertureFlux() [1/2]

void lsst::meas::base::wrapCircularApertureFlux ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 37 of file circularApertureFlux.cc.

37 {
38
39 wrappers.wrapType(PyApertureFluxClass(wrappers.module, "CircularApertureFluxAlgorithm"), [](auto &mod, auto &cls) {
40 cls.def(py::init<CircularApertureFluxAlgorithm::Control const &, std::string const &,
41 afw::table::Schema &, daf::base::PropertySet &>(),
42 "ctrl"_a, "name"_a, "schema"_a, "metadata"_a);
43 cls.def("measure", &CircularApertureFluxAlgorithm::measure, "measRecord"_a, "exposure"_a);
44 });
45}
PyType wrapType(PyType cls, ClassWrapperCallback function, bool setModuleName=true)
Add a type (class or enum) wrapper, deferring method and other attribute definitions until finish() i...
Definition python.h:391
py::class_< CircularApertureFluxAlgorithm, std::shared_ptr< CircularApertureFluxAlgorithm >, ApertureFluxAlgorithm > PyApertureFluxClass

◆ wrapCircularApertureFlux() [2/2]

void lsst::meas::base::wrapCircularApertureFlux ( WrapperCollection & )

◆ wrapExceptions() [1/2]

void lsst::meas::base::wrapExceptions ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 36 of file exceptions.cc.

36 {
37 using pex::exceptions::python::declareException;
40
41
42 wrappers.wrapType(
43 declareException<FatalAlgorithmError, RuntimeError>(wrappers.module, "FatalAlgorithmError", "RuntimeError"),
44 [](auto &mod, auto &cls) {
45 cls.def(py::init<std::string const &>(), "message"_a);
46 });
47 wrappers.wrapType(
48 declareException<MeasurementError, RuntimeError>(wrappers.module, "MeasurementError", "RuntimeError"),
49 [](auto &mod, auto &cls) {
50 cls.def(py::init<std::string const &, std::size_t>(), "message"_a, "flagBit"_a);
51 cls.def("getFlagBit", &MeasurementError::getFlagBit);
52 });
53 wrappers.wrapType(
54 declareException<PixelValueError, DomainError>(wrappers.module, "PixelValueError", "DomainError"),
55 [](auto &mod, auto &cls) {
56 cls.def(py::init<std::string const &>(), "message"_a);
57 });
58}
Reports arguments outside the domain of an operation.
Definition Runtime.h:57
Reports errors that are due to events beyond the control of the program.
Definition Runtime.h:104

◆ wrapExceptions() [2/2]

void lsst::meas::base::wrapExceptions ( WrapperCollection & )

◆ wrapFlagHandler() [1/2]

void lsst::meas::base::wrapFlagHandler ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 124 of file flagHandler.cc.

124 {
125 declareFlagDefinition(wrappers);
126 declareFlagDefinitionList(wrappers);
127 declareFlagHandler(wrappers);
128}

◆ wrapFlagHandler() [2/2]

void lsst::meas::base::wrapFlagHandler ( WrapperCollection & )

◆ wrapFluxUtilities() [1/2]

void lsst::meas::base::wrapFluxUtilities ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 91 of file fluxUtilities.cc.

91 {
92 declareFluxResult(wrappers);
93 declareFluxResultKey(wrappers);
94 declareMagResult(wrappers);
95 declareMagResultKey(wrappers);
96}

◆ wrapFluxUtilities() [2/2]

void lsst::meas::base::wrapFluxUtilities ( WrapperCollection & )

◆ wrapGaussianFlux() [1/2]

void lsst::meas::base::wrapGaussianFlux ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 76 of file gaussianFlux.cc.

76 {
77 auto clsFluxControl = declareFluxControl(wrappers);
78 auto clsFluxAlgorithm = declareFluxAlgorithm(wrappers);
79 auto clsFluxTransform = declareFluxTransform(wrappers);
80
81 clsFluxAlgorithm.attr("Control") = clsFluxControl;
82 clsFluxTransform.attr("Control") = clsFluxControl;
83
84 python::declareAlgorithm<GaussianFluxAlgorithm, GaussianFluxControl, GaussianFluxTransform>(
85 clsFluxAlgorithm, clsFluxControl, clsFluxTransform);
86}

◆ wrapGaussianFlux() [2/2]

void lsst::meas::base::wrapGaussianFlux ( WrapperCollection & )

◆ wrapInputUtilities() [1/2]

void lsst::meas::base::wrapInputUtilities ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 36 of file inputUtilities.cc.

36 {
37 using PySafeCentroidExtractor = py::class_<SafeCentroidExtractor>;
38 wrappers.wrapType(PySafeCentroidExtractor(wrappers.module, "SafeCentroidExtractor"), [](auto &mod, auto &cls) {
39 cls.def(py::init<afw::table::Schema &, std::string const &, bool>(), "schema"_a,
40 "name"_a, "isCentroider"_a = false);
41 cls.def("__call__",
42 [](SafeCentroidExtractor const &self, afw::table::SourceRecord &record,
43 FlagHandler const &flags) { return self(record, flags); },
44 "record"_a, "flags"_a);
45 });
46}

◆ wrapInputUtilities() [2/2]

void lsst::meas::base::wrapInputUtilities ( WrapperCollection & )

◆ wrapLocalBackground() [1/2]

void lsst::meas::base::wrapLocalBackground ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 85 of file localBackground.cc.

85 {
86 auto clsControl = declareControl(wrappers);
87 auto clsAlgorithm = declareAlgorithm(wrappers);
88 auto clsTransform = declareTransform(wrappers);
89
90 clsAlgorithm.attr("Control") = clsControl;
91 clsTransform.attr("Control") = clsControl;
92
93 python::declareAlgorithm<LocalBackgroundAlgorithm, LocalBackgroundControl, LocalBackgroundTransform>(
94 clsAlgorithm, clsControl, clsTransform);
95}

◆ wrapLocalBackground() [2/2]

void lsst::meas::base::wrapLocalBackground ( WrapperCollection & )

◆ wrapNaiveCentroid() [1/2]

void lsst::meas::base::wrapNaiveCentroid ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 83 of file naiveCentroid.cc.

83 {
84 auto clsCentroidControl = declareCentroidControl(wrappers);
85 auto clsCentroidAlgorithm = declareCentroidAlgorithm(wrappers);
86 auto clsCentroidTransform = declareCentroidTransform(wrappers);
87
88 clsCentroidAlgorithm.attr("Control") = clsCentroidControl;
89 clsCentroidTransform.attr("Control") = clsCentroidControl;
90
91 python::declareAlgorithm<NaiveCentroidAlgorithm, NaiveCentroidControl, NaiveCentroidTransform>(
92 clsCentroidAlgorithm, clsCentroidControl, clsCentroidTransform);
93}

◆ wrapNaiveCentroid() [2/2]

void lsst::meas::base::wrapNaiveCentroid ( WrapperCollection & )

◆ wrapPeakLikelihoodFlux() [1/2]

void lsst::meas::base::wrapPeakLikelihoodFlux ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 75 of file peakLikelihoodFlux.cc.

75 {
76 wrappers.addSignatureDependency("lsst.afw.table");
77 wrappers.addSignatureDependency("lsst.afw.image");
78
79 auto clsFluxControl = declareFluxControl(wrappers);
80 auto clsFluxAlgorithm = declareFluxAlgorithm(wrappers);
81 auto clsFluxTransform = declareFluxTransform(wrappers);
82
83 clsFluxAlgorithm.attr("Control") = clsFluxControl;
84 clsFluxTransform.attr("Control") = clsFluxControl;
85
87 PeakLikelihoodFluxTransform>(clsFluxAlgorithm, clsFluxControl, clsFluxTransform);
88}
void addSignatureDependency(std::string const &name)
Indicate an external module that provides a type used in function/method signatures.
Definition python.h:357
A measurement algorithm that estimates the peak instrument flux, using a filtered image which has bee...
C++ control object for peak likelihood instrument flux.

◆ wrapPeakLikelihoodFlux() [2/2]

void lsst::meas::base::wrapPeakLikelihoodFlux ( WrapperCollection & )

◆ wrapPixelFLags() [1/2]

void lsst::meas::base::wrapPixelFLags ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 41 of file pixelFlags.cc.

41 {
42 wrappers.wrap([](auto &mod) {
43 py::class_<PixelFlagsAlgorithm, std::shared_ptr<PixelFlagsAlgorithm>, SimpleAlgorithm>
44 clsPixelFlagsAlgorithm(mod, "PixelFlagsAlgorithm");
45 py::class_<PixelFlagsControl> clsPixelFlagsControl(mod, "PixelFlagsControl");
46
47 clsPixelFlagsAlgorithm.def(
48 py::init<PixelFlagsAlgorithm::Control const &, std::string const &, afw::table::Schema &>(),
49 "ctrl"_a, "name"_a, "schema"_a);
50
51 clsPixelFlagsControl.def(py::init<>());
52
53 clsPixelFlagsAlgorithm.def("measure", &PixelFlagsAlgorithm::measure, "measRecord"_a, "exposure"_a);
54 clsPixelFlagsAlgorithm.def("fail", &PixelFlagsAlgorithm::fail, "measRecord"_a, "error"_a = nullptr);
55
56 LSST_DECLARE_CONTROL_FIELD(clsPixelFlagsControl, PixelFlagsControl, masksFpAnywhere);
57 LSST_DECLARE_CONTROL_FIELD(clsPixelFlagsControl, PixelFlagsControl, masksFpCenter);
58 });
59}
A C++ control class to handle PixelFlagsAlgorithm's configuration.
Definition PixelFlags.h:44
An abstract base classes for which the same implementation can be used for both SingleFrameAlgorithm ...
Definition Algorithm.h:170
#define LSST_DECLARE_CONTROL_FIELD(WRAPPER, CLASS, NAME)
Macro used to wrap fields declared by LSST_CONTROL_FIELD using Pybind11.
Definition python.h:50

◆ wrapPixelFLags() [2/2]

void lsst::meas::base::wrapPixelFLags ( WrapperCollection & )

◆ wrapPsfFlux() [1/2]

void lsst::meas::base::wrapPsfFlux ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 81 of file psfFlux.cc.

81 {
82 auto clsFluxControl = declareFluxControl(wrappers);
83 auto clsFluxAlgorithm = declareFluxAlgorithm(wrappers);
84 auto clsFluxTransform = declareFluxTransform(wrappers);
85 clsFluxAlgorithm.attr("Control") = clsFluxControl;
86 clsFluxTransform.attr("Control") = clsFluxControl;
87
88 python::declareAlgorithm<PsfFluxAlgorithm, PsfFluxControl, PsfFluxTransform>(
89 clsFluxAlgorithm, clsFluxControl, clsFluxTransform);
90}

◆ wrapPsfFlux() [2/2]

void lsst::meas::base::wrapPsfFlux ( WrapperCollection & )

◆ wrapScaledApertureFlux() [1/2]

void lsst::meas::base::wrapScaledApertureFlux ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 80 of file scaledApertureFlux.cc.

80 {
81 auto clsFluxControl = declareFluxControl(wrappers);
82 auto clsFluxAlgorithm = declareFluxAlgorithm(wrappers);
83 auto clsFluxTransform = declareFluxTransform(wrappers);
84
85 clsFluxAlgorithm.attr("Control") = clsFluxControl;
86 clsFluxTransform.attr("Control") = clsFluxControl;
87
89 ScaledApertureFluxTransform>(clsFluxAlgorithm, clsFluxControl, clsFluxTransform);
90}
Measure the instFlux in an aperture scaled to the PSF.

◆ wrapScaledApertureFlux() [2/2]

void lsst::meas::base::wrapScaledApertureFlux ( WrapperCollection & )

◆ wrapSddsCentroid() [1/2]

void lsst::meas::base::wrapSddsCentroid ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 86 of file sdssCentroid.cc.

86 {
87 auto clsCentroidControl = declareCentroidControl(wrappers);
88 auto clsCentroidAlgorithm = declareCentroidAlgorithm(wrappers);
89 auto clsCentroidTransform = declareCentroidTransform(wrappers);
90
91 clsCentroidAlgorithm.attr("Control") = clsCentroidControl;
92 clsCentroidTransform.attr("Control") = clsCentroidControl;
93
94 python::declareAlgorithm<SdssCentroidAlgorithm, SdssCentroidControl, SdssCentroidTransform>(
95 clsCentroidAlgorithm, clsCentroidControl, clsCentroidTransform);
96}

◆ wrapSddsCentroid() [2/2]

void lsst::meas::base::wrapSddsCentroid ( WrapperCollection & )

◆ wrapShapeUtilities() [1/2]

void lsst::meas::base::wrapShapeUtilities ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 98 of file shapeUtilities.cc.

98 {
99 declareShapeResult(wrappers);
100 declareShapeResultKey(wrappers);
101 wrappers.wrap([](auto &mod) {
102 mod.def("makeShapeTransformMatrix", &makeShapeTransformMatrix, "xform"_a);
103 });
104}

◆ wrapShapeUtilities() [2/2]

void lsst::meas::base::wrapShapeUtilities ( WrapperCollection & )

◆ wrapSincCoeffs() [1/2]

void lsst::meas::base::wrapSincCoeffs ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 48 of file sincCoeffs.cc.

48 {
49 declareSincCoeffs<float>(wrappers, "F");
50 declareSincCoeffs<double>(wrappers, "D");
51}

◆ wrapSincCoeffs() [2/2]

void lsst::meas::base::wrapSincCoeffs ( WrapperCollection & )

◆ wrapSsdsShape() [1/2]

void lsst::meas::base::wrapSsdsShape ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 148 of file sdssShape.cc.

148 {
149 auto clsShapeControl = declareShapeControl(wrappers);
150 declareShapeResultKey(wrappers);
151 auto clsShapeAlgorithm = declareShapeAlgorithm(wrappers);
152 declareShapeResult(wrappers);
153 auto clsShapeTransform = declareShapeTransform(wrappers);
154
155 clsShapeAlgorithm.attr("Control") = clsShapeControl;
156 clsShapeTransform.attr("Control") = clsShapeControl;
157
158 python::declareAlgorithm<SdssShapeAlgorithm, SdssShapeControl, SdssShapeTransform>(
159 clsShapeAlgorithm, clsShapeControl, clsShapeTransform);
160}

◆ wrapSsdsShape() [2/2]

void lsst::meas::base::wrapSsdsShape ( WrapperCollection & )

◆ wrapTransform() [1/2]

void lsst::meas::base::wrapTransform ( lsst::cpputils::python::WrapperCollection & wrappers)

Definition at line 37 of file transform.cc.

37 {
38 using PyBaseTransform = py::class_<BaseTransform, std::shared_ptr<BaseTransform>>;
39 wrappers.wrapType(PyBaseTransform(wrappers.module, "BaseTransform"), [](auto &mod, auto &cls) {
40 cls.def("__call__", &BaseTransform::operator(), "inputCatalog"_a, "outputCatalog"_a, "wcs"_a,
41 "photoCalib"_a);
42 });
43}

◆ wrapTransform() [2/2]

void lsst::meas::base::wrapTransform ( WrapperCollection & )