LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Classes | Functions | Variables
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 {
326 base::ApertureFluxResult fluxResult = base::ApertureFluxAlgorithm::computeSincFlux<float>(image, aperture);
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
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
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.