|
LSST Applications g00274db5b6+edbf708997,g00d0e8bbd7+edbf708997,g199a45376c+5137f08352,g1fd858c14a+1d4b6db739,g262e1987ae+f4d9505c4f,g29ae962dfc+7156fb1a53,g2cef7863aa+73c82f25e4,g35bb328faa+edbf708997,g3e17d7035e+5b3adc59f5,g3fd5ace14f+852fa6fbcb,g47891489e3+6dc8069a4c,g53246c7159+edbf708997,g64539dfbff+9f17e571f4,g67b6fd64d1+6dc8069a4c,g74acd417e5+ae494d68d9,g786e29fd12+af89c03590,g7ae74a0b1c+a25e60b391,g7aefaa3e3d+536efcc10a,g7cc15d900a+d121454f8d,g87389fa792+a4172ec7da,g89139ef638+6dc8069a4c,g8d7436a09f+28c28d8d6d,g8ea07a8fe4+db21c37724,g92c671f44c+9f17e571f4,g98df359435+b2e6376b13,g99af87f6a8+b0f4ad7b8d,gac66b60396+966efe6077,gb88ae4c679+7dec8f19df,gbaa8f7a6c5+38b34f4976,gbf99507273+edbf708997,gc24b5d6ed1+9f17e571f4,gca7fc764a6+6dc8069a4c,gcc769fe2a4+97d0256649,gd7ef33dd92+6dc8069a4c,gdab6d2f7ff+ae494d68d9,gdbb4c4dda9+9f17e571f4,ge410e46f29+6dc8069a4c,geaed405ab2+e194be0d2b,w.2025.47
LSST Data Management Base Package
|
A class to evaluate image background levels. More...
#include <Background.h>
Public Types | |
| using | InternalPixelT = float |
| type used for any internal images, and returned by getApproximate | |
Public Member Functions | |
| template<typename ImageT> | |
| BackgroundMI (ImageT const &img, BackgroundControl const &bgCtrl) | |
| Constructor for BackgroundMI. | |
| BackgroundMI (lsst::geom::Box2I const imageDimensions, image::MaskedImage< InternalPixelT > const &statsImage) | |
| Recreate a BackgroundMI from the statsImage and the original Image's BBox. | |
| BackgroundMI (BackgroundMI const &)=delete | |
| BackgroundMI (BackgroundMI &&)=delete | |
| BackgroundMI & | operator= (BackgroundMI const &)=delete |
| BackgroundMI & | operator= (BackgroundMI &&)=delete |
| ~BackgroundMI () override=default | |
| BackgroundMI & | operator+= (float const delta) override |
| Add a scalar to the Background (equivalent to adding a constant to the original image) | |
| BackgroundMI & | operator-= (float const delta) override |
| Subtract a scalar from the Background (equivalent to subtracting a constant from the original image) | |
| lsst::afw::image::MaskedImage< InternalPixelT > | getStatsImage () const |
| Return the image of statistical quantities extracted from the image. | |
| ndarray::Array< double, 1, 1 > | getBinCentersX () const |
| Return the x-coordinate centers of the bins. | |
| ndarray::Array< double, 1, 1 > | getBinCentersY () const |
| Return the y-coordinate centers of the bins. | |
| template<typename PixelT> | |
| std::shared_ptr< lsst::afw::image::Image< PixelT > > | getImage (Interpolate::Style const interpStyle, UndersampleStyle const undersampleStyle=THROW_EXCEPTION) const |
| Method to interpolate and return the background for entire image. | |
| template<typename PixelT> | |
| std::shared_ptr< lsst::afw::image::Image< PixelT > > | getImage (std::string const &interpStyle, std::string const &undersampleStyle="THROW_EXCEPTION") const |
| Method to interpolate and return the background for entire image. | |
| template<typename PixelT> | |
| std::shared_ptr< lsst::afw::image::Image< PixelT > > | getImage (lsst::geom::Box2I const &bbox, Interpolate::Style const interpStyle, UndersampleStyle const undersampleStyle=THROW_EXCEPTION) const |
| template<typename PixelT> | |
| std::shared_ptr< lsst::afw::image::Image< PixelT > > | getImage (lsst::geom::Box2I const &bbox, std::string const &interpStyle, std::string const &undersampleStyle="THROW_EXCEPTION") const |
| template<typename PixelT> | |
| std::shared_ptr< lsst::afw::image::Image< PixelT > > | getImage () const |
| Method to interpolate and return the background for entire image. | |
| Interpolate::Style | getAsUsedInterpStyle () const |
| Return the Interpolate::Style that we actually used in the last call to getImage() | |
| UndersampleStyle | getAsUsedUndersampleStyle () const |
| Return the UndersampleStyle that we actually used in the last call to getImage() | |
| std::shared_ptr< math::Approximate< InternalPixelT > > | getApproximate (ApproximateControl const &actrl, UndersampleStyle const undersampleStyle=THROW_EXCEPTION) const |
| Method to return an approximation to the background. | |
| lsst::geom::Box2I | getImageBBox () const |
| Return the input image's (PARENT) bounding box. | |
| std::shared_ptr< BackgroundControl > | getBackgroundControl () |
| std::shared_ptr< BackgroundControl const > | getBackgroundControl () const |
Protected Attributes | |
| lsst::geom::Box2I | _imgBBox |
| size and origin of input image | |
| std::shared_ptr< BackgroundControl > | _bctrl |
| control info set by user. | |
| Interpolate::Style | _asUsedInterpStyle |
| the style we actually used | |
| UndersampleStyle | _asUsedUndersampleStyle |
| the undersampleStyle we actually used | |
| std::vector< double > | _xcen |
| x center pix coords of sub images | |
| std::vector< double > | _ycen |
| y center ... | |
| std::vector< int > | _xorig |
| x origin pix coords of sub images | |
| std::vector< int > | _yorig |
| y origin ... | |
| std::vector< int > | _xsize |
| x size of sub images | |
| std::vector< int > | _ysize |
| y size ... | |
A class to evaluate image background levels.
Break an image up into nx*ny sub-images and use a statistical to estimate the background levels in each square. Then use a user-specified or algorithm to estimate background at a given pixel coordinate.
Methods are available to return the background at a point (inefficiently), or an entire background image. BackgroundControl contains a public StatisticsControl member to allow user control of how the backgrounds are computed.
math::BackgroundControl bctrl(7, 7); // number of sub-image squares in {x,y}-dimensions
bctrl.sctrl.setNumSigmaClip(5.0); // use 5-sigma clipping for the sub-image means
std::shared_ptr<math::Background> backobj = math::makeBackground(img, bctrl);
// get a whole background image
Image<PixelT> back = backobj->getImage<PixelT>(math::Interpolate::NATURAL_SPLINE);
there is also
// get the background at a pixel at i_x,i_y double someValue = backobj.getPixel(math::Interpolate::LINEAR, i_x, i_y);
Definition at line 435 of file Background.h.
|
inherited |
type used for any internal images, and returned by getApproximate
Definition at line 263 of file Background.h.
|
explicit |
Constructor for BackgroundMI.
Estimate the statistical properties of the Image in a grid of cells; we'll later call getImage() to interpolate those values, creating an image the same size as the original
| img | ImageT (or MaskedImage) whose properties we want |
| bgCtrl | Control how the BackgroundMI is estimated |
defaultValue = 10 statsImage = afwMath.cast_BackgroundMI(bkgd).getStatsImage() sim = statsImage.getImage().getArray() sim[np.isnan(sim)] = defaultValue # replace NaN by defaultValue bkgdImage = bkgd.getImageF(afwMath.Interpolate.NATURAL_SPLINE, afwMath.REDUCE_INTERP_ORDER)
There is a ticket (#2825) to allow getImage to specify a default value to use when interpolation fails
Definition at line 80 of file BackgroundMI.cc.
|
explicit |
Recreate a BackgroundMI from the statsImage and the original Image's BBox.
| imageDimensions | unbinned Image's BBox |
| statsImage | Internal stats image |
Definition at line 107 of file BackgroundMI.cc.
|
delete |
|
delete |
|
overridedefault |
|
inlineinherited |
Method to return an approximation to the background.
| actrl | Approximation style |
| undersampleStyle | Behaviour if there are too few points |
Definition at line 349 of file Background.h.
|
inlineinherited |
Return the Interpolate::Style that we actually used in the last call to getImage()
N.b. Interpolate can fallback to a lower order if there aren't enough samples
Definition at line 338 of file Background.h.
|
inlineinherited |
Return the UndersampleStyle that we actually used in the last call to getImage()
Definition at line 342 of file Background.h.
|
inlineinherited |
Definition at line 360 of file Background.h.
|
inlineinherited |
Definition at line 361 of file Background.h.
| ndarray::Array< double, 1, 1 > lsst::afw::math::BackgroundMI::getBinCentersX | ( | ) | const |
Return the x-coordinate centers of the bins.
Definition at line 179 of file BackgroundMI.cc.
| ndarray::Array< double, 1, 1 > lsst::afw::math::BackgroundMI::getBinCentersY | ( | ) | const |
Return the y-coordinate centers of the bins.
Definition at line 186 of file BackgroundMI.cc.
|
inlineinherited |
Method to interpolate and return the background for entire image.
Definition at line 330 of file Background.h.
|
inlineinherited |
Method to interpolate and return the background for entire image.
| interpStyle | Style of the interpolation |
| undersampleStyle | Behaviour if there are too few points |
Definition at line 284 of file Background.h.
|
inlineinherited |
| bbox | Bounding box for sub-image |
| interpStyle | Style of the interpolation |
| undersampleStyle | Behaviour if there are too few points |
Definition at line 308 of file Background.h.
|
inlineinherited |
| bbox | Bounding box for sub-image |
| interpStyle | Style of the interpolation |
| undersampleStyle | Behaviour if there are too few points |
Definition at line 319 of file Background.h.
|
inlineinherited |
Method to interpolate and return the background for entire image.
| interpStyle | Style of the interpolation |
| undersampleStyle | Behaviour if there are too few points |
Definition at line 297 of file Background.h.
|
inlineinherited |
|
inline |
Return the image of statistical quantities extracted from the image.
Definition at line 491 of file Background.h.
|
overridevirtual |
Add a scalar to the Background (equivalent to adding a constant to the original image)
| delta | Value to add |
Implements lsst::afw::math::Background.
Definition at line 169 of file BackgroundMI.cc.
|
overridevirtual |
Subtract a scalar from the Background (equivalent to subtracting a constant from the original image)
| delta | Value to subtract |
Implements lsst::afw::math::Background.
Definition at line 174 of file BackgroundMI.cc.
|
delete |
|
delete |
|
mutableprotectedinherited |
the style we actually used
Definition at line 366 of file Background.h.
|
mutableprotectedinherited |
the undersampleStyle we actually used
Definition at line 367 of file Background.h.
|
protectedinherited |
control info set by user.
Definition at line 365 of file Background.h.
|
protectedinherited |
size and origin of input image
Definition at line 364 of file Background.h.
|
protectedinherited |
x center pix coords of sub images
Definition at line 369 of file Background.h.
|
protectedinherited |
x origin pix coords of sub images
Definition at line 371 of file Background.h.
|
protectedinherited |
x size of sub images
Definition at line 373 of file Background.h.
|
protectedinherited |
y center ...
Definition at line 370 of file Background.h.
|
protectedinherited |
y origin ...
Definition at line 372 of file Background.h.
|
protectedinherited |
y size ...
Definition at line 374 of file Background.h.