Skip to content

Commit

Permalink
Merge pull request #584 from lsst/tickets/DM-29069
Browse files Browse the repository at this point in the history
Replace assert with exception for invalid argument
  • Loading branch information
arunkannawadi committed May 7, 2021
2 parents 2bc2b1e + 7befe53 commit fc6d2d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/lsst/afw/math/Statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,17 @@ class StatisticsControl {
bool getCalcErrorFromInputVariance() const noexcept { return _calcErrorFromInputVariance; }

void setNumSigmaClip(double numSigmaClip) {
assert(numSigmaClip > 0);
if (!(numSigmaClip > 0)) {
throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
"numSigmaClip has to be positive.");
}
_numSigmaClip = numSigmaClip;
}
void setNumIter(int numIter) {
assert(numIter > 0);
if (!(numIter > 0)) {
throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
"numIter has to be positive.");
}
_numIter = numIter;
}
void setAndMask(int andMask) { _andMask = andMask; }
Expand Down

0 comments on commit fc6d2d7

Please sign in to comment.