v1.0.0-rc.72
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <iostream>
|
||||
#include "../common/DiffractionGeometry.h"
|
||||
#include "../common/DiffractionExperiment.h"
|
||||
|
||||
TEST_CASE("RecipToDetector_1", "[LinearAlgebra][Coord]") {
|
||||
DiffractionExperiment x(DetJF(8, 2));
|
||||
x.BeamX_pxl(1024).BeamY_pxl(1024).DetectorDistance_mm(120);
|
||||
@@ -18,7 +19,7 @@ TEST_CASE("RecipToDetector_1", "[LinearAlgebra][Coord]") {
|
||||
REQUIRE(proj_x == Catch::Approx(pos_x));
|
||||
REQUIRE(proj_y == Catch::Approx(pos_y));
|
||||
REQUIRE((recip - geom.DetectorToRecip(proj_x, proj_y)).Length() < 0.00000001f);
|
||||
REQUIRE(geom.DistFromEwaldSphere(recip) < 4e-4);
|
||||
REQUIRE(std::fabs(geom.DistFromEwaldSphere(recip)) < 4e-4);
|
||||
}
|
||||
|
||||
TEST_CASE("RecipToDetector_2", "[LinearAlgebra][Coord]") {
|
||||
@@ -32,7 +33,7 @@ TEST_CASE("RecipToDetector_2", "[LinearAlgebra][Coord]") {
|
||||
REQUIRE(proj_x == Catch::Approx(pos_x));
|
||||
REQUIRE(proj_y == Catch::Approx(pos_y));
|
||||
REQUIRE((recip - geom.DetectorToRecip(proj_x, proj_y)).Length() < 0.00000001f);
|
||||
REQUIRE(geom.DistFromEwaldSphere(recip) < 4e-4);
|
||||
REQUIRE(std::fabs(geom.DistFromEwaldSphere(recip)) < 4e-4);
|
||||
}
|
||||
|
||||
TEST_CASE("RecipToDetector_3", "[LinearAlgebra][Coord]") {
|
||||
@@ -46,7 +47,7 @@ TEST_CASE("RecipToDetector_3", "[LinearAlgebra][Coord]") {
|
||||
REQUIRE(proj_x == Catch::Approx(pos_x));
|
||||
REQUIRE(proj_y == Catch::Approx(pos_y));
|
||||
REQUIRE((recip - geom.DetectorToRecip(proj_x, proj_y)).Length() < 0.00000001f);
|
||||
REQUIRE(geom.DistFromEwaldSphere(recip) < 4e-4);
|
||||
REQUIRE(std::fabs(geom.DistFromEwaldSphere(recip)) < 4e-4);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionGeometry_Phi","") {
|
||||
@@ -182,6 +183,21 @@ TEST_CASE("DiffractionGeometry_AngleFromEwaldSphere_Wvl2A") {
|
||||
CHECK(geom.AngleFromEwaldSphere_deg(geom.DetectorToRecip(1500,100)) < 0.05f);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionGeometry_ProjectToEwaldSphere") {
|
||||
DiffractionGeometry geom;
|
||||
geom.BeamX_pxl(1000).BeamY_pxl(437).DetectorDistance_mm(100).Wavelength_A(2.0);
|
||||
Coord p0 = geom.DetectorToRecip(300,300);
|
||||
Coord p1 = geom.ProjectToEwaldSphere(p0);
|
||||
REQUIRE(p0.x == Catch::Approx(p1.x));
|
||||
REQUIRE(p0.y == Catch::Approx(p1.y));
|
||||
REQUIRE(p0.z == Catch::Approx(p1.z));
|
||||
|
||||
Coord p2 = Coord(1,0,0);
|
||||
|
||||
REQUIRE(std::fabs(geom.DistFromEwaldSphere(p2) > 0.01));
|
||||
REQUIRE(std::fabs(geom.DistFromEwaldSphere(geom.ProjectToEwaldSphere(p2))) < 0.0001);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionGeometry_DirectBeam") {
|
||||
DiffractionGeometry geom;
|
||||
geom.Wavelength_A(1.0);
|
||||
|
||||
Reference in New Issue
Block a user