v1.0.0-rc.34
This commit is contained in:
@@ -137,6 +137,42 @@ TEST_CASE("PixelMask_MaskG0RMS","[PixelMask]") {
|
||||
CHECK(mask.GetStatistics().user_mask == 0);
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("PixelMask_SCs","[PixelMask]") {
|
||||
ImageFormatSettings image_format;
|
||||
image_format.MaskModuleEdges(false).MaskChipEdges(false).MaskPixelsWithoutG0(true).GeometryTransformed(false);
|
||||
image_format.PedestalG0RMSLimit(100);
|
||||
|
||||
DiffractionExperiment experiment(DetectorGeometry(4, 1));
|
||||
experiment.ImportImageFormatSettings(image_format);
|
||||
experiment.StorageCells(16);
|
||||
|
||||
PixelMask mask(experiment);
|
||||
|
||||
JFCalibration calibration(experiment);
|
||||
calibration.Pedestal(0,0, 12).GetPedestal()[456] = UINT16_MAX;
|
||||
calibration.Pedestal(1,2, 15).GetPedestal()[324] = UINT16_MAX;
|
||||
calibration.Pedestal(2,0, 1).GetPedestalRMS()[324] = 500;
|
||||
|
||||
calibration.Pedestal(3,0, 5).GetPedestalRMS()[0] = 500;
|
||||
calibration.Pedestal(3,2, 3).GetPedestal()[0] = UINT16_MAX;
|
||||
calibration.Pedestal(3,2, 11).GetPedestal()[0] = UINT16_MAX;
|
||||
calibration.Pedestal(3,2, 14).GetPedestal()[0] = UINT16_MAX;
|
||||
|
||||
mask.LoadDetectorBadPixelMask(experiment, &calibration);
|
||||
|
||||
auto mask_out = mask.GetMask(experiment);
|
||||
REQUIRE(mask_out.size() == experiment.GetModulesNum() * RAW_MODULE_SIZE);
|
||||
|
||||
CHECK(mask_out[456] == (1 << PixelMask::ErrorPixelBit));
|
||||
CHECK(mask_out[RAW_MODULE_SIZE * 1 + 324] == (1 << PixelMask::ErrorPixelBit));
|
||||
CHECK(mask_out[RAW_MODULE_SIZE * 2 + 324] == (1 << PixelMask::TooHighPedestalRMSPixelBit));
|
||||
CHECK(mask_out[RAW_MODULE_SIZE * 3 + 0] == ((1 << PixelMask::ErrorPixelBit) | (1 << PixelMask::TooHighPedestalRMSPixelBit)));
|
||||
|
||||
CHECK(mask.GetStatistics().too_high_pedestal_rms == 2);
|
||||
CHECK(mask.GetStatistics().wrong_gain == 3);
|
||||
}
|
||||
|
||||
TEST_CASE("PixelMask_CalculateNexusMask","[PixelMask]") {
|
||||
DiffractionExperiment experiment(DetectorGeometry(4, 1, 8, 36, false));
|
||||
experiment.MaskModuleEdges(false).MaskChipEdges(false);
|
||||
|
||||
Reference in New Issue
Block a user