Class Background

Inheritance Relationships

Derived Type

Class Documentation

class Background

A virtual base class to evaluate image background levels

Subclassed by lsst::afw::math::BackgroundMI

Public Types

typedef float InternalPixelT

type used for any internal images, and returned by getApproximate

Public Functions

Background(Background const&)
Background(Background&&)
Background &operator=(Background const&)
Background &operator=(Background&&)
virtual Background &operator+=(float const delta) = 0

Add a constant level to a background.

virtual Background &operator-=(float const delta) = 0

Subtract a constant level from a background.

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

Return

A boost shared-pointer to an image containing the estimated background

Parameters
  • interpStyle: Style of the interpolation

  • undersampleStyle: Behaviour if there are too few points

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

Return

A boost shared-pointer to an image containing the estimated background

Parameters
  • interpStyle: Style of the interpolation

  • undersampleStyle: Behaviour if there are too few points

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

Parameters
  • bbox: Bounding box for sub-image

  • interpStyle: Style of the interpolation

  • undersampleStyle: Behaviour if there are too few points

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

Parameters
  • bbox: Bounding box for sub-image

  • interpStyle: Style of the interpolation

  • undersampleStyle: Behaviour if there are too few points

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()

N.b. Interpolate can fallback to a lower order if there aren’t enough samples

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

Parameters
  • actrl: Approximation style

  • undersampleStyle: Behaviour if there are too few points

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 Functions

template<typename ImageT>
Background(ImageT const &img, BackgroundControl const &bgCtrl)

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

Note

The old and deprecated API specified the interpolation style as part of the BackgroundControl object passed to this ctor. This is still supported, but the work isn’t done until the getImage() method is called

Parameters
  • img: ImageT (or MaskedImage) whose properties we want

  • bgCtrl: Control how the Background is estimated

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

Create a Background without any values in it

Note

This ctor is mostly used to create a Background given its sample values, and that (in turn) is mostly used to implement persistence.

Parameters
  • imageBBox: Bounding box for image to be created by getImage()

  • nx: Number of samples in x-direction

  • ny: Number of samples in y-direction

virtual ~Background()

dtor

lsst::afw::math::Background::BOOST_PP_SEQ_FOR_EACH(LSST_makeBackground_getImage, ( Background::InternalPixelT ))

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 …