LSSTApplications  20.0.0
LSSTDataManagementBasePackage
Background.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008-2015 AURA/LSST.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <https://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 #if !defined(LSST_AFW_MATH_BACKGROUND_H)
26 #define LSST_AFW_MATH_BACKGROUND_H
27 /*
28  * Estimate image backgrounds
29  */
30 #include <boost/preprocessor/seq.hpp>
31 #include <memory>
32 #include "lsst/pex/exceptions.h"
33 #include "lsst/geom/Box.h"
37 
38 namespace lsst {
39 namespace afw {
40 namespace math {
41 
42 //
43 // Remember to update stringToUndersampleStyle if you change this.
44 // If this happens often, we can play CPP games to put the definition in exactly one place, although swig
45 // may not be happy (so we could think m4 thoughts instead)
46 //
52 
57 public:
65  BackgroundControl(int const nxSample, int const nySample,
66  StatisticsControl const sctrl = StatisticsControl(), Property const prop = MEANCLIP,
68  : _style(Interpolate::AKIMA_SPLINE),
69  _nxSample(nxSample),
70  _nySample(nySample),
71  _undersampleStyle(THROW_EXCEPTION),
72  _sctrl(new StatisticsControl(sctrl)),
73  _prop(prop),
74  _actrl(new ApproximateControl(actrl)) {
75  if (nxSample <= 0 || nySample <= 0) {
77  str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
78  nySample));
79  }
80  }
81 
91  BackgroundControl(int const nxSample, int const nySample, StatisticsControl const& sctrl,
92  std::string const& prop,
94  : _style(Interpolate::AKIMA_SPLINE),
95  _nxSample(nxSample),
96  _nySample(nySample),
97  _undersampleStyle(THROW_EXCEPTION),
98  _sctrl(new StatisticsControl(sctrl)),
99  _prop(stringToStatisticsProperty(prop)),
100  _actrl(new ApproximateControl(actrl)) {
101  if (nxSample <= 0 || nySample <= 0) {
103  str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
104  nySample));
105  }
106  }
118  BackgroundControl(Interpolate::Style const style, int const nxSample = 10, int const nySample = 10,
119  UndersampleStyle const undersampleStyle = THROW_EXCEPTION,
120  StatisticsControl const sctrl = StatisticsControl(), Property const prop = MEANCLIP,
122 
123  )
124  : _style(style),
125  _nxSample(nxSample),
126  _nySample(nySample),
127  _undersampleStyle(undersampleStyle),
128  _sctrl(new StatisticsControl(sctrl)),
129  _prop(prop),
130  _actrl(new ApproximateControl(actrl)) {
131  if (nxSample <= 0 || nySample <= 0) {
133  str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
134  nySample));
135  }
136  }
137 
149  BackgroundControl(std::string const& style, int const nxSample = 10, int const nySample = 10,
150  std::string const& undersampleStyle = "THROW_EXCEPTION",
151  StatisticsControl const sctrl = StatisticsControl(),
152  std::string const& prop = "MEANCLIP",
154  : _style(math::stringToInterpStyle(style)),
155  _nxSample(nxSample),
156  _nySample(nySample),
157  _undersampleStyle(math::stringToUndersampleStyle(undersampleStyle)),
158  _sctrl(new StatisticsControl(sctrl)),
159  _prop(stringToStatisticsProperty(prop)),
160  _actrl(new ApproximateControl(actrl)) {
161  if (nxSample <= 0 || nySample <= 0) {
163  str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
164  nySample));
165  }
166  }
167 
172 
173  virtual ~BackgroundControl() = default;
174  void setNxSample(int nxSample) {
175  if (nxSample <= 0) {
177  str(boost::format("nxSample must be position, not %d") % nxSample));
178  }
179  _nxSample = nxSample;
180  }
181  void setNySample(int nySample) {
182  if (nySample <= 0) {
184  str(boost::format("nySample must be position, not %d") % nySample));
185  }
186  _nySample = nySample;
187  }
188 
189  void setInterpStyle(Interpolate::Style const style) { _style = style; }
190  // overload to take a string
191  void setInterpStyle(std::string const& style) { _style = math::stringToInterpStyle(style); }
192 
193  void setUndersampleStyle(UndersampleStyle const undersampleStyle) {
194  _undersampleStyle = undersampleStyle;
195  }
196  // overload to take a string
197  void setUndersampleStyle(std::string const& undersampleStyle) {
198  _undersampleStyle = math::stringToUndersampleStyle(undersampleStyle);
199  }
200 
201  int getNxSample() const { return _nxSample; }
202  int getNySample() const { return _nySample; }
204  if (_style < 0 || _style >= Interpolate::NUM_STYLES) {
206  str(boost::format("Style %d is invalid") % _style));
207  }
208  return _style;
209  }
210  UndersampleStyle getUndersampleStyle() const { return _undersampleStyle; }
213 
214  Property getStatisticsProperty() const { return _prop; }
215  void setStatisticsProperty(Property prop) { _prop = prop; }
217 
221 
222 private:
223  Interpolate::Style _style; // style of interpolation to use
224  int _nxSample; // number of grid squares to divide image into to sample in x
225  int _nySample; // number of grid squares to divide image into to sample in y
226  UndersampleStyle _undersampleStyle; // what to do when nx,ny are too small for the requested interp style
227  std::shared_ptr<StatisticsControl> _sctrl; // statistics control object
228  Property _prop; // statistics Property
229  std::shared_ptr<ApproximateControl> _actrl; // approximate control object
230 };
231 
235 class Background {
236 protected:
246  template <typename ImageT>
247  explicit Background(ImageT const& img, BackgroundControl const& bgCtrl);
248 
259  explicit Background(lsst::geom::Box2I const imageBBox, int const nx, int const ny);
261  virtual ~Background() = default;
262 
263 public:
264  typedef float InternalPixelT;
265 
266  Background(Background const&) = delete;
267  Background(Background&&) = delete;
268  Background& operator=(Background const&) = delete;
270 
272  virtual Background& operator+=(float const delta) = 0;
274  virtual Background& operator-=(float const delta) = 0;
282  template <typename PixelT>
284  Interpolate::Style const interpStyle,
285  UndersampleStyle const undersampleStyle = THROW_EXCEPTION) const {
286  return getImage<PixelT>(_imgBBox, interpStyle, undersampleStyle);
287  }
295  template <typename PixelT>
297  std::string const& interpStyle, std::string const& undersampleStyle = "THROW_EXCEPTION") const {
298  return getImage<PixelT>(math::stringToInterpStyle(interpStyle),
299  stringToUndersampleStyle(undersampleStyle));
300  }
306  template <typename PixelT>
308  lsst::geom::Box2I const& bbox, Interpolate::Style const interpStyle,
309  UndersampleStyle const undersampleStyle = THROW_EXCEPTION) const {
310  return _getImage(bbox, interpStyle, undersampleStyle, static_cast<PixelT>(0));
311  }
317  template <typename PixelT>
319  lsst::geom::Box2I const& bbox, std::string const& interpStyle,
320  std::string const& undersampleStyle = "THROW_EXCEPTION") const {
321  return _getImage(bbox, math::stringToInterpStyle(interpStyle),
322  stringToUndersampleStyle(undersampleStyle), static_cast<PixelT>(0));
323  }
324 
328  template <typename PixelT>
330  return getImage<PixelT>(_bctrl->getInterpStyle(), _bctrl->getUndersampleStyle());
331  }
349  ApproximateControl const& actrl,
350  UndersampleStyle const undersampleStyle = THROW_EXCEPTION) const {
351  InternalPixelT disambiguate = 0;
352  return _getApproximate(actrl, undersampleStyle, disambiguate);
353  }
358 
361 
362 protected:
367 
374  /*
375  * We want getImage to be present in the base class, but a templated virtual function
376  * is impossible. So we'll solve the dilemma with a hack: explicitly defined
377  * virtual functions for the image types we need
378  */
379 // We'll evaluate LSST_makeBackground_get{Approximation,Image} for each type in
380 // LSST_makeBackground_get{Approximation,Image}_types,
381 // setting v to the second arg (i.e. "= 0" for the first invocation). The first agument, m, is ignores
382 
383 // Desired types
384 #define LSST_makeBackground_getImage_types (Background::InternalPixelT)
385 #define LSST_makeBackground_getApproximate_types (Background::InternalPixelT)
386 #define LSST_makeBackground_getImage(m, v, T) \
387  virtual std::shared_ptr<lsst::afw::image::Image<T>> _getImage( \
388  lsst::geom::Box2I const& bbox, \
389  Interpolate::Style const interpStyle, /* Style of the interpolation */ \
390  UndersampleStyle const undersampleStyle = \
391  THROW_EXCEPTION, /* Behaviour if there are too few points */ \
392  T = 0 /* disambiguate */ \
393  ) const v;
394 
395 #define LSST_makeBackground_getApproximate(m, v, T) \
396  virtual std::shared_ptr<Approximate<T>> _getApproximate( \
397  ApproximateControl const& actrl, /* Approximation style */ \
398  UndersampleStyle const undersampleStyle = \
399  THROW_EXCEPTION, /* Behaviour if there are too few points */ \
400  T = 0 /* disambiguate */ \
401  ) const v;
402 
405 private:
410  void _setCenOrigSize(int const width, int const height, int const nxSample, int const nySample);
411 };
412 
434 class BackgroundMI : public Background {
435 public:
436  template <typename ImageT>
458  explicit BackgroundMI(ImageT const& img, BackgroundControl const& bgCtrl);
465  explicit BackgroundMI(lsst::geom::Box2I const imageDimensions,
466  image::MaskedImage<InternalPixelT> const& statsImage);
467 
468  BackgroundMI(BackgroundMI const&) = delete;
472  ~BackgroundMI() override = default;
473 
479  BackgroundMI& operator+=(float const delta) override;
485  BackgroundMI& operator-=(float const delta) override;
486 
499  [[deprecated("Use `getImage` instead. To be removed after 20.0.0.")]] // DM-22814
500  double
501  getPixel(Interpolate::Style const style, int const x, int const y) const;
507  [[deprecated("Use `getImage` instead. To be removed after 20.0.0.")]] // DM-22814
508  double
509  getPixel(int const x, int const y) const {
510  // I think this should be LOCAL because the original getPixel used 0-based indices
511  return getImage<float>()->get(lsst::geom::Point2I(x, y), image::LOCAL);
512  }
517 
518 private:
520  _statsImage; // statistical properties for the grid of subimages
521  mutable std::vector<std::vector<double>> _gridColumns; // interpolated columns for the bicubic spline
522 
523  void _setGridColumns(Interpolate::Style const interpStyle, UndersampleStyle const undersampleStyle,
524  int const iX, std::vector<int> const& ypix) const;
525 
526 #if defined(LSST_makeBackground_getImage)
527  BOOST_PP_SEQ_FOR_EACH(LSST_makeBackground_getImage, override, LSST_makeBackground_getImage_types);
528  BOOST_PP_SEQ_FOR_EACH(LSST_makeBackground_getApproximate, override,
530 #undef LSST_makeBackground_getImage
531 #undef LSST_makeBackground_getApproximate
532 #endif
533  // Here's the worker function for _getImage (non-virtual; it's templated in BackgroundMI, not Background)
537  template <typename PixelT>
539  Interpolate::Style const interpStyle_,
540  UndersampleStyle const undersampleStyle) const;
541  // and for _getApproximate
542  template <typename PixelT>
543  std::shared_ptr<Approximate<PixelT>> doGetApproximate(ApproximateControl const& actrl,
544  UndersampleStyle const undersampleStyle) const;
545 };
551 template <typename ImageT>
553  return std::shared_ptr<Background>(new BackgroundMI(img, bgCtrl));
554 }
555 } // namespace math
556 } // namespace afw
557 } // namespace lsst
558 
559 #endif // LSST_AFW_MATH_BACKGROUND_H
y
int y
Definition: SpanSet.cc:49
lsst::afw::math::stringToInterpStyle
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
Definition: Interpolate.cc:257
lsst::afw::math::BackgroundControl::setInterpStyle
void setInterpStyle(std::string const &style)
Definition: Background.h:191
lsst::afw::image::LOCAL
@ LOCAL
Definition: ImageBase.h:94
lsst::afw::math::Interpolate::NUM_STYLES
@ NUM_STYLES
Definition: Interpolate.h:47
Box.h
lsst::afw::math::Background::operator=
Background & operator=(Background &&)=delete
lsst::afw::math::BackgroundMI::BackgroundMI
BackgroundMI(ImageT const &img, BackgroundControl const &bgCtrl)
Constructor for BackgroundMI.
Definition: BackgroundMI.cc:81
lsst::afw::math::BackgroundControl::BackgroundControl
BackgroundControl(int const nxSample, int const nySample, StatisticsControl const &sctrl, std::string const &prop, ApproximateControl const actrl=ApproximateControl(ApproximateControl::UNKNOWN, 1))
Overload constructor to handle string for statistical operator.
Definition: Background.h:91
lsst::afw::math::UndersampleStyle
UndersampleStyle
Definition: Background.h:47
lsst::afw::math::REDUCE_INTERP_ORDER
@ REDUCE_INTERP_ORDER
Definition: Background.h:47
std::string
STL class.
std::shared_ptr
STL class.
lsst::afw::math::Background::getApproximate
std::shared_ptr< math::Approximate< InternalPixelT > > getApproximate(ApproximateControl const &actrl, UndersampleStyle const undersampleStyle=THROW_EXCEPTION) const
Method to return an approximation to the background.
Definition: Background.h:348
lsst::afw::math::BackgroundControl::getNxSample
int getNxSample() const
Definition: Background.h:201
lsst::afw::math::BackgroundMI::operator=
BackgroundMI & operator=(BackgroundMI &&)=delete
lsst::afw::math::Background::_ysize
std::vector< int > _ysize
y size ...
Definition: Background.h:373
std::vector< double >
lsst::afw::math::BackgroundControl::setStatisticsProperty
void setStatisticsProperty(Property prop)
Definition: Background.h:215
lsst::afw::math::Background::getImage
std::shared_ptr< lsst::afw::image::Image< PixelT > > getImage(lsst::geom::Box2I const &bbox, Interpolate::Style const interpStyle, UndersampleStyle const undersampleStyle=THROW_EXCEPTION) const
Definition: Background.h:307
lsst::afw::math::BackgroundControl::getApproximateControl
std::shared_ptr< ApproximateControl > getApproximateControl()
Definition: Background.h:219
lsst::afw::math::BackgroundControl::setNySample
void setNySample(int nySample)
Definition: Background.h:181
lsst::afw::math::Background::getImageBBox
lsst::geom::Box2I getImageBBox() const
Return the input image's (PARENT) bounding box.
Definition: Background.h:357
lsst::afw::math::Background::Background
Background(Background &&)=delete
lsst::afw::math::makeBackground
std::shared_ptr< Background > makeBackground(ImageT const &img, BackgroundControl const &bgCtrl)
A convenience function that uses function overloading to make the correct type of Background.
Definition: Background.h:552
pex.config.history.format
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
lsst::ip::diffim::detail::PixelT
float PixelT
Definition: AssessSpatialKernelVisitor.cc:208
lsst::afw
Definition: imageAlgorithm.dox:1
lsst::afw::math::Background::getBackgroundControl
std::shared_ptr< BackgroundControl > getBackgroundControl()
Definition: Background.h:359
lsst::afw::math::Background::getImage
std::shared_ptr< lsst::afw::image::Image< PixelT > > getImage() const
Method to interpolate and return the background for entire image.
Definition: Background.h:329
lsst::afw::math::Background::Background
Background(ImageT const &img, BackgroundControl const &bgCtrl)
Constructor for Background.
Definition: Background.cc:44
lsst::afw::math::Background::getImage
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
Definition: Background.h:318
lsst::afw::math::BackgroundControl::BackgroundControl
BackgroundControl(int const nxSample, int const nySample, StatisticsControl const sctrl=StatisticsControl(), Property const prop=MEANCLIP, ApproximateControl const actrl=ApproximateControl(ApproximateControl::UNKNOWN, 1))
Definition: Background.h:65
lsst::afw::math::Background::InternalPixelT
float InternalPixelT
type used for any internal images, and returned by getApproximate
Definition: Background.h:264
lsst::afw::math::BackgroundControl::setUndersampleStyle
void setUndersampleStyle(std::string const &undersampleStyle)
Definition: Background.h:197
lsst::afw::math::THROW_EXCEPTION
@ THROW_EXCEPTION
Definition: Background.h:47
lsst::afw::math::BackgroundMI::BackgroundMI
BackgroundMI(BackgroundMI &&)=delete
lsst::afw::math::stringToStatisticsProperty
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Definition: Statistics.cc:747
lsst::afw::math::BackgroundMI
A class to evaluate image background levels.
Definition: Background.h:434
LSST_makeBackground_getApproximate
#define LSST_makeBackground_getApproximate(m, v, T)
Definition: Background.h:395
lsst::afw::math::BackgroundControl::getStatisticsControl
std::shared_ptr< StatisticsControl > getStatisticsControl()
Definition: Background.h:211
LSST_makeBackground_getImage_types
#define LSST_makeBackground_getImage_types
Definition: Background.h:384
lsst::afw::math::BackgroundMI::~BackgroundMI
~BackgroundMI() override=default
lsst::afw::math::Background::_yorig
std::vector< int > _yorig
y origin ...
Definition: Background.h:371
LSST_makeBackground_getImage
#define LSST_makeBackground_getImage(m, v, T)
Definition: Background.h:386
lsst::afw::math::BackgroundControl::setUndersampleStyle
void setUndersampleStyle(UndersampleStyle const undersampleStyle)
Definition: Background.h:193
lsst::afw::math::MEANCLIP
@ MEANCLIP
estimate sample N-sigma clipped mean (N set in StatisticsControl, default=3)
Definition: Statistics.h:72
Interpolate.h
lsst::afw::math::BackgroundControl::BackgroundControl
BackgroundControl(std::string const &style, int const nxSample=10, int const nySample=10, std::string const &undersampleStyle="THROW_EXCEPTION", StatisticsControl const sctrl=StatisticsControl(), std::string const &prop="MEANCLIP", ApproximateControl const actrl=ApproximateControl(ApproximateControl::UNKNOWN, 1))
Overload constructor to handle strings for both interp and undersample styles.
Definition: Background.h:149
lsst::afw::image::MaskedImage< InternalPixelT >
lsst::afw::math::Background::getAsUsedUndersampleStyle
UndersampleStyle getAsUsedUndersampleStyle() const
Return the UndersampleStyle that we actually used in the last call to getImage()
Definition: Background.h:341
lsst::afw::math::Background
A virtual base class to evaluate image background levels.
Definition: Background.h:235
lsst::afw::math::Background::_xcen
std::vector< double > _xcen
x center pix coords of sub images
Definition: Background.h:368
lsst::afw::math::BackgroundControl::getNySample
int getNySample() const
Definition: Background.h:202
lsst::afw::math::Background::_bctrl
std::shared_ptr< BackgroundControl > _bctrl
control info set by user.
Definition: Background.h:364
lsst::afw::math::BackgroundMI::getStatsImage
lsst::afw::image::MaskedImage< InternalPixelT > getStatsImage() const
Return the image of statistical quantities extracted from the image.
Definition: Background.h:516
lsst::afw::math::BackgroundMI::getPixel
double getPixel(int const x, int const y) const
Return the background value at a point.
Definition: Background.h:509
lsst::afw::math::Background::operator=
Background & operator=(Background const &)=delete
lsst::afw::math::Interpolate::Style
Style
Definition: Interpolate.h:38
x
double x
Definition: ChebyshevBoundedField.cc:277
lsst::afw::math::Background::_asUsedUndersampleStyle
UndersampleStyle _asUsedUndersampleStyle
the undersampleStyle we actually used
Definition: Background.h:366
lsst::pex::exceptions::LengthError
Reports attempts to exceed implementation-defined length limits for some classes.
Definition: Runtime.h:76
lsst::afw::math::BackgroundControl::operator=
BackgroundControl & operator=(BackgroundControl const &)=default
lsst::afw::math::BackgroundMI::getPixel
double getPixel(Interpolate::Style const style, int const x, int const y) const
Method to retrieve the background level at a pixel coord.
Definition: BackgroundMI.cc:180
lsst::afw::math::Background::getImage
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.
Definition: Background.h:296
lsst::afw::math::BackgroundControl::getApproximateControl
std::shared_ptr< ApproximateControl const > getApproximateControl() const
Definition: Background.h:220
lsst::afw::math::BackgroundControl
Pass parameters to a Background object.
Definition: Background.h:56
lsst::afw::math::BackgroundMI::BackgroundMI
BackgroundMI(BackgroundMI const &)=delete
lsst::afw::math::BackgroundControl::setNxSample
void setNxSample(int nxSample)
Definition: Background.h:174
lsst::afw::math::Background::_xsize
std::vector< int > _xsize
x size of sub images
Definition: Background.h:372
lsst::afw::math::BackgroundControl::BackgroundControl
BackgroundControl(BackgroundControl const &)=default
lsst::afw::table::BOOST_PP_SEQ_FOR_EACH
BOOST_PP_SEQ_FOR_EACH(INSTANTIATE_COLUMNVIEW_SCALAR, _, BOOST_PP_TUPLE_TO_SEQ(AFW_TABLE_SCALAR_FIELD_TYPE_N, AFW_TABLE_SCALAR_FIELD_TYPE_TUPLE)) BOOST_PP_SEQ_FOR_EACH(INSTANTIATE_COLUMNVIEW_ARRAY
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::afw::math::BackgroundMI::operator+=
BackgroundMI & operator+=(float const delta) override
Add a scalar to the Background (equivalent to adding a constant to the original image)
Definition: BackgroundMI.cc:170
lsst::afw::math::Background::_xorig
std::vector< int > _xorig
x origin pix coords of sub images
Definition: Background.h:370
lsst::afw::math::BackgroundControl::getInterpStyle
Interpolate::Style getInterpStyle() const
Definition: Background.h:203
lsst::afw::math::BackgroundControl::getUndersampleStyle
UndersampleStyle getUndersampleStyle() const
Definition: Background.h:210
lsst::afw::math::StatisticsControl
Pass parameters to a Statistics object.
Definition: Statistics.h:93
lsst::afw::math::BackgroundControl::~BackgroundControl
virtual ~BackgroundControl()=default
lsst::afw::math::Background::getImage
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.
Definition: Background.h:283
LSST_makeBackground_getApproximate_types
#define LSST_makeBackground_getApproximate_types
Definition: Background.h:385
lsst::pex::exceptions::InvalidParameterError
Reports invalid arguments.
Definition: Runtime.h:66
lsst::afw::math::ApproximateControl
Control how to make an approximation.
Definition: Approximate.h:48
Statistics.h
lsst::afw::math::Background::_asUsedInterpStyle
Interpolate::Style _asUsedInterpStyle
the style we actually used
Definition: Background.h:365
lsst::geom::Point< int, 2 >
lsst::afw::math::BackgroundControl::BackgroundControl
BackgroundControl(Interpolate::Style const style, int const nxSample=10, int const nySample=10, UndersampleStyle const undersampleStyle=THROW_EXCEPTION, StatisticsControl const sctrl=StatisticsControl(), Property const prop=MEANCLIP, ApproximateControl const actrl=ApproximateControl(ApproximateControl::UNKNOWN, 1))
Overload constructor to provide interp style.
Definition: Background.h:118
lsst::geom::Box2I
An integer coordinate rectangle.
Definition: Box.h:55
lsst::afw::math::Background::_imgBBox
lsst::geom::Box2I _imgBBox
size and origin of input image
Definition: Background.h:363
lsst::afw::math::BackgroundControl::setInterpStyle
void setInterpStyle(Interpolate::Style const style)
Definition: Background.h:189
lsst::afw::math::BackgroundControl::BackgroundControl
BackgroundControl(BackgroundControl &&)=default
lsst::afw::math::BackgroundControl::getStatisticsControl
std::shared_ptr< StatisticsControl const > getStatisticsControl() const
Definition: Background.h:212
lsst::afw::math::Background::operator+=
virtual Background & operator+=(float const delta)=0
Add a constant level to a background.
lsst::afw::math::Background::operator-=
virtual Background & operator-=(float const delta)=0
Subtract a constant level from a background.
lsst::afw::math::Interpolate
Definition: Interpolate.h:36
lsst::afw::math::BackgroundControl::setStatisticsProperty
void setStatisticsProperty(std::string prop)
Definition: Background.h:216
lsst::afw::math::Background::getAsUsedInterpStyle
Interpolate::Style getAsUsedInterpStyle() const
Return the Interpolate::Style that we actually used in the last call to getImage()
Definition: Background.h:337
lsst::afw::math::Property
Property
control what is calculated
Definition: Statistics.h:63
lsst::afw::math::Background::getBackgroundControl
std::shared_ptr< BackgroundControl const > getBackgroundControl() const
Definition: Background.h:360
lsst::afw::math::stringToUndersampleStyle
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.
Definition: Background.cc:117
lsst::afw::math::Background::~Background
virtual ~Background()=default
dtor
lsst::afw::math::BackgroundMI::operator-=
BackgroundMI & operator-=(float const delta) override
Subtract a scalar from the Background (equivalent to subtracting a constant from the original image)
Definition: BackgroundMI.cc:175
lsst::afw::math::INCREASE_NXNYSAMPLE
@ INCREASE_NXNYSAMPLE
Definition: Background.h:47
lsst::afw::math::Background::_ycen
std::vector< double > _ycen
y center ...
Definition: Background.h:369
lsst::afw::math::ApproximateControl::UNKNOWN
@ UNKNOWN
Definition: Approximate.h:52
lsst::afw::math::BackgroundControl::setApproximateControl
void setApproximateControl(std::shared_ptr< ApproximateControl > actrl)
Definition: Background.h:218
Approximate.h
lsst::afw::math::BackgroundMI::operator=
BackgroundMI & operator=(BackgroundMI const &)=delete
exceptions.h
lsst::afw::math::BackgroundControl::operator=
BackgroundControl & operator=(BackgroundControl &&)=default
bbox
AmpInfoBoxKey bbox
Definition: Amplifier.cc:117
lsst::afw::math::Background::Background
Background(Background const &)=delete
lsst::afw::math::BackgroundControl::getStatisticsProperty
Property getStatisticsProperty() const
Definition: Background.h:214