Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
c58a3e3b
Commit
c58a3e3b
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ICoordSystem cleanup; no longer depends on Tags.h
parent
c2b5339a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Device/Coord/CoordSystem2D.cpp
+6
-55
6 additions, 55 deletions
Device/Coord/CoordSystem2D.cpp
Device/Coord/ICoordSystem.h
+0
-1
0 additions, 1 deletion
Device/Coord/ICoordSystem.h
with
6 additions
and
56 deletions
Device/Coord/CoordSystem2D.cpp
+
6
−
55
View file @
c58a3e3b
...
...
@@ -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
);
}
This diff is collapsed.
Click to expand it.
Device/Coord/ICoordSystem.h
+
0
−
1
View file @
c58a3e3b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment