LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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)
 
 BackgroundControl (int const nxSample, int const nySample, StatisticsControl const &sctrl, std::string const &prop)
 
 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)
 
 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")
 
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)
 

Private Attributes

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

Detailed Description

Pass parameters to a Background object.

Examples:
spatialCellExample.cc.

Definition at line 62 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 
)
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

Definition at line 64 of file Background.h.

71  _nxSample(nxSample), _nySample(nySample),
73  _sctrl(new StatisticsControl(sctrl)),
74  _prop(prop) {
75  if (nxSample <= 0 || nySample <= 0) {
76  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
77  str(boost::format("You must specify at least one point, not %dx%d")
78  % nxSample % nySample)
79  );
80  }
81  }
UndersampleStyle _undersampleStyle
Definition: Background.h:205
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:206
lsst.afw.math::BackgroundControl::BackgroundControl ( int const  nxSample,
int const  nySample,
StatisticsControl const &  sctrl,
std::string const &  prop 
)
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

Definition at line 86 of file Background.h.

93  _nxSample(nxSample), _nySample(nySample),
95  _sctrl(new StatisticsControl(sctrl)),
97  if (nxSample <= 0 || nySample <= 0) {
98  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
99  str(boost::format("You must specify at least one point, not %dx%d")
100  % nxSample % nySample)
101  );
102  }
103  }
UndersampleStyle _undersampleStyle
Definition: Background.h:205
#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:658
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:206
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 
)
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

Definition at line 108 of file Background.h.

116  : _style(style),
117  _nxSample(nxSample), _nySample(nySample),
118  _undersampleStyle(undersampleStyle),
119  _sctrl(new StatisticsControl(sctrl)),
120  _prop(prop) {
121  if (nxSample <= 0 || nySample <= 0) {
122  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
123  str(boost::format("You must specify at least one point, not %dx%d")
124  % nxSample % nySample)
125  );
126  }
127  }
UndersampleStyle _undersampleStyle
Definition: Background.h:205
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:206
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" 
)
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

Definition at line 134 of file Background.h.

143  _nxSample(nxSample), _nySample(nySample),
145  _sctrl(new StatisticsControl(sctrl)),
147  if (nxSample <= 0 || nySample <= 0) {
148  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
149  str(boost::format("You must specify at least one point, not %dx%d")
150  % nxSample % nySample)
151  );
152  }
153  }
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:264
UndersampleStyle _undersampleStyle
Definition: Background.h:205
#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:658
boost::shared_ptr< StatisticsControl > _sctrl
Definition: Background.h:206
virtual lsst.afw.math::BackgroundControl::~BackgroundControl ( )
inlinevirtual

Definition at line 155 of file Background.h.

155 {}

Member Function Documentation

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

Definition at line 185 of file Background.h.

185  {
186  if (_style < 0 || _style >= Interpolate::NUM_STYLES) {
187  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
188  str(boost::format("Style %d is invalid") % _style));
189 
190  }
191  return _style;
192  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
int lsst.afw.math::BackgroundControl::getNxSample ( ) const
inline

Definition at line 183 of file Background.h.

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

Definition at line 184 of file Background.h.

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

Definition at line 194 of file Background.h.

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

Definition at line 195 of file Background.h.

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

Definition at line 197 of file Background.h.

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

Definition at line 193 of file Background.h.

193 { return _undersampleStyle; }
UndersampleStyle _undersampleStyle
Definition: Background.h:205
void lsst.afw.math::BackgroundControl::setInterpStyle ( Interpolate::Style const  style)
inline

Definition at line 171 of file Background.h.

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

Definition at line 173 of file Background.h.

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

Definition at line 156 of file Background.h.

156  {
157  if (nxSample <= 0) {
158  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
159  str(boost::format("nxSample must be position, not %d") % nxSample));
160  }
161  _nxSample = nxSample;
162  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
void lsst.afw.math::BackgroundControl::setNySample ( int  nySample)
inline

Definition at line 163 of file Background.h.

163  {
164  if (nySample <= 0) {
165  throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
166  str(boost::format("nySample must be position, not %d") % nySample));
167  }
168  _nySample = nySample;
169  }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
void lsst.afw.math::BackgroundControl::setStatisticsProperty ( Property  prop)
inline

Definition at line 198 of file Background.h.

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

Definition at line 199 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:658
void lsst.afw.math::BackgroundControl::setUndersampleStyle ( UndersampleStyle const  undersampleStyle)
inline

Definition at line 175 of file Background.h.

175  {
176  _undersampleStyle = undersampleStyle;
177  }
UndersampleStyle _undersampleStyle
Definition: Background.h:205
void lsst.afw.math::BackgroundControl::setUndersampleStyle ( std::string const &  undersampleStyle)
inline

Definition at line 179 of file Background.h.

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

Member Data Documentation

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

Definition at line 203 of file Background.h.

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

Definition at line 204 of file Background.h.

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

Definition at line 207 of file Background.h.

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

Definition at line 206 of file Background.h.

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

Definition at line 202 of file Background.h.

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

Definition at line 205 of file Background.h.


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