LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | List of all members
lsst::afw::math::BackgroundControl Class Reference

Pass parameters to a Background object. More...

#include <Background.h>

Public Member Functions

 BackgroundControl (int const nxSample, int const nySample, StatisticsControl const sctrl=StatisticsControl(), Property const prop=MEANCLIP, ApproximateControl const actrl=ApproximateControl(ApproximateControl::UNKNOWN, 1))
 
 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. More...
 
 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. More...
 
 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. More...
 
 BackgroundControl (BackgroundControl const &)=default
 
 BackgroundControl (BackgroundControl &&)=default
 
BackgroundControloperator= (BackgroundControl const &)=default
 
BackgroundControloperator= (BackgroundControl &&)=default
 
virtual ~BackgroundControl ()=default
 
void setNxSample (int nxSample)
 
void setNySample (int nySample)
 
void setInterpStyle (Interpolate::Style const style)
 
void setInterpStyle (std::string const &style)
 
void setUndersampleStyle (UndersampleStyle const undersampleStyle)
 
void setUndersampleStyle (std::string const &undersampleStyle)
 
int getNxSample () const
 
int getNySample () const
 
Interpolate::Style getInterpStyle () const
 
UndersampleStyle getUndersampleStyle () const
 
std::shared_ptr< StatisticsControlgetStatisticsControl ()
 
std::shared_ptr< StatisticsControl const > getStatisticsControl () const
 
Property getStatisticsProperty () const
 
void setStatisticsProperty (Property prop)
 
void setStatisticsProperty (std::string prop)
 
void setApproximateControl (std::shared_ptr< ApproximateControl > actrl)
 
std::shared_ptr< ApproximateControlgetApproximateControl ()
 
std::shared_ptr< ApproximateControl const > getApproximateControl () const
 

Detailed Description

Pass parameters to a Background object.

Definition at line 56 of file Background.h.

Constructor & Destructor Documentation

◆ BackgroundControl() [1/6]

lsst::afw::math::BackgroundControl::BackgroundControl ( int const  nxSample,
int const  nySample,
StatisticsControl const  sctrl = StatisticsControl(),
Property const  prop = MEANCLIP,
ApproximateControl const  actrl = ApproximateControl(ApproximateControl::UNKNOWN, 1) 
)
inline
Parameters
nxSampleNum. grid samples in x
nySampleNum. grid samples in y
sctrlConfiguration for Stats to be computed
propstatistical property to use for grid points
actrlconfiguration for approx to be computed

Definition at line 65 of file Background.h.

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  }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
Reports attempts to exceed implementation-defined length limits for some classes.
Definition: Runtime.h:76
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174

◆ BackgroundControl() [2/6]

lsst::afw::math::BackgroundControl::BackgroundControl ( int const  nxSample,
int const  nySample,
StatisticsControl const &  sctrl,
std::string const &  prop,
ApproximateControl const  actrl = ApproximateControl(ApproximateControl::UNKNOWN, 1) 
)
inline

Overload constructor to handle string for statistical operator.

Parameters
nxSamplenum. grid samples in x
nySamplenum. grid samples in y
sctrlconfiguration for stats to be computed
propstatistical property to use for grid points
actrlconfiguration for approx to be computed

Definition at line 91 of file Background.h.

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  }
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Definition: Statistics.cc:738

◆ BackgroundControl() [3/6]

lsst::afw::math::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) 
)
inline

Overload constructor to provide interp style.

Parameters
styleStyle of the interpolation
nxSampleNum. grid samples in x
nySampleNum. grid samples in y
undersampleStyleBehaviour if there are too few points
sctrlConfiguration for Stats to be computed
propstatistical property to use for grid points
actrlconfiguration for approx to be computed

Definition at line 118 of file Background.h.

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  }

◆ BackgroundControl() [4/6]

lsst::afw::math::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) 
)
inline

Overload constructor to handle strings for both interp and undersample styles.

Parameters
styleStyle of the interpolation
nxSamplenum. grid samples in x
nySamplenum. grid samples in y
undersampleStylebehaviour if there are too few points
sctrlconfiguration for stats to be computed
propstatistical property to use for grid points
actrlconfiguration for approx to be computed

Definition at line 149 of file Background.h.

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  }
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
Definition: Interpolate.cc:256
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.
Definition: Background.cc:117

◆ BackgroundControl() [5/6]

lsst::afw::math::BackgroundControl::BackgroundControl ( BackgroundControl const &  )
default

◆ BackgroundControl() [6/6]

lsst::afw::math::BackgroundControl::BackgroundControl ( BackgroundControl &&  )
default

◆ ~BackgroundControl()

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

Member Function Documentation

◆ getApproximateControl() [1/2]

