Implement FPGA summation

This commit is contained in:
2023-11-02 20:41:37 +01:00
parent 1b2b8f5863
commit 3d7c7b0779
10 changed files with 431 additions and 108 deletions
+39 -1
View File
@@ -736,7 +736,8 @@ TEST_CASE("DiffractionExperiment_LoadDatasetSettings", "[DiffractionExperiment]"
settings.set_space_group_number(45);
settings.set_sample_name("lyso1");
settings.set_binning2x2(true);
settings.set_fpga_summation(36);
settings.set_fpga_pixel_output(JFJochProtoBuf::INT16);
REQUIRE_NOTHROW(x.LoadDatasetSettings(settings));
REQUIRE(x.GetImageNumPerTrigger() == 234);
@@ -748,6 +749,8 @@ TEST_CASE("DiffractionExperiment_LoadDatasetSettings", "[DiffractionExperiment]"
REQUIRE(x.GetDataFileCount() == 5);
REQUIRE(x.GetDetectorDistance_mm() == Approx(57.6));
REQUIRE(x.GetBinning2x2());
REQUIRE(x.GetFPGASummation() == 36);
REQUIRE(x.GetFPGAOutputMode() == JFJochProtoBuf::INT16);
}
TEST_CASE("DiffractionExperiment_ImageTimeUs", "[DiffractionExperiment]") {
@@ -892,6 +895,41 @@ TEST_CASE("DiffractionExperiment_DefaultDataProcessingSettings","[DiffractionExp
DiffractionExperiment::DefaultDataProcessingSettings()));
}
TEST_CASE("DiffractionExperiment_FPGA_Summation_output","[DiffractionExperiment]") {
DiffractionExperiment x;
REQUIRE_THROWS(x.FPGASummation(0));
REQUIRE_THROWS(x.FPGASummation(-1));
REQUIRE_THROWS(x.FPGASummation(MAX_FPGA_SUMMATION + 1));
x.FPGAOutputMode(JFJochProtoBuf::AUTO);
REQUIRE_NOTHROW(x.FPGASummation(1));
REQUIRE(x.GetFPGAOutputSigned());
REQUIRE(x.GetFPGAOutputDepth() == 2);
REQUIRE(x.GetFPGASummation() == 1);
REQUIRE_NOTHROW(x.FPGASummation(3));
REQUIRE(x.GetFPGAOutputSigned());
REQUIRE(x.GetFPGAOutputDepth() == 4);
REQUIRE(x.GetFPGASummation() == 3);
x.FPGAOutputMode(JFJochProtoBuf::INT16);
REQUIRE(x.GetFPGAOutputDepth() == 2);
REQUIRE(x.GetFPGAOutputSigned());
x.FPGAOutputMode(JFJochProtoBuf::INT32);
REQUIRE(x.GetFPGAOutputDepth() == 4);
REQUIRE(x.GetFPGAOutputSigned());
x.FPGAOutputMode(JFJochProtoBuf::UINT16);
REQUIRE(x.GetFPGAOutputDepth() == 2);
REQUIRE(!x.GetFPGAOutputSigned());
x.FPGAOutputMode(JFJochProtoBuf::UINT32);
REQUIRE(x.GetFPGAOutputDepth() == 4);
REQUIRE(!x.GetFPGAOutputSigned());
}
TEST_CASE("DiffractionExperiment_Binning","[DiffractionExperiment]") {
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36, true));
x.Mode(DetectorMode::Conversion).BeamX_pxl(200.0).BeamY_pxl(400.0);