DiffractionExperiment: Remove 2x2 binning to simplify transformation code

This commit is contained in:
2023-11-06 14:16:15 +01:00
parent e6442f6384
commit fcd7612656
15 changed files with 134 additions and 617 deletions
+2 -45
View File
@@ -707,20 +707,18 @@ TEST_CASE("DiffractionExperiment_LoadDatasetSettings", "[DiffractionExperiment]"
settings.set_data_file_count(5);
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);
REQUIRE(x.GetBeamX_pxl() == Approx(23.4/2));
REQUIRE(x.GetBeamY_pxl() == Approx(123.4/2));
REQUIRE(x.GetBeamX_pxl() == Approx(23.4));
REQUIRE(x.GetBeamY_pxl() == Approx(123.4));
REQUIRE(x.GetSpaceGroupNumber() == 45);
REQUIRE(x.GetCompressionAlgorithm() == JFJochProtoBuf::BSHUF_LZ4);
REQUIRE(x.GetSampleName() == "lyso1");
REQUIRE(x.GetDataFileCount() == 5);
REQUIRE(x.GetDetectorDistance_mm() == Approx(57.6));
REQUIRE(x.GetBinning2x2());
REQUIRE(x.GetFPGASummation() == 36);
REQUIRE(x.GetFPGAOutputMode() == JFJochProtoBuf::INT16);
}
@@ -902,47 +900,6 @@ TEST_CASE("DiffractionExperiment_FPGA_Summation_output","[DiffractionExperiment]
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);
REQUIRE(!x.GetBinning2x2());
REQUIRE(x.GetPixelSize_mm() == Approx(PIXEL_SIZE_IN_MM));
REQUIRE(x.GetXPixelsNum() == 2068);
REQUIRE(x.GetYPixelsNum() == 2164);
REQUIRE(x.GetXPixelsNumFullImage() == 2068);
REQUIRE(x.GetYPixelsNumFullImage() == 2164);
REQUIRE(x.GetPixelsNumFullImage() == 2164*2068);
REQUIRE(x.GetBeamX_pxl() == Approx(200.0));
REQUIRE(x.GetBeamY_pxl() == Approx(400.0));
REQUIRE(x.GetPixel0OfModule(0) == (2164 - 1)*2068);
x.Binning2x2(true);
REQUIRE(x.GetBinning2x2());
REQUIRE(x.GetPixelSize_mm() == Approx(2*PIXEL_SIZE_IN_MM));
REQUIRE(x.GetXPixelsNumFullImage() == 2068);
REQUIRE(x.GetXPixelsNum() == 2068/2);
REQUIRE(x.GetYPixelsNumFullImage() == 2164);
REQUIRE(x.GetYPixelsNum() == 2164/2);
REQUIRE(x.GetPixelsNumFullImage() == 2164*2068);
REQUIRE(x.GetPixelsNum() == (2164/2)*(2068/2));
REQUIRE(x.GetBeamX_pxl() == Approx(100.0));
REQUIRE(x.GetBeamY_pxl() == Approx(200.0));
REQUIRE(x.GetPixel0OfModule(0) == ((2164 - 1))*(2068));
REQUIRE(x.GetPixel0OfModule(1) == ((2164 - 1))*(2068) + (1030+8));
REQUIRE(x.GetPixel0OfModule(6) == ((2164 - 1))*(2068) - 3 * ((514+36))*(2068));
REQUIRE(x.GetPixel0OfModule(7) == ((2164 - 1))*(2068) - 3 * ((514+36))*(2068) + (1030+8));
x.Mode(DetectorMode::Raw);
REQUIRE(!x.GetBinning2x2());
REQUIRE(x.GetXPixelsNum() == RAW_MODULE_COLS);
REQUIRE(x.GetYPixelsNum() == 8 * RAW_MODULE_LINES);
}
TEST_CASE("DiffractionExperiment_DetectorModuleHostname","[DiffractionExperiment]") {
std::vector<std::string> h = {"mx1", "mx2", "mx3"};
DiffractionExperiment x(DetectorSetup(3, "X", h));