std::shared_ptr<ApproximateControl> lsst::afw::math::BackgroundControl::getApproximateControl ( )
inline

Definition at line 219 of file Background.h.

219 { return _actrl; }

◆ getApproximateControl() [2/2]

std::shared_ptr<ApproximateControl const> lsst::afw::math::BackgroundControl::getApproximateControl ( ) const
inline

Definition at line 220 of file Background.h.

220 { return _actrl; }

◆ getInterpStyle()

Interpolate::Style lsst::afw::math::BackgroundControl::getInterpStyle ( ) const
inline

Definition at line 203 of file Background.h.

203  {
204  if (_style < 0 || _style >= Interpolate::NUM_STYLES) {
206  str(boost::format("Style %d is invalid") % _style));
207  }
208  return _style;
209  }
Reports invalid arguments.
Definition: Runtime.h:66

◆ getNxSample()

int lsst::afw::math::BackgroundControl::getNxSample ( ) const
inline

Definition at line 201 of file Background.h.

201 { return _nxSample; }

◆ getNySample()

int lsst::afw::math::BackgroundControl::getNySample ( ) const
inline

Definition at line 202 of file Background.h.

202 { return _nySample; }

◆ getStatisticsControl() [1/2]

std::shared_ptr<StatisticsControl> lsst::afw::math::BackgroundControl::getStatisticsControl ( )
inline

Definition at line 211 of file Background.h.

211 { return _sctrl; }

◆ getStatisticsControl() [2/2]

std::shared_ptr<StatisticsControl const> lsst::afw::math::BackgroundControl::getStatisticsControl ( ) const
inline

Definition at line 212 of file Background.h.

212 { return _sctrl; }

◆ getStatisticsProperty()

Property lsst::afw::math::BackgroundControl::getStatisticsProperty ( ) const
inline

Definition at line 214 of file Background.h.

214 { return _prop; }

◆ getUndersampleStyle()

UndersampleStyle lsst::afw::math::BackgroundControl::getUndersampleStyle ( ) const
inline

Definition at line 210 of file Background.h.

210 { return _undersampleStyle; }

◆ operator=() [1/2]

BackgroundControl& lsst::afw::math::BackgroundControl::operator= ( BackgroundControl &&  )
default

◆ operator=() [2/2]

BackgroundControl& lsst::afw::math::BackgroundControl::operator= ( BackgroundControl const &  )
default

◆ setApproximateControl()

void lsst::afw::math::BackgroundControl::setApproximateControl ( std::shared_ptr< ApproximateControl actrl)
inline

Definition at line 218 of file Background.h.

218 { _actrl = actrl; }

◆ setInterpStyle() [1/2]

void lsst::afw::math::BackgroundControl::setInterpStyle ( Interpolate::Style const  style)
inline

Definition at line 189 of file Background.h.

189 { _style = style; }

◆ setInterpStyle() [2/2]

void lsst::afw::math::BackgroundControl::setInterpStyle ( std::string const &  style)
inline

Definition at line 191 of file Background.h.

191 { _style = math::stringToInterpStyle(style); }

◆ setNxSample()

void lsst::afw::math::BackgroundControl::setNxSample ( int  nxSample)
inline

Definition at line 174 of file Background.h.

174  {
175  if (nxSample <= 0) {
177  str(boost::format("nxSample must be position, not %d") % nxSample));
178  }
179  _nxSample = nxSample;
180  }

◆ setNySample()

void lsst::afw::math::BackgroundControl::setNySample ( int  nySample)
inline

Definition at line 181 of file Background.h.

181  {
182  if (nySample <= 0) {
184  str(boost::format("nySample must be position, not %d") % nySample));
185  }
186  _nySample = nySample;
187  }

◆ setStatisticsProperty() [1/2]

void lsst::afw::math::BackgroundControl::setStatisticsProperty ( Property  prop)
inline

Definition at line 215 of file Background.h.

215 { _prop = prop; }

◆ setStatisticsProperty() [2/2]

void lsst::afw::math::BackgroundControl::setStatisticsProperty ( std::string  prop)
inline

Definition at line 216 of file Background.h.

216 { _prop = stringToStatisticsProperty(prop); }

◆ setUndersampleStyle() [1/2]

void lsst::afw::math::BackgroundControl::setUndersampleStyle ( std::string const &  undersampleStyle)
inline

Definition at line 197 of file Background.h.

197  {
198  _undersampleStyle = math::stringToUndersampleStyle(undersampleStyle);
199  }

◆ setUndersampleStyle() [2/2]

void lsst::afw::math::BackgroundControl::setUndersampleStyle ( UndersampleStyle const  undersampleStyle)
inline

Definition at line 193 of file Background.h.

193  {
194  _undersampleStyle = undersampleStyle;
195  }

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