LSST Applications g04e9c324dd+8c5ae1fdc5,g134cb467dc+b203dec576,g18429d2f64+358861cd2c,g199a45376c+0ba108daf9,g1fd858c14a+dd066899e3,g262e1987ae+ebfced1d55,g29ae962dfc+72fd90588e,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+b668f15bc5,g4595892280+3897dae354,g47891489e3+abcf9c3559,g4d44eb3520+fb4ddce128,g53246c7159+8c5ae1fdc5,g67b6fd64d1+abcf9c3559,g67fd3c3899+1f72b5a9f7,g74acd417e5+cb6b47f07b,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+abcf9c3559,g8d7436a09f+bcf525d20c,g8ea07a8fe4+9f5ccc88ac,g90f42f885a+6054cc57f1,g97be763408+06f794da49,g9dd6db0277+1f72b5a9f7,ga681d05dcb+7e36ad54cd,gabf8522325+735880ea63,gac2eed3f23+abcf9c3559,gb89ab40317+abcf9c3559,gbf99507273+8c5ae1fdc5,gd8ff7fe66e+1f72b5a9f7,gdab6d2f7ff+cb6b47f07b,gdc713202bf+1f72b5a9f7,gdfd2d52018+8225f2b331,ge365c994fd+375fc21c71,ge410e46f29+abcf9c3559,geaed405ab2+562b3308c0,gf9a733ac38+8c5ae1fdc5,w.2025.35
LSST Data Management Base Package
Loading...
Searching...
No Matches
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.
 
 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.
 
 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.
 
 BackgroundControl (BackgroundControl const &)=default
 
 BackgroundControl (BackgroundControl &&)=default
 
BackgroundControloperator= (BackgroundControl const &)=default
 
BackgroundControloperator= (BackgroundControl &&)=default
 
 ~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 57 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 66 of file Background.h.

70 _nxSample(nxSample),
71 _nySample(nySample),
72 _undersampleStyle(THROW_EXCEPTION),
73 _sctrl(new StatisticsControl(sctrl)),
74 _prop(prop),
75 _actrl(new ApproximateControl(actrl)) {
76 if (nxSample <= 0 || nySample <= 0) {
77 throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
78 str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
79 nySample));
80 }
81 }
#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 92 of file Background.h.

96 _nxSample(nxSample),
97 _nySample(nySample),
98 _undersampleStyle(THROW_EXCEPTION),
99 _sctrl(new StatisticsControl(sctrl)),
100 _prop(stringToStatisticsProperty(prop)),
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") % nxSample %
105 nySample));
106 }
107 }
Property stringToStatisticsProperty(std::string const property)
Conversion function to switch a string to a Property (see Statistics.h)

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

125 : _style(style),
126 _nxSample(nxSample),
127 _nySample(nySample),
128 _undersampleStyle(undersampleStyle),
129 _sctrl(new StatisticsControl(sctrl)),
130 _prop(prop),
131 _actrl(new ApproximateControl(actrl)) {
132 if (nxSample <= 0 || nySample <= 0) {
133 throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
134 str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
135 nySample));
136 }
137 }

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

155 : _style(math::stringToInterpStyle(style)),
156 _nxSample(nxSample),
157 _nySample(nySample),
158 _undersampleStyle(math::stringToUndersampleStyle(undersampleStyle)),
159 _sctrl(new StatisticsControl(sctrl)),
160 _prop(stringToStatisticsProperty(prop)),
161 _actrl(new ApproximateControl(actrl)) {
162 if (nxSample <= 0 || nySample <= 0) {
163 throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
164 str(boost::format("You must specify at least one point, not %dx%d") % nxSample %
165 nySample));
166 }
167 }
Interpolate::Style stringToInterpStyle(std::string const &style)
Conversion function to switch a string to an Interpolate::Style.
UndersampleStyle stringToUndersampleStyle(std::string const &style)
Conversion function to switch a string to an UndersampleStyle.

◆ BackgroundControl() [5/6]

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

◆ BackgroundControl() [6/6]

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

◆ ~BackgroundControl()

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

Member Function Documentation

◆ getApproximateControl() [1/2]

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

Definition at line 220 of file Background.h.

220{ return _actrl; }

◆ getApproximateControl() [2/2]

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

Definition at line 221 of file Background.h.

221{ return _actrl; }

◆ getInterpStyle()

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

Definition at line 204 of file Background.h.

204 {
205 if (_style < 0 || _style >= Interpolate::NUM_STYLES) {
206 throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
207 str(boost::format("Style %d is invalid") % _style));
208 }
209 return _style;
210 }

◆ getNxSample()

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

Definition at line 202 of file Background.h.

202{ return _nxSample; }

◆ getNySample()

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

Definition at line 203 of file Background.h.

203{ return _nySample; }

◆ getStatisticsControl() [1/2]

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

Definition at line 212 of file Background.h.

212{ return _sctrl; }

◆ getStatisticsControl() [2/2]

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

Definition at line 213 of file Background.h.

213{ return _sctrl; }

◆ getStatisticsProperty()

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

Definition at line 215 of file Background.h.

215{ return _prop; }

◆ getUndersampleStyle()

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

Definition at line 211 of file Background.h.

211{ 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 219 of file Background.h.

219{ _actrl = actrl; }

◆ setInterpStyle() [1/2]

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

Definition at line 190 of file Background.h.

190{ _style = style; }

◆ setInterpStyle() [2/2]

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

Definition at line 192 of file Background.h.

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

◆ setNxSample()

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

Definition at line 175 of file Background.h.

175 {
176 if (nxSample <= 0) {
177 throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
178 str(boost::format("nxSample must be position, not %d") % nxSample));
179 }
180 _nxSample = nxSample;
181 }

◆ setNySample()

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

Definition at line 182 of file Background.h.

182 {
183 if (nySample <= 0) {
184 throw LSST_EXCEPT(lsst::pex::exceptions::LengthError,
185 str(boost::format("nySample must be position, not %d") % nySample));
186 }
187 _nySample = nySample;
188 }

◆ setStatisticsProperty() [1/2]

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

Definition at line 216 of file Background.h.

216{ _prop = prop; }

◆ setStatisticsProperty() [2/2]

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

Definition at line 217 of file Background.h.

217{ _prop = stringToStatisticsProperty(prop); }

◆ setUndersampleStyle() [1/2]

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

Definition at line 198 of file Background.h.

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

◆ setUndersampleStyle() [2/2]

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

Definition at line 194 of file Background.h.

194 {
195 _undersampleStyle = undersampleStyle;
196 }

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