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
Namespaces | Classes | Functions | Variables
lsst::meas::extensions::photometryKron Namespace Reference

Namespaces

 version
 

Classes

class  KronFluxControl
 C++ control object for Kron flux. More...
 
class  KronFluxAlgorithm
 A measurement algorithm that estimates flux using Kron photometry. More...
 
class  KronAperture
 
class  BadKronException
 

Functions

 PYBIND11_MODULE (photometryKron, mod)
 
template<typename ImageT >
std::pair< double, double > photometer (ImageT const &image, afw::geom::ellipses::Ellipse const &aperture, double const maxSincRadius)
 
double calculatePsfKronRadius (std::shared_ptr< afw::detection::Psf const > const &psf, geom::Point2D const &center, double smoothingSigma=0.0)
 
template std::shared_ptr< KronApertureKronAperture::determineRadius< afw::image::MaskedImage< float > > (afw::image::MaskedImage< float > const &, afw::geom::ellipses::Axes, geom::Point2D const &, KronFluxControl const &)
 
template std::pair< double, double > KronAperture::measureFlux< afw::image::MaskedImage< float > > (afw::image::MaskedImage< float > const &, double const, double const) const
 

Variables

 KronFluxPlugin
 
 KronFluxForcedPlugin
 
 name
 
 Control
 
 executionOrder
 
 shouldApCorr
 
 needsMetadata
 

Function Documentation

◆ calculatePsfKronRadius()

double lsst::meas::extensions::photometryKron::calculatePsfKronRadius ( std::shared_ptr< afw::detection::Psf const > const &  psf,
geom::Point2D const &  center,
double  smoothingSigma = 0.0 
)

Definition at line 333 of file KronPhotometry.cc.

338 {
339  assert(psf);
340  double const radius = psf->computeShape(center).getDeterminantRadius();
341  // For a Gaussian N(0, sigma^2), the Kron radius is sqrt(pi/2)*sigma
342  return ::sqrt(geom::PI/2)*::hypot(radius, std::max(0.0, smoothingSigma));
343 }
T max(T... args)
constexpr double PI
The ratio of a circle's circumference to diameter.
Definition: Angle.h:39
Key< int > psf
Definition: Exposure.cc:65

◆ KronAperture::determineRadius< afw::image::MaskedImage< float > >()

◆ KronAperture::measureFlux< afw::image::MaskedImage< float > >()

template std::pair<double, double> lsst::meas::extensions::photometryKron::KronAperture::measureFlux< afw::image::MaskedImage< float > > ( afw::image::MaskedImage< float > const &  ,
double const  ,
double const   
) const

◆ photometer()

template<typename ImageT >
std::pair<double, double> lsst::meas::extensions::photometryKron::photometer ( ImageT const &  image,
afw::geom::ellipses::Ellipse const &  aperture,
double const  maxSincRadius 
)

Definition at line 306 of file KronPhotometry.cc.

311 {
312  afw::geom::ellipses::Axes const& axes = aperture.getCore();
313  if (axes.getB() > maxSincRadius) {
314  FootprintFlux<ImageT> fluxFunctor;
315  auto spans = afw::geom::SpanSet::fromShape(aperture);
316  spans->applyFunctor(
317  fluxFunctor, *(image.getImage()), *(image.getVariance()));
318  return std::make_pair(fluxFunctor.getSum(), ::sqrt(fluxFunctor.getSumVar()));
319  }
320  try {
321  base::ApertureFluxResult fluxResult = base::ApertureFluxAlgorithm::computeSincFlux<float>(image, aperture);
322  return std::make_pair(fluxResult.instFlux, fluxResult.instFluxErr);
323  } catch(pex::exceptions::LengthError &e) {
324  LSST_EXCEPT_ADD(e, (boost::format("Measuring Kron flux for object at (%.3f, %.3f);"
325  " aperture radius %g,%g theta %g")
326  % aperture.getCenter().getX() % aperture.getCenter().getY()
327  % axes.getA() % axes.getB() % geom::radToDeg(axes.getTheta())).str());
328  throw e;
329  }
330 }
#define LSST_EXCEPT_ADD(e, m)
Add the current location and a message to an existing exception before rethrowing it.
Definition: Exception.h:54
T make_pair(T... args)
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
constexpr double radToDeg(double x) noexcept
Definition: Angle.h:52
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
T sqrt(T... args)

◆ PYBIND11_MODULE()

lsst::meas::extensions::photometryKron::PYBIND11_MODULE ( photometryKron  ,
mod   
)

Definition at line 132 of file photometryKron.cc.

132  {
133  py::module::import("lsst.afw.geom");
134  py::module::import("lsst.afw.image");
135  py::module::import("lsst.afw.table");
136  py::module::import("lsst.daf.base");
137 
138  declareKronFluxControl(mod);
139  declareKronFluxAlgorithm(mod);
140  declareKronAperture(mod);
141 }

Variable Documentation

◆ Control

lsst.meas.extensions.photometryKron.Control

Definition at line 31 of file __init__.py.

◆ executionOrder

lsst.meas.extensions.photometryKron.executionOrder

Definition at line 32 of file __init__.py.

◆ KronFluxForcedPlugin

lsst.meas.extensions.photometryKron.KronFluxForcedPlugin

Definition at line 28 of file __init__.py.

◆ KronFluxPlugin

lsst.meas.extensions.photometryKron.KronFluxPlugin

Definition at line 28 of file __init__.py.

◆ name

lsst.meas.extensions.photometryKron.name

Definition at line 30 of file __init__.py.

◆ needsMetadata

lsst.meas.extensions.photometryKron.needsMetadata

Definition at line 34 of file __init__.py.

◆ shouldApCorr

lsst.meas.extensions.photometryKron.shouldApCorr

Definition at line 33 of file __init__.py.