Skip to content
Snippets Groups Projects
Commit 7a1bcdd0 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

rm Coordinate()

parent 48ee72c4
No related branches found
No related tags found
1 merge request!2416Add `angularFrame `and `qSpaceFrame` to Frame Python API
Pipeline #133161 passed
......@@ -248,7 +248,7 @@ Scale Scale::transformedScale(const Coordinate& coord, const trafo_t& axTrafo) c
Scale Scale::alpha_f_Scale(double lambda, double alpha_i) const
{
if (m_coord->unit() == "1/nm")
return transformedScale(Coordinate("alpha_f", "rad").label(), [lambda, alpha_i](double qz) {
return transformedScale("alpha_f (rad)", [lambda, alpha_i](double qz) {
return std::asin(qz * lambda / 2 / pi - std::sin(alpha_i));
});
return {m_coord->label(), m_bins};
......@@ -257,7 +257,7 @@ Scale Scale::alpha_f_Scale(double lambda, double alpha_i) const
Scale Scale::phi_f_Scale(double lambda) const
{
if (m_coord->unit() == "1/nm")
return transformedScale(Coordinate("phi_f", "rad").label(),
return transformedScale("phi_f (rad)",
[lambda](double qy) { return std::asin(qy * lambda / 2 / pi); });
return {m_coord->label(), m_bins};
}
......@@ -265,18 +265,16 @@ Scale Scale::phi_f_Scale(double lambda) const
Scale Scale::qz_Scale(double lambda, double alpha_i) const
{
if (m_coord->unit() == "rad")
return transformedScale(
Coordinate("qz", "1/nm").label(), [lambda, alpha_i](double alpha_f) {
return 2 * pi / lambda * (std::sin(alpha_i) + std::sin(alpha_f));
});
return transformedScale("qz (1/nm)", [lambda, alpha_i](double alpha_f) {
return 2 * pi / lambda * (std::sin(alpha_i) + std::sin(alpha_f));
});
return {m_coord->label(), m_bins};
}
Scale Scale::qy_Scale(double lambda) const
{
if (m_coord->unit() == "rad")
return transformedScale(Coordinate("qy", "1/nm").label(), [lambda](double phi_f) {
return 2 * pi / lambda * std::sin(phi_f);
});
return transformedScale(
"qy (1/nm)", [lambda](double phi_f) { return 2 * pi / lambda * std::sin(phi_f); });
return {m_coord->label(), m_bins};
}
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