Modifications in preparation to MAX IV experiment
This commit is contained in:
@@ -241,7 +241,6 @@ TEST_CASE("DiffractionExperiment_DetectorGeometry","[DiffractionExperiment]") {
|
||||
REQUIRE(x.GetYPixelsNum() == 514 * 18);
|
||||
|
||||
REQUIRE(x.GetModulesNum() == 18);
|
||||
REQUIRE(x.GetModulesNum(TASK_NO_DATA_STREAM) == 18);
|
||||
REQUIRE(x.GetModulesNum(0) == 5);
|
||||
REQUIRE(x.GetModulesNum(2) == 4);
|
||||
|
||||
@@ -473,52 +472,52 @@ TEST_CASE("DiffractionExperiment_CopyConstructor", "[DiffractionExperiment]") {
|
||||
TEST_CASE("DiffractionExperiment_RadialIntegration_LowQ","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
|
||||
REQUIRE_THROWS(x.LowQForRadialInt_recipA(0));
|
||||
REQUIRE_THROWS(x.LowQForRadialInt_recipA(-1));
|
||||
REQUIRE_THROWS(x.LowQForRadialInt_recipA(50));
|
||||
REQUIRE_THROWS(x.LowQForAzimInt_recipA(0));
|
||||
REQUIRE_THROWS(x.LowQForAzimInt_recipA(-1));
|
||||
REQUIRE_THROWS(x.LowQForAzimInt_recipA(50));
|
||||
|
||||
x.LowQForRadialInt_recipA(4);
|
||||
REQUIRE(x.GetLowQForRadialInt_recipA() == Approx(4));
|
||||
x.LowQForAzimInt_recipA(4);
|
||||
REQUIRE(x.GetLowQForAzimInt_recipA() == Approx(4));
|
||||
|
||||
REQUIRE_THROWS(x.LowResForRadialInt_A(0));
|
||||
REQUIRE_THROWS(x.LowResForRadialInt_A(-1));
|
||||
REQUIRE_THROWS(x.LowResForAzimInt_A(0));
|
||||
REQUIRE_THROWS(x.LowResForAzimInt_A(-1));
|
||||
|
||||
x.LowResForRadialInt_A(5.0);
|
||||
REQUIRE(x.GetLowQForRadialInt_recipA() == Approx(2 * M_PI / 5.0));
|
||||
x.LowResForAzimInt_A(5.0);
|
||||
REQUIRE(x.GetLowQForAzimInt_recipA() == Approx(2 * M_PI / 5.0));
|
||||
|
||||
DiffractionExperiment y(x);
|
||||
REQUIRE(y.GetLowQForRadialInt_recipA() == Approx(2 * M_PI / 5.0));
|
||||
REQUIRE(y.GetLowQForAzimInt_recipA() == Approx(2 * M_PI / 5.0));
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("DiffractionExperiment_RadialIntegration_HighQ","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
|
||||
REQUIRE_THROWS(x.HighQForRadialInt_recipA(0));
|
||||
REQUIRE_THROWS(x.HighQForRadialInt_recipA(-1));
|
||||
REQUIRE_THROWS(x.HighQForRadialInt_recipA(50));
|
||||
REQUIRE_THROWS(x.HighQForAzimInt_recipA(0));
|
||||
REQUIRE_THROWS(x.HighQForAzimInt_recipA(-1));
|
||||
REQUIRE_THROWS(x.HighQForAzimInt_recipA(50));
|
||||
|
||||
x.HighQForRadialInt_recipA(8);
|
||||
REQUIRE(x.GetHighQForRadialInt_recipA() == Approx(8.0));
|
||||
x.HighQForAzimInt_recipA(8);
|
||||
REQUIRE(x.GetHighQForAzimInt_recipA() == Approx(8.0));
|
||||
|
||||
REQUIRE_THROWS(x.HighResForRadialInt_A(0));
|
||||
REQUIRE_THROWS(x.HighResForRadialInt_A(-1));
|
||||
REQUIRE_THROWS(x.HighResForAzimInt_A(0));
|
||||
REQUIRE_THROWS(x.HighResForAzimInt_A(-1));
|
||||
|
||||
x.HighResForRadialInt_A(3.0);
|
||||
REQUIRE(x.GetHighQForRadialInt_recipA() == Approx(2 * M_PI / 3.0));
|
||||
x.HighResForAzimInt_A(3.0);
|
||||
REQUIRE(x.GetHighQForAzimInt_recipA() == Approx(2 * M_PI / 3.0));
|
||||
|
||||
DiffractionExperiment y(x);
|
||||
REQUIRE(y.GetHighQForRadialInt_recipA() == Approx(2 * M_PI / 3.0));
|
||||
REQUIRE(y.GetHighQForAzimInt_recipA() == Approx(2 * M_PI / 3.0));
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_RadialIntegration_QSpacing","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
|
||||
x.QSpacingForRadialInt_recipA(0.456);
|
||||
REQUIRE(x.GetQSpacingForRadialInt_recipA() == Approx(0.456));
|
||||
x.QSpacingForAzimInt_recipA(0.456);
|
||||
REQUIRE(x.GetQSpacingForAzimInt_recipA() == Approx(0.456));
|
||||
|
||||
DiffractionExperiment y(x);
|
||||
REQUIRE(y.GetQSpacingForRadialInt_recipA() == Approx(0.456));
|
||||
REQUIRE(y.GetQSpacingForAzimInt_recipA() == Approx(0.456));
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_StorageCells","[DiffractionExperiment]") {
|
||||
@@ -647,3 +646,59 @@ TEST_CASE("DiffractionExperiment_DetectorModuleHostname","[DiffractionExperiment
|
||||
REQUIRE(det_cfg.size() == x.GetModulesNum());
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_Appendix","") {
|
||||
DiffractionExperiment x;
|
||||
StartMessage message;
|
||||
|
||||
x.FillMessage(message);
|
||||
REQUIRE(message.user_data == "");
|
||||
REQUIRE(x.GetImageAppendix() == "");
|
||||
REQUIRE(x.GetHeaderAppendix() == "");
|
||||
|
||||
x.ImageAppendix("ImageAppendix").HeaderAppendix("HeaderAppendix");
|
||||
|
||||
x.FillMessage(message);
|
||||
REQUIRE(x.GetImageAppendix() == "ImageAppendix");
|
||||
REQUIRE(x.GetHeaderAppendix() == "HeaderAppendix");
|
||||
|
||||
REQUIRE(message.user_data == "HeaderAppendix");
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_OmegaRotationAxis","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
x.DefaultOmegaAxis({0,-1,0});
|
||||
REQUIRE(x.GetDefaultOmegaAxis().x == 0);
|
||||
REQUIRE(x.GetDefaultOmegaAxis().y == -1);
|
||||
|
||||
x.OmegaAxis();
|
||||
REQUIRE(x.GetOmegaAxis().x == 0);
|
||||
REQUIRE(x.GetOmegaAxis().y == -1);
|
||||
|
||||
x.OmegaAxis({-1, 0, 0});
|
||||
REQUIRE(x.GetOmegaAxis().x == -1);
|
||||
REQUIRE(x.GetOmegaAxis().y == 0);
|
||||
|
||||
REQUIRE_THROWS(x.DefaultOmegaAxis({0,0,0}));
|
||||
REQUIRE_THROWS(x.OmegaAxis({0,0,0}));
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_OmegaStep","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x;
|
||||
StartMessage msg;
|
||||
|
||||
x.OmegaStep(std::optional<float>());
|
||||
x.FillMessage(msg);
|
||||
REQUIRE(!x.GetOmegaStep());
|
||||
REQUIRE(msg.goniometer.empty());
|
||||
|
||||
x.OmegaStep(0.0);
|
||||
REQUIRE(!x.GetOmegaStep());
|
||||
x.FillMessage(msg);
|
||||
REQUIRE(msg.goniometer.empty());
|
||||
|
||||
x.OmegaStep(1.0);
|
||||
x.FillMessage(msg);
|
||||
REQUIRE(x.GetOmegaStep());
|
||||
REQUIRE(!msg.goniometer.empty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user