DiffractionGeometry: Store rotation matrix
This commit is contained in:
@@ -1420,7 +1420,8 @@ DiffractionGeometry DiffractionExperiment::GetDiffractionGeometry() const {
|
||||
.DetectorDistance_mm(dataset.GetDetectorDistance_mm())
|
||||
.PoniRot1_rad(dataset.GetPoniRot1_rad())
|
||||
.PoniRot2_rad(dataset.GetPoniRot2_rad())
|
||||
.PoniRot3_rad(dataset.GetPoniRot3_rad());
|
||||
.PoniRot3_rad(dataset.GetPoniRot3_rad())
|
||||
.Rotation(dataset.GetGoniometer());
|
||||
return g;
|
||||
}
|
||||
|
||||
|
||||
@@ -244,3 +244,12 @@ Coord DiffractionGeometry::ProjectToEwaldSphere(const Coord &p0) const {
|
||||
const RotMatrix &DiffractionGeometry::GetPoniRotMatrix() const {
|
||||
return poni_rot;
|
||||
}
|
||||
|
||||
std::optional<GoniometerAxis> DiffractionGeometry::GetRotation() const {
|
||||
return axis;
|
||||
}
|
||||
|
||||
DiffractionGeometry &DiffractionGeometry::Rotation(const std::optional<GoniometerAxis> &input) {
|
||||
axis = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "JFJochException.h"
|
||||
#include "Coord.h"
|
||||
#include "GoniometerAxis.h"
|
||||
|
||||
class DiffractionGeometry {
|
||||
float beam_x_pxl = 0.0;
|
||||
@@ -17,6 +18,8 @@ class DiffractionGeometry {
|
||||
float poni_rot_2 = 0.0f;
|
||||
float poni_rot_3 = 0.0f;
|
||||
RotMatrix poni_rot;
|
||||
|
||||
std::optional<GoniometerAxis> axis;
|
||||
void UpdatePoniRotMatrix();
|
||||
public:
|
||||
DiffractionGeometry &BeamX_pxl(float input);
|
||||
@@ -27,6 +30,7 @@ public:
|
||||
DiffractionGeometry &PoniRot1_rad(float input);
|
||||
DiffractionGeometry &PoniRot2_rad(float input);
|
||||
DiffractionGeometry &PoniRot3_rad(float input);
|
||||
DiffractionGeometry &Rotation(const std::optional<GoniometerAxis> &input);
|
||||
|
||||
[[nodiscard]] float GetBeamX_pxl() const;
|
||||
[[nodiscard]] float GetBeamY_pxl() const;
|
||||
@@ -38,6 +42,7 @@ public:
|
||||
[[nodiscard]] float GetPoniRot2_rad() const;
|
||||
[[nodiscard]] float GetPoniRot3_rad() const;
|
||||
[[nodiscard]] std::pair<float, float> GetDirectBeam_pxl() const;
|
||||
[[nodiscard]] std::optional<GoniometerAxis> GetRotation() const;
|
||||
|
||||
[[nodiscard]] Coord LabCoord(float x, float y) const;
|
||||
[[nodiscard]] Coord DetectorToRecip(float x, float y) const;
|
||||
@@ -60,6 +65,8 @@ public:
|
||||
[[nodiscard]] float AngleFromEwaldSphere_deg(const Coord &p0) const;
|
||||
|
||||
[[nodiscard]] const RotMatrix& GetPoniRotMatrix() const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_DIFFRACTIONGEOMETRY_H
|
||||
|
||||
Reference in New Issue
Block a user