LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | 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))
 
 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))
 
virtual ~BackgroundControl ()
 
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
 
boost::shared_ptr
< StatisticsControl
getStatisticsControl ()
 
boost::shared_ptr
< StatisticsControl const > 
getStatisticsControl () const
 
Property getStatisticsProperty () const
 
void setStatisticsProperty (Property prop)
 
void setStatisticsProperty (std::string prop)
 
void setApproximateControl (boost::shared_ptr< ApproximateControl > actrl)
 
boost::shared_ptr
< ApproximateControl
getApproximateControl ()
 
boost::shared_ptr
< ApproximateControl const > 
getApproximateControl () const
 

Private Attributes

Interpolate::Style _style
 
int _nxSample
 
int _nySample
 
UndersampleStyle _undersampleStyle
 
boost::shared_ptr
< StatisticsControl
_sctrl
 
Property _prop
 
boost::shared_ptr
< ApproximateControl
_actrl
 

Detailed Description

Pass parameters to a Background object.

Examples:
spatialCellExample.cc.

Definition at line 61 of file Background.h.

Constructor & Destructor Documentation

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

72  _nxSample(nxSample), _nySample(nySample),
74  _sctrl(new StatisticsControl(sctrl)),
75  _prop(prop),
76  _actrl(new ApproximateControl(actrl)) {
77  if (nxSample <= 0 || nySample <= 0) {
78  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
79  str(boost::format("You must specify at least one point, not %dx%d")
80  % nxSample % nySample)
81  );
82  }
83  }
UndersampleStyle _undersampleStyle
Definition: Background.h:221
boost::shared_ptr< ApproximateControl > _actrl
Definition: Background.h:224
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:222
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 88 of file Background.h.

97  _nxSample(nxSample), _nySample(nySample),
99  _sctrl(new StatisticsControl(sctrl)),
101  _actrl(new ApproximateControl(actrl)) {
102  if (nxSample <= 0 || nySample <= 0) {
103  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
104  str(boost::format("You must specify at least one point, not %dx%d")
105  % nxSample % nySample)
106  );
107  }
108  }
UndersampleStyle _undersampleStyle
Definition: Background.h:221
boost::shared_ptr< ApproximateControl > _actrl
Definition: Background.h:224
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Definition: Statistics.cc:715
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:222
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 113 of file Background.h.

124  : _style(style),
125  _nxSample(nxSample), _nySample(nySample),
126  _undersampleStyle(undersampleStyle),
127  _sctrl(new StatisticsControl(sctrl)),
128  _prop(prop),
129  _actrl(new ApproximateControl(actrl)) {
130  if (nxSample <= 0 || nySample <= 0) {
131  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
132  str(boost::format("You must specify at least one point, not %dx%d")
133  % nxSample % nySample)
134  );
135  }
136  }
UndersampleStyle _undersampleStyle
Definition: Background.h:221
boost::shared_ptr< ApproximateControl > _actrl
Definition: Background.h:224
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:222
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 143 of file Background.h.

154  _nxSample(nxSample), _nySample(nySample),
156  _sctrl(new StatisticsControl(sctrl)),
158  _actrl(new ApproximateControl(actrl)) {
159  if (nxSample <= 0 || nySample <= 0) {
160  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
161  str(boost::format("You must specify at least one point, not %dx%d")
162  % nxSample % nySample)
163  );
164  }
165  }
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.
Definition: Background.cc:148
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
Definition: Interpolate.cc:262
UndersampleStyle _undersampleStyle
Definition: Background.h:221
boost::shared_ptr< ApproximateControl > _actrl
Definition: Background.h:224
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Definition: Statistics.cc:715
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:222
virtual lsst.afw.math::BackgroundControl::~BackgroundControl ( )
inlinevirtual

Definition at line 167 of file Background.h.

167 {}

Member Function Documentation

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

Definition at line 214 of file Background.h.

214 { return _actrl; }
boost::shared_ptr< ApproximateControl > _actrl
Definition: Background.h:224
boost::shared_ptr< ApproximateControl const> lsst.afw.math::BackgroundControl::getApproximateControl ( ) const
inline

Definition at line 215 of file Background.h.

215 { return _actrl; }
boost::shared_ptr< ApproximateControl > _actrl
Definition: Background.h:224
Interpolate::Style lsst.afw.math::BackgroundControl::getInterpStyle ( ) const
inline

