LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
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))
 
 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  }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

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

◆ 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
Deprecated:
New code should specify the interpolation style in getImage, not the BackgroundControl ctor
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 122 of file Background.h.

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

◆ 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.

Deprecated:
New code should specify the interpolation style in getImage, not the BackgroundControl ctor
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 159 of file Background.h.

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  }
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.
Definition: Background.cc:117
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
Definition: Interpolate.cc:257
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Definition: Statistics.cc:747
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

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

243 { return _actrl; }

◆ getApproximateControl() [2/2]

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

Definition at line 244 of file Background.h.

244 { return _actrl; }

◆ getInterpStyle()

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

Definition at line 227 of file Background.h.

227  {
228  if (_style < 0 || _style >= Interpolate::NUM_STYLES) {
230  str(boost::format("Style %d is invalid") % _style));
231  }
232  return _style;
233  }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
Reports invalid arguments.
Definition: Runtime.h:66

◆ getNxSample()

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

Definition at line 222 of file Background.h.

222 { return _nxSample; }

◆ getNySample()

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

Definition at line 223 of file Background.h.

223 { return _nySample; }

◆ getStatisticsControl() [1/2]

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

Definition at line 235 of file Background.h.

235 { return _sctrl; }

◆ getStatisticsControl() [2/2]

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

Definition at line 236 of file Background.h.

236 { return _sctrl; }

◆ getStatisticsProperty()

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

Definition at line 238 of file Background.h.

238 { return _prop; }

◆ getUndersampleStyle()

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

Definition at line 234 of file Background.h.

234 { return _undersampleStyle; }

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ setApproximateControl()

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

Definition at line 242 of file Background.h.

242 { _actrl = actrl; }

◆ setInterpStyle() [1/2]

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

Definition at line 203 of file Background.h.

203  {
204  _style = style;
205  }

◆ setInterpStyle() [2/2]

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

Definition at line 210 of file Background.h.

210  {
211  _style = math::stringToInterpStyle(style);
212  }
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
Definition: Interpolate.cc:257

◆ setNxSample()

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

Definition at line 185 of file Background.h.

185  {
186  if (nxSample <= 0) {
188  str(boost::format("nxSample must be position, not %d") % nxSample));
189  }
190  _nxSample = nxSample;
191  }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ setNySample()

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

Definition at line 192 of file Background.h.

192  {
193  if (nySample <= 0) {
195  str(boost::format("nySample must be position, not %d") % nySample));
196  }
197  _nySample = nySample;
198  }
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174
Reports attempts to exceed implementation-defined length limits for some classes. ...
Definition: Runtime.h:76
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ setStatisticsProperty() [1/2]

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

Definition at line 239 of file Background.h.

239 { _prop = prop; }

◆ setStatisticsProperty() [2/2]

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

Definition at line 240 of file Background.h.

240 { _prop = stringToStatisticsProperty(prop); }
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Definition: Statistics.cc:747

◆ setUndersampleStyle() [1/2]

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

Definition at line 214 of file Background.h.

214  {
215  _undersampleStyle = undersampleStyle;
216  }

◆ setUndersampleStyle() [2/2]

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

Definition at line 218 of file Background.h.

218  {
219  _undersampleStyle = math::stringToUndersampleStyle(undersampleStyle);
220  }
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.
Definition: Background.cc:117

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