diff --git a/Device/Instrument/CoordSystem2D.cpp b/Device/Instrument/CoordSystem2D.cpp index 7fa459eed0ef410fc74336fad25f000cae6c4a3f..0ea1468379ed84fbb97f54b544365bfa2443a513 100644 --- a/Device/Instrument/CoordSystem2D.cpp +++ b/Device/Instrument/CoordSystem2D.cpp @@ -22,7 +22,6 @@ #include "Device/Coord/AxisNames.h" #include <algorithm> #include <cmath> -#include <stdexcept> namespace { @@ -161,9 +160,7 @@ double SphericalCoords::calculateValue(size_t i_axis, Axes::Coords units, double const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0); return (k_f - k_i).z(); } - throw std::runtime_error("Error in SphericalCoords::calculateValue: " - "incorrect axis index: " - + std::to_string(static_cast<int>(i_axis))); + ASSERT(0); } case Axes::Coords::QXQY: { const auto k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i); @@ -174,12 +171,10 @@ double SphericalCoords::calculateValue(size_t i_axis, Axes::Coords units, double const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0); return (k_f - k_i).x(); } - throw std::runtime_error("Error in SphericalCoords::calculateValue: " - "incorrect axis index: " - + std::to_string(static_cast<int>(i_axis))); + ASSERT(0); } default: - throwUnitsError("SphericalCoords::calculateValue", availableUnits()); + ASSERT(0); } } @@ -259,7 +254,7 @@ double ImageCoords::calculateValue(size_t i_axis, Axes::Coords units, double val default: break; } - throwUnitsError("ImageCoords::calculateValue", availableUnits()); + ASSERT(0); } std::vector<std::map<Axes::Coords, std::string>> ImageCoords::createNameMaps() const @@ -328,7 +323,7 @@ double OffSpecularCoordinates::calculateValue(size_t, Axes::Coords units, double case Axes::Coords::DEGREES: return Units::rad2deg(value); default: - throwUnitsError("OffSpecularCoordinates::calculateValue", availableUnits()); + ASSERT(0); } } @@ -378,7 +373,7 @@ double DepthProbeCoordinates::calculateValue(size_t i_axis, Axes::Coords units, { const auto& available_units = availableUnits(); if (std::find(available_units.begin(), available_units.end(), units) == available_units.cend()) - throwUnitsError("DepthProbeCoordinates::checkUnits", available_units); + ASSERT(0); if (i_axis == 1) return value; // unit conversions are not applied to sample position axis