v1.0.0-rc.36
This commit is contained in:
+114
-131
@@ -54,77 +54,6 @@ TEST_CASE("DiffractionExperiment_Compression","[DiffractionExperiment]") {
|
||||
REQUIRE(x.GetCompressionAlgorithm() == CompressionAlgorithm::NO_COMPRESSION);
|
||||
}
|
||||
|
||||
//TODO: Update
|
||||
/* TEST_CASE("DiffractionExperiment_Timing","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x;
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
// Timing and frame count
|
||||
x.PedestalG0Frames(1000).ImagesPerTrigger(1000).NumTriggers(1).FrameTime(1000us).FPGA;
|
||||
|
||||
// Frame count analysis
|
||||
|
||||
REQUIRE(x.GetFrameNum() == 1000);
|
||||
REQUIRE(x.GetFrameTime().count() == 1000);
|
||||
|
||||
REQUIRE(x.GetPixelDepth() == 2);
|
||||
REQUIRE(x.GetOverflow() == INT16_MAX);
|
||||
REQUIRE(x.GetUnderflow() == INT16_MIN);
|
||||
REQUIRE(x.GetFrameNumPerTrigger() == 1000);
|
||||
x.PedestalG0Frames(1000).PedestalG1Frames(2000).PedestalG2Frames(3000).NumTriggers(1)
|
||||
.ImagesPerTrigger(1000).FrameTime(1000us).Summation(6);
|
||||
|
||||
REQUIRE(x.GetImageNum() == 1000);
|
||||
REQUIRE(x.GetImageNumPerTrigger() == 1000);
|
||||
REQUIRE(x.GetFrameNum() == 6000);
|
||||
REQUIRE(x.GetFrameTime().count() == 1000);
|
||||
REQUIRE(x.GetFrameCountTime().count() == 1000 - READOUT_TIME_IN_US);
|
||||
REQUIRE(x.GetSummation() == 6);
|
||||
REQUIRE(x.GetImageTime().count() == 6*1000);
|
||||
REQUIRE(x.GetImageCountTime().count() == 6 * (1000 - READOUT_TIME_IN_US));
|
||||
REQUIRE(x.GetFrameNumPerTrigger() == 6000);
|
||||
REQUIRE(x.GetPedestalG0Frames() == 1000);
|
||||
REQUIRE(x.GetPedestalG1Frames() == 2000);
|
||||
REQUIRE(x.GetPedestalG2Frames() == 3000);
|
||||
REQUIRE(x.GetPixelDepth() == 4);
|
||||
REQUIRE(x.GetOverflow() == INT32_MAX);
|
||||
REQUIRE(x.GetUnderflow() == INT32_MIN);
|
||||
|
||||
x.NumTriggers(2);
|
||||
REQUIRE(x.GetFrameNum() == 12000);
|
||||
REQUIRE(x.GetNumTriggers() == 2);
|
||||
REQUIRE(x.GetImageNum() == 2000);
|
||||
REQUIRE(x.GetImageNumPerTrigger() == 1000);
|
||||
REQUIRE(x.GetFrameNumPerTrigger() == 6000);
|
||||
|
||||
x.Mode(DetectorMode::Raw);
|
||||
REQUIRE(x.GetSummation() == 1);
|
||||
REQUIRE(x.GetFrameNum() == 2000);
|
||||
REQUIRE(x.GetImageNum() == 2000);
|
||||
REQUIRE(x.GetImageNumPerTrigger() == 1000);
|
||||
|
||||
x.Mode(DetectorMode::PedestalG0);
|
||||
|
||||
REQUIRE(x.GetFrameTime().count() == 1000);
|
||||
REQUIRE(x.GetDetectorMode() == DetectorMode::PedestalG0);
|
||||
REQUIRE(x.GetFrameNum() == 1000);
|
||||
REQUIRE(x.GetSummation() == 1);
|
||||
REQUIRE(x.GetImageNumPerTrigger() == 0);
|
||||
|
||||
x.Mode(DetectorMode::PedestalG1);
|
||||
REQUIRE(x.GetDetectorMode() == DetectorMode::PedestalG1);
|
||||
REQUIRE(x.GetFrameNum() == 2000);
|
||||
REQUIRE(x.GetFrameTime().count() == 10000);
|
||||
REQUIRE(x.GetSummation() == 1);
|
||||
|
||||
x.PedestalG1G2FrameTime(8345us);
|
||||
x.Mode(DetectorMode::PedestalG2);
|
||||
|
||||
REQUIRE(x.GetDetectorMode() == DetectorMode::PedestalG2);
|
||||
REQUIRE(x.GetFrameNum() == 3000);
|
||||
REQUIRE(x.GetFrameTime().count() == 8345);
|
||||
REQUIRE(x.GetSummation() == 1);
|
||||
} */
|
||||
|
||||
TEST_CASE("DiffractionExperiment_UnitCell","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x;
|
||||
REQUIRE(!x.GetUnitCell());
|
||||
@@ -203,7 +132,7 @@ TEST_CASE("MacAddressFromStr","") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_DataStreams","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(18)); // 9M
|
||||
DiffractionExperiment x(DetJF(18)); // 9M
|
||||
|
||||
x.DataStreams(4);
|
||||
REQUIRE(x.GetModulesNum() == 18);
|
||||
@@ -223,7 +152,7 @@ TEST_CASE("DiffractionExperiment_DataStreams","[DiffractionExperiment]") {
|
||||
REQUIRE(x.GetModulesNum(1) == 9);
|
||||
REQUIRE_THROWS(x.GetModulesNum(2));
|
||||
|
||||
x = DiffractionExperiment(DetectorGeometry(2));
|
||||
x = DiffractionExperiment(DetJF(2));
|
||||
|
||||
x.DataStreams(2);
|
||||
REQUIRE(x.GetModulesNum() == 2);
|
||||
@@ -241,7 +170,7 @@ TEST_CASE("DiffractionExperiment_DataStreams","[DiffractionExperiment]") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_DetectorGeometry","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(18)); // 9M configuration #1 - via constructor
|
||||
DiffractionExperiment x(DetJF(18)); // 9M configuration #1 - via constructor
|
||||
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
x.DataStreams(4);
|
||||
@@ -270,32 +199,31 @@ TEST_CASE("DiffractionExperiment_DetectorGeometry","[DiffractionExperiment]") {
|
||||
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
|
||||
x = DiffractionExperiment(DetectorGeometry(18, 2)); // 9M configuration #2
|
||||
x = DiffractionExperiment(DetJF(18, 2)); // 9M configuration #2
|
||||
|
||||
REQUIRE(x.GetPixelsNum() == 1030 * 514 * 18);
|
||||
REQUIRE(x.GetXPixelsNum() == 1030 * 2);
|
||||
REQUIRE(x.GetYPixelsNum() == 514 * 18 / 2);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(0) == 16 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModule(1) == 16 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(0) == 16 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(1) == 16 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(12) == 4 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModule(13) == 4 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(12) == 4 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(13) == 4 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(14) == 2 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModule(15) == 2 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(14) == 2 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(15) == 2 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(16) == 0 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModule(17) == 0 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(16) == 0 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(17) == 0 * CONVERTED_MODULE_SIZE + 513 * CONVERTED_MODULE_COLS * 2 + CONVERTED_MODULE_COLS);
|
||||
|
||||
REQUIRE_THROWS(x.GetPixel0OfModule(18));
|
||||
REQUIRE_THROWS(x.GetPixel0OfModuleConv(18));
|
||||
|
||||
x.Mode(DetectorMode::Raw);
|
||||
|
||||
REQUIRE(x.GetPixelsNum() == 1024 * 512 * 18);
|
||||
REQUIRE(x.GetXPixelsNum() == 1024);
|
||||
REQUIRE(x.GetYPixelsNum() == 512 * 18);
|
||||
REQUIRE(x.GetPixel0OfModule(15) == 15 * RAW_MODULE_SIZE);
|
||||
|
||||
}
|
||||
|
||||
@@ -303,7 +231,7 @@ TEST_CASE("DiffractionExperiment_DetectorGeometry_gaps","[DiffractionExperiment]
|
||||
const size_t gap_x = 8;
|
||||
const size_t gap_y = 36;
|
||||
|
||||
DiffractionExperiment x(DetectorGeometry(18, 2, gap_x, gap_y, false));
|
||||
DiffractionExperiment x(DetJF(18, 2, gap_x, gap_y, false));
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
x.DataStreams(4);
|
||||
|
||||
@@ -321,37 +249,37 @@ TEST_CASE("DiffractionExperiment_DetectorGeometry_gaps","[DiffractionExperiment]
|
||||
REQUIRE(x.GetFirstModuleOfDataStream(2) == 10);
|
||||
REQUIRE(x.GetFirstModuleOfDataStream(3) == 14);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(0) == (2*1030 + gap_x) * (514 + gap_y) * (0/2));
|
||||
REQUIRE(x.GetPixel0OfModule(4) == (2*1030 + gap_x) * (514 + gap_y) * (4/2));
|
||||
REQUIRE(x.GetPixel0OfModule(8) == (2*1030 + gap_x) * (514 + gap_y) * (8/2));
|
||||
REQUIRE(x.GetPixel0OfModule(14) == (2*1030 + gap_x) * (514 + gap_y) * (14/2));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(0) == (2*1030 + gap_x) * (514 + gap_y) * (0/2));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(4) == (2*1030 + gap_x) * (514 + gap_y) * (4/2));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(8) == (2*1030 + gap_x) * (514 + gap_y) * (8/2));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(14) == (2*1030 + gap_x) * (514 + gap_y) * (14/2));
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(0) == (2*1030 + gap_x) * 0 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModule(1) == (2*1030 + gap_x) * 0 * (514 + gap_y) + 1030 + gap_x);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(0) == (2*1030 + gap_x) * 0 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(1) == (2*1030 + gap_x) * 0 * (514 + gap_y) + 1030 + gap_x);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(16) == (2*1030 + gap_x) * 8 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModule(17) == (2*1030 + gap_x) * 8 * (514 + gap_y) + 1030 + gap_x);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(16) == (2*1030 + gap_x) * 8 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(17) == (2*1030 + gap_x) * 8 * (514 + gap_y) + 1030 + gap_x);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_DetectorGeometry_gaps_mirror_y","[DiffractionExperiment]") {
|
||||
const size_t gap_x = 8;
|
||||
const size_t gap_y = 36;
|
||||
|
||||
DiffractionExperiment x(DetectorGeometry(20, 2, gap_x, gap_y, true));
|
||||
DiffractionExperiment x(DetJF(20, 2, gap_x, gap_y, true));
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(0) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 9 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModule(1) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 9 * (514 + gap_y) + 1030 + gap_x);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(0) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 9 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(1) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 9 * (514 + gap_y) + 1030 + gap_x);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(14) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 2 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModule(15) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 2 * (514 + gap_y) + 1030 + gap_x);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(14) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 2 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(15) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 2 * (514 + gap_y) + 1030 + gap_x);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(16) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 1 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModule(17) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 1 * (514 + gap_y) + 1030 + gap_x);
|
||||
REQUIRE(x.GetPixel0OfModuleConv(16) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 1 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(17) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 1 * (514 + gap_y) + 1030 + gap_x);
|
||||
|
||||
REQUIRE(x.GetPixel0OfModule(18) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 0 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModule(19) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 0 * (514 + gap_y) + 1030 + gap_x);
|
||||
REQUIRE_THROWS(x.GetPixel0OfModule(20));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(18) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 0 * (514 + gap_y));
|
||||
REQUIRE(x.GetPixel0OfModuleConv(19) == (2*1030+gap_x) * 513 + (2*1030 + gap_x) * 0 * (514 + gap_y) + 1030 + gap_x);
|
||||
REQUIRE_THROWS(x.GetPixel0OfModuleConv(20));
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_Metadata","[DiffractionExperiment]") {
|
||||
@@ -453,7 +381,7 @@ TEST_CASE("DiffractionExperiment_SaveCalibration", "[DiffractionExperiment]") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_FrameCountTime_JUNGFRAU","[DiffractionExperiment]") {
|
||||
DetectorSetup setup(DetectorGeometry(1), DetectorType::JUNGFRAU);
|
||||
DetectorSetup setup(DetJF(1));
|
||||
setup.ReadOutTime(50us);
|
||||
DiffractionExperiment x(setup);
|
||||
REQUIRE_NOTHROW(x.FrameTime(1000us, 3us));
|
||||
@@ -468,7 +396,7 @@ TEST_CASE("DiffractionExperiment_FrameCountTime_JUNGFRAU","[DiffractionExperimen
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_FrameCountTime_JUNGFRAU_PedestalG1G2","[DiffractionExperiment]") {
|
||||
DetectorSetup setup(DetectorGeometry(1), DetectorType::JUNGFRAU);
|
||||
DetectorSetup setup(DetJF(1));
|
||||
setup.ReadOutTime(50us);
|
||||
DiffractionExperiment x(setup);
|
||||
REQUIRE_NOTHROW(x.FrameTime(1000us));
|
||||
@@ -514,7 +442,7 @@ TEST_CASE("DiffractionExperiment_CopyConstructor", "[DiffractionExperiment]") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_AzIntegration_QRange","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
DiffractionExperiment x(DetJF(8, 2, 8, 36));
|
||||
|
||||
REQUIRE_THROWS(x.QRangeForAzimInt_recipA(-1,5));
|
||||
|
||||
@@ -531,7 +459,7 @@ TEST_CASE("DiffractionExperiment_AzIntegration_QRange","[DiffractionExperiment]"
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_AzIntegration_QSpacing","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
DiffractionExperiment x(DetJF(8, 2, 8, 36));
|
||||
|
||||
x.QSpacingForAzimInt_recipA(0.456);
|
||||
REQUIRE(x.GetQSpacingForAzimInt_recipA() == Catch::Approx(0.456));
|
||||
@@ -541,7 +469,7 @@ TEST_CASE("DiffractionExperiment_AzIntegration_QSpacing","[DiffractionExperiment
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_AzIntegration_Bins","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
|
||||
DiffractionExperiment x(DetJF(8, 2, 8, 36));
|
||||
|
||||
x.QRangeForAzimInt_recipA(1,6);
|
||||
x.QSpacingForAzimInt_recipA(1.0);
|
||||
@@ -625,7 +553,7 @@ TEST_CASE("DiffractionExperiment_StorageCells_Pedestal_FixedG1","[DiffractionExp
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_ImageTime","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorSetup(3, DetectorType::JUNGFRAU));
|
||||
DiffractionExperiment x(DetJF(3));
|
||||
DatasetSettings s;
|
||||
x.FrameTime(583us);
|
||||
|
||||
@@ -642,7 +570,7 @@ TEST_CASE("DiffractionExperiment_ImageTime","[DiffractionExperiment]") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_ImageTime_EIGER","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorSetup(3, DetectorType::EIGER));
|
||||
DiffractionExperiment x(DetEIGER(3));
|
||||
DatasetSettings s;
|
||||
x.FrameTime(583us);
|
||||
REQUIRE(x.GetDetectorSetup().GetReadOutTime() == 3us);
|
||||
@@ -652,14 +580,14 @@ TEST_CASE("DiffractionExperiment_ImageTime_EIGER","[DiffractionExperiment]") {
|
||||
REQUIRE(x.GetSummation() == 1);
|
||||
REQUIRE(x.GetFrameTime() == 5ms);
|
||||
REQUIRE(x.GetFrameCountTime() == 5000us - 3us);
|
||||
REQUIRE(x.GetByteDepthReadout() == 4);
|
||||
REQUIRE(x.GetBitDepthReadout() == 32);
|
||||
|
||||
s.ImageTime({});
|
||||
REQUIRE_NOTHROW(x.ImportDatasetSettings(s));
|
||||
REQUIRE(x.GetSummation() == 1);
|
||||
REQUIRE(x.GetFrameTime() == 583us);
|
||||
REQUIRE(x.GetFrameCountTime() == 583us - 3us);
|
||||
REQUIRE(x.GetByteDepthReadout() == 2);
|
||||
REQUIRE(x.GetBitDepthReadout() == 16);
|
||||
|
||||
s.ImageTime(200us);
|
||||
REQUIRE_THROWS(x.ImportDatasetSettings(s));
|
||||
@@ -667,7 +595,7 @@ TEST_CASE("DiffractionExperiment_ImageTime_EIGER","[DiffractionExperiment]") {
|
||||
s.ImageTime(250us);
|
||||
REQUIRE_NOTHROW(x.ImportDatasetSettings(s));
|
||||
REQUIRE(x.GetSummation() == 1);
|
||||
REQUIRE(x.GetByteDepthReadout() == 1);
|
||||
REQUIRE(x.GetBitDepthReadout() == 8);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_PulsedSource","[DiffractionExperiment]") {
|
||||
@@ -716,7 +644,7 @@ TEST_CASE("DiffractionExperiment_DefaultDataProcessingSettings","[DiffractionExp
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_FPGA_PixelSigned_JUNGFRAU","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorSetup(DetectorGeometry(4), DetectorType::JUNGFRAU));
|
||||
DiffractionExperiment x(DetJF(4));
|
||||
|
||||
x.Mode(DetectorMode::Conversion).PixelSigned({});
|
||||
REQUIRE(x.IsPixelSigned());
|
||||
@@ -732,7 +660,7 @@ TEST_CASE("DiffractionExperiment_FPGA_PixelSigned_JUNGFRAU","[DiffractionExperim
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_FPGA_PixelSigned_EIGER","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorSetup(DetectorGeometry(4), DetectorType::EIGER));
|
||||
DiffractionExperiment x(DetEIGER(4));
|
||||
|
||||
x.Mode(DetectorMode::Conversion).PixelSigned({});
|
||||
REQUIRE(!x.IsPixelSigned());
|
||||
@@ -784,7 +712,9 @@ TEST_CASE("DiffractionExperiment_Summation","[DiffractionExperiment]") {
|
||||
|
||||
TEST_CASE("DiffractionExperiment_DetectorModuleHostname","[DiffractionExperiment]") {
|
||||
std::vector<std::string> h = {"mx1", "mx2", "mx3"};
|
||||
DiffractionExperiment x(DetectorSetup(3, DetectorType::JUNGFRAU, "X", h));
|
||||
DiffractionExperiment x(DetectorSetup(DetectorGeometryModular(3),
|
||||
DetectorType::JUNGFRAU,
|
||||
"X", h));
|
||||
|
||||
std::vector<AcquisitionDeviceNetConfig> net_cfg;
|
||||
|
||||
@@ -809,26 +739,79 @@ TEST_CASE("DiffractionExperiment_DetectorModuleHostname","[DiffractionExperiment
|
||||
TEST_CASE("DiffractionExperiment_GetImageFillValue","") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
x.BitDepthImage(16).PixelSigned(false);
|
||||
REQUIRE(x.GetImageFillValue() == UINT16_MAX);
|
||||
|
||||
x.BitDepthImage(16).PixelSigned(true);
|
||||
REQUIRE(x.GetImageFillValue() == INT16_MIN);
|
||||
|
||||
x.BitDepthImage(32).PixelSigned(true);
|
||||
REQUIRE(x.GetImageFillValue() == INT32_MIN);
|
||||
REQUIRE(x.GetOverflow() == INT32_MAX);
|
||||
REQUIRE(x.GetUnderflow() == INT32_MIN);
|
||||
|
||||
x.BitDepthImage(32).PixelSigned(false);
|
||||
REQUIRE(x.GetImageFillValue() == UINT32_MAX);
|
||||
REQUIRE(x.GetOverflow() == UINT32_MAX);
|
||||
REQUIRE(x.GetUnderflow() == -1);
|
||||
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(true);
|
||||
REQUIRE(x.GetImageFillValue() == INT8_MIN);
|
||||
REQUIRE(x.GetOverflow() == INT8_MAX);
|
||||
REQUIRE(x.GetUnderflow() == INT8_MIN);
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(false);
|
||||
REQUIRE(x.GetImageFillValue() == UINT8_MAX);
|
||||
REQUIRE(x.GetOverflow() == UINT8_MAX);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_GetUnderflow","") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
x.BitDepthImage(16).PixelSigned(true);
|
||||
REQUIRE(x.GetUnderflow() == INT16_MIN);
|
||||
|
||||
x.BitDepthImage(16).PixelSigned(false);
|
||||
REQUIRE(x.GetUnderflow() == -1);
|
||||
|
||||
x.BitDepthImage(32).PixelSigned(true);
|
||||
REQUIRE(x.GetUnderflow() == INT32_MIN);
|
||||
|
||||
x.BitDepthImage(32).PixelSigned(false);
|
||||
REQUIRE(x.GetUnderflow() == -1);
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(true);
|
||||
REQUIRE(x.GetUnderflow() == INT8_MIN);
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(false);
|
||||
REQUIRE(x.GetUnderflow() == -1);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_GetSaturationLevel_Implicit","") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
x.BitDepthImage(32).PixelSigned(true);
|
||||
REQUIRE(x.GetSaturationLimit() == INT32_MAX);
|
||||
|
||||
x.BitDepthImage(32).PixelSigned(false);
|
||||
REQUIRE(x.GetSaturationLimit() == UINT32_MAX);
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(true);
|
||||
REQUIRE(x.GetSaturationLimit() == INT8_MAX);
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(false);
|
||||
REQUIRE(x.GetSaturationLimit() == UINT8_MAX);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_GetSaturationLevel_Explicit","") {
|
||||
DiffractionExperiment x;
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(false);
|
||||
|
||||
x.Detector().SaturationLimit(954);
|
||||
REQUIRE(x.GetSaturationLimit() == UINT8_MAX); // 954 > UINT8_MAX
|
||||
|
||||
x.BitDepthImage(8).PixelSigned(true);
|
||||
REQUIRE(x.GetSaturationLimit() == INT8_MAX); // 954 > UINT8_MAX
|
||||
|
||||
x.BitDepthImage(32).PixelSigned(false);
|
||||
REQUIRE(x.GetSaturationLimit() == 954);
|
||||
|
||||
x.BitDepthImage(16).PixelSigned(true);
|
||||
REQUIRE(x.GetSaturationLimit() == 954);
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_Appendix","") {
|
||||
@@ -907,7 +890,7 @@ TEST_CASE("DiffractionExperiment_ConversionOnFPGA","[DiffractionExperiment]") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_EIGER","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorSetup(DetectorGeometry(4), DetectorType::EIGER));
|
||||
DiffractionExperiment x(DetEIGER(4));
|
||||
x.Mode(DetectorMode::Conversion);
|
||||
REQUIRE(!x.IsJungfrauConvPhotonCnt());
|
||||
REQUIRE(!x.IsPixelSigned());
|
||||
@@ -916,7 +899,7 @@ TEST_CASE("DiffractionExperiment_EIGER","[DiffractionExperiment]") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_JungfrauConversionFactor","[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorSetup(DetectorGeometry(4)));
|
||||
DiffractionExperiment x(DetJF(4));
|
||||
x.Mode(DetectorMode::Conversion).IncidentEnergy_keV(16.0);
|
||||
REQUIRE(!x.GetJungfrauConversionFactor_keV().has_value());
|
||||
REQUIRE(x.GetIncidentEnergy_keV() == 16.0f);
|
||||
@@ -963,7 +946,7 @@ TEST_CASE("DiffractionExperiment_GetDefaultPlotBinning", "[DiffractionExperiment
|
||||
x.ImagesPerTrigger(1); // 1 image, no binning
|
||||
CHECK(x.GetDefaultPlotBinning() == 1);
|
||||
|
||||
x.Detector(DetectorSetup(DetectorGeometry(4), DetectorType::EIGER));
|
||||
x.Detector(DetEIGER(4));
|
||||
DatasetSettings ds;
|
||||
ds.ImageTime(1s);
|
||||
REQUIRE_NOTHROW(x.ImportDatasetSettings(ds));
|
||||
@@ -973,7 +956,7 @@ TEST_CASE("DiffractionExperiment_GetDefaultPlotBinning", "[DiffractionExperiment
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_ImportDataset_TooManyFrames", "[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36, true));
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
x.ImagesPerTrigger(345).NumTriggers(17);
|
||||
DatasetSettings dataset;
|
||||
dataset.ImagesPerTrigger(100000).NumTriggers(100000);
|
||||
@@ -982,7 +965,7 @@ TEST_CASE("DiffractionExperiment_ImportDataset_TooManyFrames", "[DiffractionExpe
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_AutoSummation", "[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36, true));
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
x.Summation(4).AutoSummation(true);
|
||||
|
||||
x.Mode(DetectorMode::Conversion).StorageCells(1);
|
||||
@@ -1011,7 +994,7 @@ TEST_CASE("DiffractionExperiment_AutoSummation", "[DiffractionExperiment]") {
|
||||
}
|
||||
|
||||
TEST_CASE("DiffractionExperiment_ExportROIMask", "[DiffractionExperiment]") {
|
||||
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36, true));
|
||||
DiffractionExperiment x(DetJF4M());
|
||||
x.Mode(DetectorMode::Raw);
|
||||
|
||||
x.ROI().SetROI(ROIDefinition{.boxes = {
|
||||
|
||||
Reference in New Issue
Block a user