lsst.afw  tickets.DM-23835-g31c64b24f1
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  }
107  // And now the two old APIs (preserved for backward compatibility)
119  [[deprecated(
120  "Omit `style` parameter, and pass it to `Background::getImage` instead. To be removed after "
121  "20.0.0.")]] // DM-22276
123  Interpolate::Style const style, int const nxSample = 10, int const nySample = 10,
124  UndersampleStyle const undersampleStyle = THROW_EXCEPTION,
125  StatisticsControl const sctrl = StatisticsControl(), Property const prop = MEANCLIP,
127 
128  )
129  : _style(style),
130  _nxSample(nxSample),
131  _nySample(nySample),
132  _undersampleStyle(undersampleStyle),
133  _sctrl(new StatisticsControl(sctrl)),
134  _prop(prop),
135  _actrl(new ApproximateControl(actrl)) {
136  if (nxSample <= 0 || nySample <= 0) {
138  str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
139  nySample));
140  }
141  }
142 
156  [[deprecated(
157  "Omit `style` parameter, and pass it to `Background::getImage` instead. To be removed after "
158  "20.0.0.")]] // DM-22276
159  BackgroundControl(std::string const& style, int const nxSample = 10, int const nySample = 10,
160  std::string const& undersampleStyle = "THROW_EXCEPTION",
161  StatisticsControl const sctrl = StatisticsControl(),
162  std::string const& prop = "MEANCLIP",
164  1))
165  : _style(math::stringToInterpStyle(style)),
166  _nxSample(nxSample),
167  _nySample(nySample),
168  _undersampleStyle(math::stringToUndersampleStyle(undersampleStyle)),
169  _sctrl(new StatisticsControl(sctrl)),
170  _prop(stringToStatisticsProperty(prop)),
171  _actrl(new ApproximateControl(actrl)) {
172  if (nxSample <= 0 || nySample <= 0) {
174  str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
175  nySample));
176  }
177  }
178 
179  BackgroundControl(BackgroundControl const&) = default;
181  BackgroundControl& operator=(BackgroundControl const&) = default;
183 
184  virtual ~BackgroundControl() = default;
185  void setNxSample(int nxSample) {
186  if (nxSample <= 0) {
188  str(boost::format("nxSample must be position, not %d") % nxSample));
189  }
190  _nxSample = nxSample;
191  }
192  void setNySample(int nySample) {
193  if (nySample <= 0) {
195  str(boost::format("nySample must be position, not %d") % nySample));
196  }
197  _nySample = nySample;
198  }
199 
200  [[deprecated(
201  "Replaced by passing style to `Background::getImage`. To be removed after 20.0.0.")]] // DM-22276
202  void
204  _style = style;
205  }
206  // overload to take a string
207  [[deprecated(
208  "Replaced by passing style to `Background::getImage`. To be removed after 20.0.0.")]] // DM-22276
209  void
210  setInterpStyle(std::string const& style) {
211  _style = math::stringToInterpStyle(style);
212  }
213 
214  void setUndersampleStyle(UndersampleStyle const undersampleStyle) {
215  _undersampleStyle = undersampleStyle;
216  }
217  // overload to take a string
218  void setUndersampleStyle(std::string const& undersampleStyle) {
219  _undersampleStyle = math::stringToUndersampleStyle(undersampleStyle);
220  }
221 
222  int getNxSample() const { return _nxSample; }
223  int getNySample() const { return _nySample; }
224  [[deprecated(
225  "Replaced by passing style to `Background::getImage`. To be removed after 20.0.0.")]] // DM-22276
227  getInterpStyle() const {
228  if (_style < 0 || _style >= Interpolate::NUM_STYLES) {
230  str(boost::format("Style %d is invalid") % _style));
231  }
232  return _style;
233  }
234  UndersampleStyle getUndersampleStyle() const { return _undersampleStyle; }
237 
238  Property getStatisticsProperty() const { return _prop; }
239  void setStatisticsProperty(Property prop) { _prop = prop; }
241 
245 
246 private:
247  // TODO: remove _style member in DM-22276
248  Interpolate::Style _style; // style of interpolation to use
249  int _nxSample; // number of grid squares to divide image into to sample in x
250  int _nySample; // number of grid squares to divide image into to sample in y
251  UndersampleStyle _undersampleStyle; // what to do when nx,ny are too small for the requested interp style
252  std::shared_ptr<StatisticsControl> _sctrl; // statistics control object
253  Property _prop; // statistics Property
254  std::shared_ptr<ApproximateControl> _actrl; // approximate control object
255 };
256 
260 class Background {
261 protected:
275  template <typename ImageT>
276  explicit Background(ImageT const& img, BackgroundControl const& bgCtrl);
277 
288  explicit Background(lsst::geom::Box2I const imageBBox, int const nx, int const ny);
290  virtual ~Background() = default;
291 
292 public:
293  typedef float InternalPixelT;
294 
295  Background(Background const&) = delete;
296  Background(Background&&) = delete;
297  Background& operator=(Background const&) = delete;
298  Background& operator=(Background&&) = delete;
299 
301  virtual Background& operator+=(float const delta) = 0;
303  virtual Background& operator-=(float const delta) = 0;
311  template <typename PixelT>
313  Interpolate::Style const interpStyle,
314  UndersampleStyle const undersampleStyle = THROW_EXCEPTION) const {
315  return getImage<PixelT>(_imgBBox, interpStyle, undersampleStyle);
316  }
324  template <typename PixelT>
326  std::string const& interpStyle, std::string const& undersampleStyle = "THROW_EXCEPTION") const {
327  return getImage<PixelT>(math::stringToInterpStyle(interpStyle),
328  stringToUndersampleStyle(undersampleStyle));
329  }
335  template <typename PixelT>
337  lsst::geom::Box2I const& bbox, Interpolate::Style const interpStyle,
338  UndersampleStyle const undersampleStyle = THROW_EXCEPTION) const {
339  return _getImage(bbox, interpStyle, undersampleStyle, static_cast<PixelT>(0));
340  }
346  template <typename PixelT>
348  lsst::geom::Box2I const& bbox, std::string const& interpStyle,
349  std::string const& undersampleStyle = "THROW_EXCEPTION") const {
350  return _getImage(bbox, math::stringToInterpStyle(interpStyle),
351  stringToUndersampleStyle(undersampleStyle), static_cast<PixelT>(0));
352  }
353 
358  template <typename PixelT>
359  [[deprecated(
360  "Call an overload with an `interpStyle` parameter. To be removed after 20.0.0.")]] // DM-22276
362  getImage() const {
363  return getImage<PixelT>(_bctrl->getInterpStyle(), _bctrl->getUndersampleStyle());
364  }
382  ApproximateControl const& actrl,
383  UndersampleStyle const undersampleStyle = THROW_EXCEPTION) const {
384  InternalPixelT disambiguate = 0;
385  return _getApproximate(actrl, undersampleStyle, disambiguate);
386  }
391 
394 
395 protected:
400 
407  /*
408  * We want getImage to be present in the base class, but a templated virtual function
409  * is impossible. So we'll solve the dilemma with a hack: explicitly defined
410  * virtual functions for the image types we need
411  */
412 // We'll evaluate LSST_makeBackground_get{Approximation,Image} for each type in
413 // LSST_makeBackground_get{Approximation,Image}_types,
414 // setting v to the second arg (i.e. "= 0" for the first invocation). The first agument, m, is ignores
415 
416 // Desired types
417 #define LSST_makeBackground_getImage_types (Background::InternalPixelT)
418 #define LSST_makeBackground_getApproximate_types (Background::InternalPixelT)
419 #define LSST_makeBackground_getImage(m, v, T) \
420  virtual std::shared_ptr<lsst::afw::image::Image<T>> _getImage( \
421  lsst::geom::Box2I const& bbox, \
422  Interpolate::Style const interpStyle, /* Style of the interpolation */ \
423  UndersampleStyle const undersampleStyle = \
424  THROW_EXCEPTION, /* Behaviour if there are too few points */ \
425  T = 0 /* disambiguate */ \
426  ) const v;
427 
428 #define LSST_makeBackground_getApproximate(m, v, T) \
429  virtual std::shared_ptr<Approximate<T>> _getApproximate( \
430  ApproximateControl const& actrl, /* Approximation style */ \
431  UndersampleStyle const undersampleStyle = \
432  THROW_EXCEPTION, /* Behaviour if there are too few points */ \
433  T = 0 /* disambiguate */ \
434  ) const v;
435 
438 private:
443  void _setCenOrigSize(int const width, int const height, int const nxSample, int const nySample);
444 };
445 
468 class BackgroundMI : public Background {
469 public:
470  template <typename ImageT>
497  explicit BackgroundMI(ImageT const& img, BackgroundControl const& bgCtrl);
504  explicit BackgroundMI(lsst::geom::Box2I const imageDimensions,
505  image::MaskedImage<InternalPixelT> const& statsImage);
506 
507  BackgroundMI(BackgroundMI const&) = delete;
508  BackgroundMI(BackgroundMI&&) = delete;
509  BackgroundMI& operator=(BackgroundMI const&) = delete;
510  BackgroundMI& operator=(BackgroundMI&&) = delete;
511  ~BackgroundMI() override = default;
512 
518  BackgroundMI& operator+=(float const delta) override;
524  BackgroundMI& operator-=(float const delta) override;
525 
538  [[deprecated("Use `getImage` instead. To be removed after 20.0.0.")]] // DM-22276
539  double
540  getPixel(Interpolate::Style const style, int const x, int const y) const;
548  [[deprecated("Use `getImage` instead. To be removed after 20.0.0.")]] // DM-22276
549  double
550  getPixel(int const x, int const y) const {
551  // I think this should be LOCAL because the original getPixel used 0-based indices
552  return getImage<float>(_bctrl->getInterpStyle(), _bctrl->getUndersampleStyle())
554  }
559 
560 private:
562  _statsImage; // statistical properties for the grid of subimages
563  mutable std::vector<std::vector<double>> _gridColumns; // interpolated columns for the bicubic spline
564 
565  void _setGridColumns(Interpolate::Style const interpStyle, UndersampleStyle const undersampleStyle,
566  int const iX, std::vector<int> const& ypix) const;
567 
568 #if defined(LSST_makeBackground_getImage)
569  BOOST_PP_SEQ_FOR_EACH(LSST_makeBackground_getImage, override, LSST_makeBackground_getImage_types);
570  BOOST_PP_SEQ_FOR_EACH(LSST_makeBackground_getApproximate, override,
572 #undef LSST_makeBackground_getImage
573 #undef LSST_makeBackground_getApproximate
574 #endif
575  // Here's the worker function for _getImage (non-virtual; it's templated in BackgroundMI, not Background)
579  template <typename PixelT>
581  Interpolate::Style const interpStyle_,
582  UndersampleStyle const undersampleStyle) const;
583  // and for _getApproximate
584  template <typename PixelT>
585  std::shared_ptr<Approximate<PixelT>> doGetApproximate(ApproximateControl const& actrl,
586  UndersampleStyle const undersampleStyle) const;
587 };
593 template <typename ImageT>
595  return std::shared_ptr<Background>(new BackgroundMI(img, bgCtrl));
596 }
597 } // namespace math
598 } // namespace afw
599 } // namespace lsst
600 
601 #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:210
lsst::afw::image::LOCAL
Definition: ImageBase.h:94
lsst::afw::math::Interpolate::NUM_STYLES
Definition: Interpolate.h:47
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
exceptions.h
lsst::afw::math::UndersampleStyle
UndersampleStyle
Definition: Background.h:47
lsst::afw::math::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:381
lsst::afw::math::BackgroundControl::getNxSample
int getNxSample() const
Definition: Background.h:222
lsst::afw::math::Background::_ysize
std::vector< int > _ysize
y size ...
Definition: Background.h:406
std::vector< double >
lsst::afw::math::BackgroundControl::setStatisticsProperty
void setStatisticsProperty(Property prop)
Definition: Background.h:239
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:336
lsst::afw::math::BackgroundControl::getApproximateControl
std::shared_ptr< ApproximateControl > getApproximateControl()
Definition: Background.h:243
lsst::afw::math::BackgroundControl::setNySample
void setNySample(int nySample)
Definition: Background.h:192
lsst::afw::math::Background::getImageBBox
lsst::geom::Box2I getImageBBox() const
Return the input image's (PARENT) bounding box.
Definition: Background.h:390
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:594
lsst::afw::math::Background::getBackgroundControl
std::shared_ptr< BackgroundControl > getBackgroundControl()
Definition: Background.h:392
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:362
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:347
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:293
lsst::afw::math::BackgroundControl::setUndersampleStyle
void setUndersampleStyle(std::string const &undersampleStyle)
Definition: Background.h:218
lsst::afw::math::THROW_EXCEPTION
Definition: Background.h:47
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:468
LSST_makeBackground_getApproximate
#define LSST_makeBackground_getApproximate(m, v, T)
Definition: Background.h:428
lsst::afw::math::BackgroundControl::getStatisticsControl
std::shared_ptr< StatisticsControl > getStatisticsControl()
Definition: Background.h:235
LSST_makeBackground_getImage_types
#define LSST_makeBackground_getImage_types
Definition: Background.h:417
lsst::afw::math::BackgroundMI::~BackgroundMI
~BackgroundMI() override=default
lsst::afw::math::Background::_yorig
std::vector< int > _yorig
y origin ...
Definition: Background.h:404
LSST_makeBackground_getImage
#define LSST_makeBackground_getImage(m, v, T)
Definition: Background.h:419
lsst::afw::math::BackgroundControl::setUndersampleStyle
void setUndersampleStyle(UndersampleStyle const undersampleStyle)
Definition: Background.h:214
lsst::afw::math::MEANCLIP
estimate sample N-sigma clipped mean (N set in StatisticsControl, default=3)
Definition: Statistics.h:72
Box.h
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:159
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:374
lsst::afw::math::Background
A virtual base class to evaluate image background levels.
Definition: Background.h:260
lsst::afw::math::Background::_xcen
std::vector< double > _xcen
x center pix coords of sub images
Definition: Background.h:401
lsst::afw::math::BackgroundControl::getNySample
int getNySample() const
Definition: Background.h:223
lsst::afw::math::Background::_bctrl
std::shared_ptr< BackgroundControl > _bctrl
control info set by user.
Definition: Background.h:397
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:558
lsst::afw::math::BackgroundMI::getPixel
double getPixel(int const x, int const y) const
Return the background value at a point.
Definition: Background.h:550
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:399
lsst::pex::exceptions::LengthError
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:325
lsst::afw::math::BackgroundControl::getApproximateControl
std::shared_ptr< ApproximateControl const > getApproximateControl() const
Definition: Background.h:244
lsst::afw::math::BackgroundControl
Pass parameters to a Background object.
Definition: Background.h:56
lsst::afw::math::BackgroundControl::setNxSample
void setNxSample(int nxSample)
Definition: Background.h:185
lsst::afw::math::Background::_xsize
std::vector< int > _xsize
x size of sub images
Definition: Background.h:405
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.
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
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:403
lsst::afw::math::BackgroundControl::getInterpStyle
Interpolate::Style getInterpStyle() const
Definition: Background.h:227
lsst::afw::math::BackgroundControl::getUndersampleStyle
UndersampleStyle getUndersampleStyle() const
Definition: Background.h:234
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:312
LSST_makeBackground_getApproximate_types
#define LSST_makeBackground_getApproximate_types
Definition: Background.h:418
lsst::pex::exceptions::InvalidParameterError
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:398
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))
Definition: Background.h:122
lsst::geom::Box2I
lsst::afw::math::Background::_imgBBox
lsst::geom::Box2I _imgBBox
size and origin of input image
Definition: Background.h:396
lsst::afw::math::BackgroundControl::setInterpStyle
void setInterpStyle(Interpolate::Style const style)
Definition: Background.h:203
lsst::afw::math::BackgroundControl::getStatisticsControl
std::shared_ptr< StatisticsControl const > getStatisticsControl() const
Definition: Background.h:236
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:240
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:370
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:393
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
Definition: Background.h:47
lsst::afw::math::Background::_ycen
std::vector< double > _ycen
y center ...
Definition: Background.h:402
lsst::afw::math::ApproximateControl::UNKNOWN
Definition: Approximate.h:52
lsst::afw::math::BackgroundControl::setApproximateControl
void setApproximateControl(std::shared_ptr< ApproximateControl > actrl)
Definition: Background.h:242
Approximate.h
lsst::afw::math::BackgroundMI::operator=
BackgroundMI & operator=(BackgroundMI const &)=delete
bbox
AmpInfoBoxKey bbox
Definition: Amplifier.cc:117
lsst::afw::math::BackgroundControl::getStatisticsProperty
Property getStatisticsProperty() const
Definition: Background.h:238