Commits

David Mehringer authored ea173e4d31e
fix up error message for purists

casatools/src/code/components/ComponentModels/SpectralIndex.cc

Modified
384 384 (record.shape(field) == IPosition(1,1)) &&
385 385 (record.asString(field) == ""))) {
386 386 errorMessage += "The 'index' field must be an empty string\n";
387 387 errorMessage += "(and not a vector of strings)\n";
388 388 return false;
389 389 }
390 390 return true;
391 391 }
392 392
393 393 Bool SpectralIndex::ok() const {
394 - if (!SpectralModel::ok()) return false;
395 - if (refFrequency().getValue().getValue() <= 0.0) {
396 - LogIO logErr(LogOrigin("SpectralIndex", "ok()"));
397 - logErr << LogIO::SEVERE << "The reference frequency is zero or negative!"
398 - << LogIO::POST;
399 - return false;
400 - }
401 - if (abs(itsIndex) > 100) {
402 - LogIO logErr(LogOrigin("SpectralIndex", "ok()"));
403 - logErr << LogIO::SEVERE << "The spectral index is greater than 100!"
404 - << LogIO::POST;
405 - return false;
406 - }
407 - return true;
394 + if (!SpectralModel::ok()) return false;
395 + ThrowIf(
396 + refFrequency().getValue().getValue() <= 0.0,
397 + "The reference frequency is zero or negative!"
398 + );
399 + ThrowIf(abs(
400 + itsIndex) > 100,
401 + "The absolute value of the spectral index is greater than 100!"
402 + );
403 + return true;
408 404 }
409 405
410 -// Local Variables:
411 -// compile-command: "gmake SpectralIndex"
412 -// End:
413 -
414 -} //# NAMESPACE CASA - END
406 +}
415 407

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut