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

ICoordSystem cleanup; no longer depends on Tags.h

parent c2b5339a
No related branches found
No related tags found
No related merge requests found
......@@ -86,12 +86,10 @@ double SphericalCoords::calculateValue(size_t, double value) const
std::string SphericalCoords::nameOfAxis(size_t i_axis) const
{
if (i_axis == 0) {
if (i_axis == 0)
return "phi_f [deg]";
}
if (i_axis == 1) {
if (i_axis == 1)
return "alpha_f [deg]";
}
ASSERT(false);
}
......@@ -125,45 +123,14 @@ ImageCoords* ImageCoords::clone() const
double ImageCoords::calculateValue(size_t, double value) const
{
return value;
/*
const auto k00 = m_detector_pixel->getPosition(0.0, 0.0);
const auto k01 = m_detector_pixel->getPosition(0.0, 1.0);
const auto k10 = m_detector_pixel->getPosition(1.0, 0.0);
const auto& max_pos = i_axis == 0 ? k10 : k01; // position of max along given axis
const double shift = value - m_axes[i_axis]->min();
const R3 out_dir = k00 + shift * (max_pos - k00).unit_or_throw();
const R3 kf = out_dir.unit_or_throw() * m_ki.mag();
switch (units) {
case Coords::RADIANS:
return axisAngle(i_axis, kf);
case Coords::DEGREES:
return Units::rad2deg(axisAngle(i_axis, kf));
case Coords::QSPACE: {
if (i_axis == 0)
// u axis runs in -y direction
return (m_ki - kf).y();
if (i_axis == 1) {
// v axis is perpendicular to ki and y.
static const R3 unit_v = (m_ki.cross(R3(0, 1, 0))).unit_or_throw();
return (kf - m_ki).dot(unit_v);
}
} break;
default:
break;
}
ASSERT(false);
*/
}
std::string ImageCoords::nameOfAxis(size_t i_axis) const
{
if (i_axis == 0) {
if (i_axis == 0)
return "X [mm]";
}
if (i_axis == 1) {
if (i_axis == 1)
return "Y [mm]";
}
ASSERT(false);
}
......@@ -223,29 +190,13 @@ DepthprobeCoords* DepthprobeCoords::clone() const
double DepthprobeCoords::calculateValue(size_t, double value) const
{
return value;
/*
if (i_axis == 1)
return value; // unit conversions are not applied to sample position axis
switch (units) {
case Coords::RADIANS:
return value;
case Coords::QSPACE:
return 2 * m_ki0 * std::sin(value);
default:
case Coords::DEGREES:
return Units::rad2deg(value);
}
*/
}
std::string DepthprobeCoords::nameOfAxis(size_t i_axis) const
{
if (i_axis == 0) {
if (i_axis == 0)
return "alpha_i [deg]";
}
if (i_axis == 1) {
if (i_axis == 1)
return "Position [nm]";
}
ASSERT(false);
}
......@@ -19,7 +19,6 @@
#define BORNAGAIN_DEVICE_COORD_ICOORDSYSTEM_H
#include "Base/Axis/Frame.h"
#include "Device/Coord/Tags.h"
#include <string>
//! Interface to provide axis translations to different units for simulation output
......
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