Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0fba68d861+05a5e06e50,g1fd858c14a+904f1f4196,g2c84ff76c0+247cd845a2,g2c9e612ef2+f5117f1d55,g35bb328faa+fcb1d3bbc8,g4af146b050+123c2f4d45,g4d2262a081+a9e7a6e053,g4e0f332c67+c58e4b632d,g53246c7159+fcb1d3bbc8,g5a012ec0e7+ac98094cfc,g60b5630c4e+f5117f1d55,g67b6fd64d1+dd0349c22b,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+2a1aa4536a,g8852436030+d21aad2af4,g89139ef638+dd0349c22b,g8d6b6b353c+f5117f1d55,g9125e01d80+fcb1d3bbc8,g989de1cb63+dd0349c22b,g9f33ca652e+0a580a37dd,g9f7030ddb1+ae84e0d5a5,ga2b97cdc51+f5117f1d55,gabe3b4be73+1e0a283bba,gb1101e3267+1d994e7598,gb58c049af0+f03b321e39,gb89ab40317+dd0349c22b,gcca6a94b71+4ed007ada1,gcf25f946ba+d21aad2af4,gd315a588df+9d9c5ccff1,gd6cbbdb0b4+75aa4b1db4,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+6fce216140,ge278dab8ac+c61fbefdff,ge410e46f29+dd0349c22b,ge82c20c137+e12a08b75a,gf67bdafdda+dd0349c22b,v28.0.2.rc1
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.