Skip to content
Snippets Groups Projects
Commit c6fcfab6 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

throw -> ASSERT

parent 7ff4e3a2
No related branches found
No related tags found
1 merge request!228decouple CoordSystem2D from Beam, and minor cleanup in related context
......@@ -16,6 +16,7 @@
#include "Base/Axis/PointwiseAxis.h"
#include "Base/Const/Units.h"
#include "Base/Math/Constants.h"
#include "Base/Utils/Assert.h"
#include "Device/Coord/AxisNames.h"
#include "Device/Data/OutputData.h"
......@@ -194,7 +195,7 @@ AngularReflectometryCoordinates::getTraslatorTo(Axes::Coords units) const
case Axes::Coords::RQ4:
return [wl = m_wavelength](double value) { return getQ(wl, value); };
default:
throwUnitsError("AngularReflectometryCoordinates::getTraslatorTo", availableUnits());
ASSERT(0);
}
}
......@@ -244,6 +245,6 @@ WavenumberReflectometryCoordinates::getTraslatorTo(Axes::Coords units) const
case Axes::Coords::RQ4:
return [](double value) { return value; };
default:
throwUnitsError("WavenumberReflectometryCoordinates::getTraslatorTo", availableUnits());
ASSERT(0);
}
}
......@@ -152,23 +152,23 @@ double SphericalCoords::calculateValue(size_t i_axis, Axes::Coords units, double
case Axes::Coords::DEGREES:
return Units::rad2deg(value);
case Axes::Coords::QSPACE: {
const auto k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i);
const kvector_t k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i);
if (i_axis == 0) {
const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value);
const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value);
return (k_i - k_f).y();
} else if (i_axis == 1) {
const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0);
const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0);
return (k_f - k_i).z();
}
ASSERT(0);
}
case Axes::Coords::QXQY: {
const auto k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i);
const kvector_t k_i = vecOfLambdaAlphaPhi(m_wavelength, m_alpha_i, m_phi_i);
if (i_axis == 0) {
const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value);
const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, 0.0, value);
return (k_i - k_f).y();
} else if (i_axis == 1) {
const auto k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0);
const kvector_t k_f = vecOfLambdaAlphaPhi(m_wavelength, value, 0.0);
return (k_f - k_i).x();
}
ASSERT(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment