Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0fba68d861+a3ea3d1d86,g1ec0fe41b4+e220e2fb2f,g1fd858c14a+120b017347,g35bb328faa+fcb1d3bbc8,g4d2262a081+bd92cbabc2,g53246c7159+fcb1d3bbc8,g56a49b3a55+8d793c2a3d,g60b5630c4e+4e8d433789,g67b6fd64d1+fad15079a7,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g8180f54f50+65cb53bb37,g8352419a5c+fcb1d3bbc8,g8852436030+ae791ba189,g89139ef638+fad15079a7,g9125e01d80+fcb1d3bbc8,g94187f82dc+4e8d433789,g989de1cb63+fad15079a7,g9ccd5d7f00+cce09d2c12,g9d31334357+4e8d433789,g9f33ca652e+323fd354f8,gabe3b4be73+1e0a283bba,gabf8522325+94c30d56e9,gb1101e3267+5e0f808207,gb58c049af0+f03b321e39,gb89ab40317+fad15079a7,gc0af124501+a88dc73679,gcf25f946ba+ae791ba189,gd6cbbdb0b4+8d7f1baacb,gdb1c4ca869+16879ca1a6,gde0f65d7ad+61e7a18ddf,ge1ad929117+4e8d433789,ge278dab8ac+4d6e48c014,ge35a86080c+6eff471efc,ge410e46f29+fad15079a7,gf5e32f922b+fcb1d3bbc8,gf618743f1b+8ff1364817,gf67bdafdda+fad15079a7,w.2025.17
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lsst::meas::extensions::photometryKron Namespace Reference

Namespaces

namespace  version
 

Classes

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

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 338 of file KronPhotometry.cc.

343{
344 assert(psf);
345 double const radius = psf->computeShape(center).getDeterminantRadius();
346 // For a Gaussian N(0, sigma^2), the Kron radius is sqrt(pi/2)*sigma
347 return ::sqrt(geom::PI/2)*::hypot(radius, std::max(0.0, smoothingSigma));
348}
T max(T... args)
double constexpr PI
The ratio of a circle's circumference to diameter.
Definition Angle.h:40

◆ 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 311 of file KronPhotometry.cc.

316{
317 afw::geom::ellipses::Axes const& axes = aperture.getCore();
318 if (axes.getB() > maxSincRadius) {
319 FootprintFlux<ImageT> fluxFunctor;
320 auto spans = afw::geom::SpanSet::fromShape(aperture);
321 spans->applyFunctor(
322 fluxFunctor, *(image.getImage()), *(image.getVariance()));
323 return std::make_pair(fluxFunctor.getSum(), ::sqrt(fluxFunctor.getSumVar()));
324 }
325 try {
327 return std::make_pair(fluxResult.instFlux, fluxResult.instFluxErr);
328 } catch(pex::exceptions::LengthError &e) {
329 LSST_EXCEPT_ADD(e, (boost::format("Measuring Kron flux for object at (%.3f, %.3f);"
330 " aperture radius %g,%g theta %g")
331 % aperture.getCenter().getX() % aperture.getCenter().getY()
332 % axes.getA() % axes.getB() % geom::radToDeg(axes.getTheta())).str());
333 throw e;
334 }
335}
#define LSST_EXCEPT_ADD(e, m)
Add the current location and a message to an existing exception before rethrowing it.
Definition Exception.h:54
static std::shared_ptr< geom::SpanSet > fromShape(int r, Stencil s=Stencil::CIRCLE, lsst::geom::Point2I offset=lsst::geom::Point2I())
Factory function for creating SpanSets from a Stencil.
Definition SpanSet.cc:688
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,...
Definition Axes.h:47
double const getTheta() const
Definition Axes.h:57
double const getA() const
Definition Axes.h:51
double const getB() const
Definition Axes.h:54
static Result computeSincFlux(afw::image::Image< T > const &image, afw::geom::ellipses::Ellipse const &ellipse, Control const &ctrl=Control())
Compute the instFlux (and optionally, uncertanties) within an aperture using Sinc photometry.
Reports attempts to exceed implementation-defined length limits for some classes.
Definition Runtime.h:76
T make_pair(T... args)
constexpr double radToDeg(double x) noexcept
Definition Angle.h:53
A Result struct for running an aperture flux algorithm with a single radius.
meas::base::Flux instFlux
Measured instFlux in DN.
meas::base::FluxErrElement instFluxErr
Standard deviation of instFlux in DN.

◆ 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.