Definition at line 197 of file Background.h.

197  {
198  if (_style < 0 || _style >= Interpolate::NUM_STYLES) {
199  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
200  str(boost::format("Style %d is invalid") % _style));
201 
202  }
203  return _style;
204  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
int lsst.afw.math::BackgroundControl::getNxSample ( ) const
inline

Definition at line 195 of file Background.h.

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

Definition at line 196 of file Background.h.

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

Definition at line 206 of file Background.h.

206 { return _sctrl; }
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:222
boost::shared_ptr< StatisticsControl const> lsst.afw.math::BackgroundControl::getStatisticsControl ( ) const
inline

Definition at line 207 of file Background.h.

207 { return _sctrl; }
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:222
Property lsst.afw.math::BackgroundControl::getStatisticsProperty ( ) const
inline

Definition at line 209 of file Background.h.

209 { return _prop; }
UndersampleStyle lsst.afw.math::BackgroundControl::getUndersampleStyle ( ) const
inline

Definition at line 205 of file Background.h.

205 { return _undersampleStyle; }
UndersampleStyle _undersampleStyle
Definition: Background.h:221
void lsst.afw.math::BackgroundControl::setApproximateControl ( boost::shared_ptr< ApproximateControl actrl)
inline

Definition at line 213 of file Background.h.

213 { _actrl = actrl; }
boost::shared_ptr< ApproximateControl > _actrl
Definition: Background.h:224
void lsst.afw.math::BackgroundControl::setInterpStyle ( Interpolate::Style const  style)
inline

Definition at line 183 of file Background.h.

183 { _style = style; }
void lsst.afw.math::BackgroundControl::setInterpStyle ( std::string const &  style)
inline

Definition at line 185 of file Background.h.

185 { _style = math::stringToInterpStyle(style); }
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
Definition: Interpolate.cc:262
void lsst.afw.math::BackgroundControl::setNxSample ( int  nxSample)
inline

Definition at line 168 of file Background.h.

168  {
169  if (nxSample <= 0) {
170  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
171  str(boost::format("nxSample must be position, not %d") % nxSample));
172  }
173  _nxSample = nxSample;
174  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
void lsst.afw.math::BackgroundControl::setNySample ( int  nySample)
inline

Definition at line 175 of file Background.h.

175  {
176  if (nySample <= 0) {
177  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
178  str(boost::format("nySample must be position, not %d") % nySample));
179  }
180  _nySample = nySample;
181  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
void lsst.afw.math::BackgroundControl::setStatisticsProperty ( Property  prop)
inline

Definition at line 210 of file Background.h.

210 { _prop = prop; }
void lsst.afw.math::BackgroundControl::setStatisticsProperty ( std::string  prop)
inline

Definition at line 211 of file Background.h.

Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)
Definition: Statistics.cc:715
void lsst.afw.math::BackgroundControl::setUndersampleStyle ( UndersampleStyle const  undersampleStyle)
inline

Definition at line 187 of file Background.h.

187  {
188  _undersampleStyle = undersampleStyle;
189  }
UndersampleStyle _undersampleStyle
Definition: Background.h:221
void lsst.afw.math::BackgroundControl::setUndersampleStyle ( std::string const &  undersampleStyle)
inline

Definition at line 191 of file Background.h.

191  {
193  }
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.
Definition: Background.cc:148
UndersampleStyle _undersampleStyle
Definition: Background.h:221

Member Data Documentation

boost::shared_ptr< ApproximateControl > lsst.afw.math::BackgroundControl::_actrl
private

Definition at line 224 of file Background.h.

int lsst.afw.math::BackgroundControl::_nxSample
private

Definition at line 219 of file Background.h.

int lsst.afw.math::BackgroundControl::_nySample
private

Definition at line 220 of file Background.h.

Property lsst.afw.math::BackgroundControl::_prop
private

Definition at line 223 of file Background.h.

boost::shared_ptr< StatisticsControl > lsst.afw.math::BackgroundControl::_sctrl
private

Definition at line 222 of file Background.h.

Interpolate::Style lsst.afw.math::BackgroundControl::_style
private

Definition at line 218 of file Background.h.

UndersampleStyle lsst.afw.math::BackgroundControl::_undersampleStyle
private

Definition at line 221 of file Background.h.


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