lsst.afw g776a55d5bd+f790144ad9
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lsst::afw::math::Background Class Referenceabstract

A virtual base class to evaluate image background levels. More...

#include <Background.h>

Inheritance diagram for lsst::afw::math::Background:
lsst::afw::math::BackgroundMI

Public Types

using InternalPixelT = float
 type used for any internal images, and returned by getApproximate More...
 

Public Member Functions

 Background (Background const &)=delete
 
 Background (Background &&)=delete
 
virtual ~Background ()=default
 dtor More...
 
Backgroundoperator= (Background const &)=delete
 
Backgroundoperator= (Background &&)=delete
 
virtual Backgroundoperator+= (float const delta)=0
 Add a constant level to a background. More...
 
virtual Backgroundoperator-= (float const delta)=0
 Subtract a constant level from a background. More...
 
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. More...
 
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. More...
 
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. More...
 
Interpolate::Style getAsUsedInterpStyle () const
 Return the Interpolate::Style that we actually used in the last call to getImage() More...
 
UndersampleStyle getAsUsedUndersampleStyle () const
 Return the UndersampleStyle that we actually used in the last call to getImage() More...
 
std::shared_ptr< math::Approximate< InternalPixelT > > getApproximate (ApproximateControl const &actrl, UndersampleStyle const undersampleStyle=THROW_EXCEPTION) const
 Method to return an approximation to the background. More...
 
lsst::geom::Box2I getImageBBox () const
 Return the input image's (PARENT) bounding box. More...
 
std::shared_ptr< BackgroundControlgetBackgroundControl ()
 
std::shared_ptr< BackgroundControl const > getBackgroundControl () const
 

Protected Member Functions

template<typename ImageT >
 Background (ImageT const &img, BackgroundControl const &bgCtrl)
 Constructor for Background. More...
 
 Background (lsst::geom::Box2I const imageBBox, int const nx, int const ny)
 Create a Background without any values in it. More...
 

Protected Attributes

lsst::geom::Box2I _imgBBox
 size and origin of input image More...
 
std::shared_ptr< BackgroundControl_bctrl
 control info set by user. More...
 
Interpolate::Style _asUsedInterpStyle
 the style we actually used More...
 
UndersampleStyle _asUsedUndersampleStyle
 the undersampleStyle we actually used More...
 
std::vector< double > _xcen
 x center pix coords of sub images More...
 
std::vector< double > _ycen
 y center ... More...
 
std::vector< int > _xorig
 x origin pix coords of sub images More...
 
std::vector< int > _yorig
 y origin ... More...
 
std::vector< int > _xsize
 x size of sub images More...
 
std::vector< int > _ysize
 y size ... More...
 

Detailed Description

A virtual base class to evaluate image background levels.

Definition at line 235 of file Background.h.

Member Typedef Documentation

◆ InternalPixelT

type used for any internal images, and returned by getApproximate

Definition at line 262 of file Background.h.

Constructor & Destructor Documentation

◆ Background() [1/4]

template<typename ImageT >
lsst::afw::math::Background::Background ( ImageT const &  img,
BackgroundControl const &  bgCtrl 
)
explicitprotected

Constructor for Background.

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

Parameters
imgImageT (or MaskedImage) whose properties we want
bgCtrlControl how the Background is estimated

Definition at line 44 of file Background.cc.

◆ Background() [2/4]

lsst::afw::math::Background::Background ( lsst::geom::Box2I const  imageBBox,
int const  nx,
int const  ny 
)
explicitprotected

Create a Background without any values in it.

Parameters
imageBBoxBounding box for image to be created by getImage()
nxNumber of samples in x-direction
nyNumber of samples in y-direction
Note
This ctor is mostly used to create a Background given its sample values, and that (in turn) is mostly used to implement persistence.

Definition at line 69 of file Background.cc.

◆ Background() [3/4]

lsst::afw::math::Background::Background ( Background const &  )
delete

◆ Background() [4/4]

lsst::afw::math::Background::Background ( Background &&  )
delete

◆ ~Background()

virtual lsst::afw::math::Background::~Background ( )
virtualdefault

dtor

Member Function Documentation

◆ getApproximate()

std::shared_ptr< math::Approximate< InternalPixelT > > lsst::afw::math::Background::getApproximate ( ApproximateControl const &  actrl,
UndersampleStyle const  undersampleStyle = THROW_EXCEPTION 
) const
inline

Method to return an approximation to the background.

Parameters
actrlApproximation style
undersampleStyleBehaviour if there are too few points

Definition at line 348 of file Background.h.

◆ getAsUsedInterpStyle()

Interpolate::Style lsst::afw::math::Background::getAsUsedInterpStyle ( ) const
inline

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 337 of file Background.h.

◆ getAsUsedUndersampleStyle()

UndersampleStyle lsst::afw::math::Background::getAsUsedUndersampleStyle ( ) const
inline

Return the UndersampleStyle that we actually used in the last call to getImage()

Definition at line 341 of file Background.h.

◆ getBackgroundControl() [1/2]

std::shared_ptr< BackgroundControl > lsst::afw::math::Background::getBackgroundControl ( )
inline

