From ac269456a82949af363d0708a9a8a56cb6190eb3 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Tue, 4 Jul 2023 22:31:52 +0200 Subject: [PATCH] add units to axis names --- Base/Pixel/RectangularPixel.cpp | 2 +- Device/Detector/OffspecDetector.cpp | 4 ++-- Device/Detector/SphericalDetector.cpp | 4 ++-- Device/IO/ReadRefsans.cpp | 4 ++-- GUI/Model/Beam/GrazingScanItem.cpp | 2 +- GUI/Model/Descriptor/VectorProperty.cpp | 2 +- Sim/Scan/AlphaScan.cpp | 2 +- Tests/SimFactory/MakeSimulations.cpp | 2 +- Tests/Unit/Sim/FittingTestHelper.h | 4 ++-- auto/Examples/varia/Depthprobe1.py | 2 +- auto/Examples/varia/Resonator.py | 2 +- auto/MiniExamples/varia/Depthprobe1.py | 2 +- auto/MiniExamples/varia/Resonator.py | 2 +- rawEx/varia/Depthprobe1.py | 2 +- rawEx/varia/Resonator.py | 2 +- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Base/Pixel/RectangularPixel.cpp b/Base/Pixel/RectangularPixel.cpp index 339e0157655..a98bd9f2891 100644 --- a/Base/Pixel/RectangularPixel.cpp +++ b/Base/Pixel/RectangularPixel.cpp @@ -83,5 +83,5 @@ Scale* RectangularPixel::createAxis(size_t n) const const double alpha_f_min = (pi / 2) - R3Util::theta(k00); const double alpha_f_max = (pi / 2) - R3Util::theta(k01); - return newEquiDivision("alpha_f", alpha_f_min, alpha_f_max, n); + return newEquiDivision("alpha_f (rad)", alpha_f_min, alpha_f_max, n); } diff --git a/Device/Detector/OffspecDetector.cpp b/Device/Detector/OffspecDetector.cpp index ca3cdecaa40..45ebef08536 100644 --- a/Device/Detector/OffspecDetector.cpp +++ b/Device/Detector/OffspecDetector.cpp @@ -21,8 +21,8 @@ OffspecDetector::OffspecDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) - : m_axes{sharedEquiDivision("phi_f", n_phi, phi_min, phi_max), - sharedEquiDivision("alpha_f", n_alpha, alpha_min, alpha_max)} + : m_axes{sharedEquiDivision("phi_f (rad)", n_phi, phi_min, phi_max), + sharedEquiDivision("alpha_f (rad)", n_alpha, alpha_min, alpha_max)} { } diff --git a/Device/Detector/SphericalDetector.cpp b/Device/Detector/SphericalDetector.cpp index d404eaf5479..22c9233eee7 100644 --- a/Device/Detector/SphericalDetector.cpp +++ b/Device/Detector/SphericalDetector.cpp @@ -33,8 +33,8 @@ SphericalDetector::SphericalDetector(std::array<std::shared_ptr<Scale>, 2> axes) SphericalDetector::SphericalDetector(size_t n_phi, double phi_min, double phi_max, size_t n_alpha, double alpha_min, double alpha_max) : SphericalDetector(std::array<std::shared_ptr<Scale>, 2>{ - sharedEquiDivision("phi_f", n_phi, phi_min, phi_max), - sharedEquiDivision("alpha_f", n_alpha, alpha_min, alpha_max)}) + sharedEquiDivision("phi_f (rad)", n_phi, phi_min, phi_max), + sharedEquiDivision("alpha_f (rad)", n_alpha, alpha_min, alpha_max)}) { } diff --git a/Device/IO/ReadRefsans.cpp b/Device/IO/ReadRefsans.cpp index 6f3de6557de..b65d40bfb09 100644 --- a/Device/IO/ReadRefsans.cpp +++ b/Device/IO/ReadRefsans.cpp @@ -90,7 +90,7 @@ Datafield* Util::RW::readRefsans(std::istream& input_stream) // create datafield std::vector<const Scale*> axes; - axes.push_back(newListScan("Qy", qy)); - axes.push_back(newListScan("Qz", qz)); + axes.push_back(newListScan("Qy (1/nm)", qy)); + axes.push_back(newListScan("Qz (1/nm)", qz)); return new Datafield(std::move(axes), values); } diff --git a/GUI/Model/Beam/GrazingScanItem.cpp b/GUI/Model/Beam/GrazingScanItem.cpp index ac9c4a0a986..dbf23fb12db 100644 --- a/GUI/Model/Beam/GrazingScanItem.cpp +++ b/GUI/Model/Beam/GrazingScanItem.cpp @@ -35,7 +35,7 @@ const QString BaseData("BaseData"); void setAxisPresentationDefaults(BasicAxisItem* axisItem) { ASSERT(axisItem); - axisItem->setTitle("alpha_i"); + axisItem->setTitle("alpha_i (rad)"); if (!dynamic_cast<PointwiseAxisItem*>(axisItem)) { axisItem->setMin(0.0); diff --git a/GUI/Model/Descriptor/VectorProperty.cpp b/GUI/Model/Descriptor/VectorProperty.cpp index 19284322a23..c08e93192bf 100644 --- a/GUI/Model/Descriptor/VectorProperty.cpp +++ b/GUI/Model/Descriptor/VectorProperty.cpp @@ -42,7 +42,7 @@ void VectorProperty::init(const QString& label, const QString& tooltip, const R3 m_x.init("x", tooltip, value.x(), unit, decimals, step, limits, uidPrefix); m_y.init("y", tooltip, value.y(), unit, decimals, step, limits, uidPrefix); - m_z.init("z", tooltip, value.z(), unit, decimals, step, limits, uidPrefix); + m_z.init("z (nm)", tooltip, value.z(), unit, decimals, step, limits, uidPrefix); QString uid; if (uidPrefix.size() > 0) diff --git a/Sim/Scan/AlphaScan.cpp b/Sim/Scan/AlphaScan.cpp index c6a1cd27c02..a35d39093c3 100644 --- a/Sim/Scan/AlphaScan.cpp +++ b/Sim/Scan/AlphaScan.cpp @@ -49,7 +49,7 @@ AlphaScan::AlphaScan(const Scale& alpha_axis) } AlphaScan::AlphaScan(int nbins, double alpha_i_min, double alpha_i_max) - : AlphaScan(EquiScan("alpha_i", nbins, alpha_i_min, alpha_i_max)) + : AlphaScan(EquiScan("alpha_i (rad)", nbins, alpha_i_min, alpha_i_max)) { } diff --git a/Tests/SimFactory/MakeSimulations.cpp b/Tests/SimFactory/MakeSimulations.cpp index 8f760a25450..de99eb08508 100644 --- a/Tests/SimFactory/MakeSimulations.cpp +++ b/Tests/SimFactory/MakeSimulations.cpp @@ -452,7 +452,7 @@ test::makeSimulation::BasicDepthprobe(const MultiLayer& sample) AlphaScan scan(20, 0.025 * deg, 0.975 * deg); scan.setWavelength(1.); - Scale zaxis = EquiDivision("z", 20, -100., +100.); + Scale zaxis = EquiDivision("z (nm)", 20, -100., +100.); return std::make_unique<DepthprobeSimulation>(scan, sample, zaxis); } diff --git a/Tests/Unit/Sim/FittingTestHelper.h b/Tests/Unit/Sim/FittingTestHelper.h index 28604de2093..cb8a51d37d6 100644 --- a/Tests/Unit/Sim/FittingTestHelper.h +++ b/Tests/Unit/Sim/FittingTestHelper.h @@ -51,8 +51,8 @@ public: std::unique_ptr<Datafield> createTestData(double value) { std::unique_ptr<Datafield> result( - new Datafield({newEquiDivision("phi_f", m_nx, m_xmin, m_xmax), - newEquiDivision("alpha_f", m_ny, m_ymin, m_ymax)})); + new Datafield({newEquiDivision("phi_f (rad)", m_nx, m_xmin, m_xmax), + newEquiDivision("alpha_f (rad)", m_ny, m_ymin, m_ymax)})); result->setAllTo(value); return result; } diff --git a/auto/Examples/varia/Depthprobe1.py b/auto/Examples/varia/Depthprobe1.py index 277c88d840c..2d9c1a5f828 100755 --- a/auto/Examples/varia/Depthprobe1.py +++ b/auto/Examples/varia/Depthprobe1.py @@ -27,7 +27,7 @@ def get_simulation(sample, flags): scan = ba.AlphaScan(n, 0*deg, 1*deg) scan.setWavelength(0.3*nm) - z_axis = ba.EquiDivision("z", n, -130*nm, 30*nm) + z_axis = ba.EquiDivision("z (nm)", n, -130*nm, 30*nm) simulation = ba.DepthprobeSimulation(scan, sample, z_axis, flags) return simulation diff --git a/auto/Examples/varia/Resonator.py b/auto/Examples/varia/Resonator.py index b8bfe709db5..a4a83daa793 100755 --- a/auto/Examples/varia/Resonator.py +++ b/auto/Examples/varia/Resonator.py @@ -73,7 +73,7 @@ def get_simulation(sample): footprint = ba.FootprintSquare(0.01) scan.setFootprint(footprint) - z_axis = ba.EquiDivision("z", nz, z_min, z_max) + z_axis = ba.EquiDivision("z (nm)", nz, z_min, z_max) simulation = ba.DepthprobeSimulation(scan, sample, z_axis) alpha_distr = ba.DistributionGaussian(0, d_ang, 25, 3.) diff --git a/auto/MiniExamples/varia/Depthprobe1.py b/auto/MiniExamples/varia/Depthprobe1.py index 116991416a6..af40d95162e 100755 --- a/auto/MiniExamples/varia/Depthprobe1.py +++ b/auto/MiniExamples/varia/Depthprobe1.py @@ -27,7 +27,7 @@ def get_simulation(sample, flags): scan = ba.AlphaScan(n, 0*deg, 1*deg) scan.setWavelength(0.3*nm) - z_axis = ba.EquiDivision("z", n, -130*nm, 30*nm) + z_axis = ba.EquiDivision("z (nm)", n, -130*nm, 30*nm) simulation = ba.DepthprobeSimulation(scan, sample, z_axis, flags) return simulation diff --git a/auto/MiniExamples/varia/Resonator.py b/auto/MiniExamples/varia/Resonator.py index 7d2f6e18aec..5b533c17f98 100755 --- a/auto/MiniExamples/varia/Resonator.py +++ b/auto/MiniExamples/varia/Resonator.py @@ -73,7 +73,7 @@ def get_simulation(sample): footprint = ba.FootprintSquare(0.01) scan.setFootprint(footprint) - z_axis = ba.EquiDivision("z", nz, z_min, z_max) + z_axis = ba.EquiDivision("z (nm)", nz, z_min, z_max) simulation = ba.DepthprobeSimulation(scan, sample, z_axis) alpha_distr = ba.DistributionGaussian(0, d_ang, 25, 3.) diff --git a/rawEx/varia/Depthprobe1.py b/rawEx/varia/Depthprobe1.py index 38cd0a6242a..a372812fd9f 100755 --- a/rawEx/varia/Depthprobe1.py +++ b/rawEx/varia/Depthprobe1.py @@ -27,7 +27,7 @@ def get_simulation(sample, flags): scan = ba.AlphaScan(n, 0*deg, 1*deg) scan.setWavelength(0.3*nm) - z_axis = ba.EquiDivision("z", n, -130*nm, 30*nm) + z_axis = ba.EquiDivision("z (nm)", n, -130*nm, 30*nm) simulation = ba.DepthprobeSimulation(scan, sample, z_axis, flags) return simulation diff --git a/rawEx/varia/Resonator.py b/rawEx/varia/Resonator.py index a2d9b03ee30..9856b4b4191 100755 --- a/rawEx/varia/Resonator.py +++ b/rawEx/varia/Resonator.py @@ -73,7 +73,7 @@ def get_simulation(sample): footprint = ba.FootprintSquare(0.01) scan.setFootprint(footprint) - z_axis = ba.EquiDivision("z", nz, z_min, z_max) + z_axis = ba.EquiDivision("z (nm)", nz, z_min, z_max) simulation = ba.DepthprobeSimulation(scan, sample, z_axis) alpha_distr = ba.DistributionGaussian(0, d_ang, 25, 3.) -- GitLab