Definition at line 359 of file Background.h.

◆ getBackgroundControl() [2/2]

std::shared_ptr< BackgroundControl const > lsst::afw::math::Background::getBackgroundControl ( ) const
inline

Definition at line 360 of file Background.h.

◆ getImage() [1/5]

template<typename PixelT >
std::shared_ptr< lsst::afw::image::Image< PixelT > > lsst::afw::math::Background::getImage ( ) const
inline

Method to interpolate and return the background for entire image.

Definition at line 329 of file Background.h.

◆ getImage() [2/5]

template<typename PixelT >
std::shared_ptr< lsst::afw::image::Image< PixelT > > lsst::afw::math::Background::getImage ( Interpolate::Style const  interpStyle,
UndersampleStyle const  undersampleStyle = THROW_EXCEPTION 
) const
inline

Method to interpolate and return the background for entire image.

Parameters
interpStyleStyle of the interpolation
undersampleStyleBehaviour if there are too few points
Returns
A boost shared-pointer to an image containing the estimated background

Definition at line 283 of file Background.h.

◆ getImage() [3/5]

template<typename PixelT >
std::shared_ptr< lsst::afw::image::Image< PixelT > > lsst::afw::math::Background::getImage ( lsst::geom::Box2I const &  bbox,
Interpolate::Style const  interpStyle,
UndersampleStyle const  undersampleStyle = THROW_EXCEPTION 
) const
inline
Parameters
bboxBounding box for sub-image
interpStyleStyle of the interpolation
undersampleStyleBehaviour if there are too few points

Definition at line 307 of file Background.h.

◆ getImage() [4/5]

template<typename PixelT >
std::shared_ptr< lsst::afw::image::Image< PixelT > > lsst::afw::math::Background::getImage ( lsst::geom::Box2I const &  bbox,
std::string const &  interpStyle,
std::string const &  undersampleStyle = "THROW_EXCEPTION" 
) const
inline
Parameters
bboxBounding box for sub-image
interpStyleStyle of the interpolation
undersampleStyleBehaviour if there are too few points

Definition at line 318 of file Background.h.

◆ getImage() [5/5]

template<typename PixelT >
std::shared_ptr< lsst::afw::image::Image< PixelT > > lsst::afw::math::Background::getImage ( std::string const &  interpStyle,
std::string const &  undersampleStyle = "THROW_EXCEPTION" 
) const
inline

Method to interpolate and return the background for entire image.

Parameters
interpStyleStyle of the interpolation
undersampleStyleBehaviour if there are too few points
Returns
A boost shared-pointer to an image containing the estimated background

Definition at line 296 of file Background.h.

◆ getImageBBox()

lsst::geom::Box2I lsst::afw::math::Background::getImageBBox ( ) const
inline

Return the input image's (PARENT) bounding box.

Definition at line 357 of file Background.h.

◆ operator+=()

virtual Background & lsst::afw::math::Background::operator+= ( float const  delta)
pure virtual

Add a constant level to a background.

Implemented in lsst::afw::math::BackgroundMI.

◆ operator-=()

virtual Background & lsst::afw::math::Background::operator-= ( float const  delta)
pure virtual

Subtract a constant level from a background.

Implemented in lsst::afw::math::BackgroundMI.

◆ operator=() [1/2]

Background & lsst::afw::math::Background::operator= ( Background &&  )
delete

◆ operator=() [2/2]

Background & lsst::afw::math::Background::operator= ( Background const &  )
delete

Member Data Documentation

◆ _asUsedInterpStyle

Interpolate::Style lsst::afw::math::Background::_asUsedInterpStyle
mutableprotected

the style we actually used

Definition at line 365 of file Background.h.

◆ _asUsedUndersampleStyle

UndersampleStyle lsst::afw::math::Background::_asUsedUndersampleStyle
mutableprotected

the undersampleStyle we actually used

Definition at line 366 of file Background.h.

◆ _bctrl

std::shared_ptr<BackgroundControl> lsst::afw::math::Background::_bctrl
protected

control info set by user.

Definition at line 364 of file Background.h.

◆ _imgBBox

lsst::geom::Box2I lsst::afw::math::Background::_imgBBox
protected

size and origin of input image

Definition at line 363 of file Background.h.

◆ _xcen

std::vector<double> lsst::afw::math::Background::_xcen
protected

x center pix coords of sub images

Definition at line 368 of file Background.h.

◆ _xorig

std::vector<int> lsst::afw::math::Background::_xorig
protected

x origin pix coords of sub images

Definition at line 370 of file Background.h.

◆ _xsize

std::vector<int> lsst::afw::math::Background::_xsize
protected

x size of sub images

Definition at line 372 of file Background.h.

◆ _ycen

std::vector<double> lsst::afw::math::Background::_ycen
protected

y center ...

Definition at line 369 of file Background.h.

◆ _yorig

std::vector<int> lsst::afw::math::Background::_yorig
protected

y origin ...

Definition at line 371 of file Background.h.

◆ _ysize

std::vector<int> lsst::afw::math::Background::_ysize
protected

y size ...

Definition at line 373 of file Background.h.


The documentation for this class was generated from the following files: