diff --git a/reader/HDF5MetadataSource.cpp b/reader/HDF5MetadataSource.cpp index 75eac328..2a3ca7ea 100644 --- a/reader/HDF5MetadataSource.cpp +++ b/reader/HDF5MetadataSource.cpp @@ -661,6 +661,15 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen if (master_file->Exists("/entry/instrument/detector/sensor_material")) detector.SensorMaterial(master_file->GetString("/entry/instrument/detector/sensor_material")); detector.SaturationLimit(master_file->GetInt("/entry/instrument/detector/saturation_value")); + // The container depth of the stored images, NOT the detector's counter depth. DetectorSetup + // defaults DECTRIS to 16 bits, and GetByteDepthImage() prefers that over the value the image + // format carries - so without this an EIGER2 file that stores 32-bit images has its overflow + // computed as a 16-bit one and every count above 32767 is called saturated. The integration + // accept gate then drops the WHOLE reflection, which silently removes the strongest + // reflections of a strong crystal (measured on a lysozyme set: max accepted pixel 32738 + // against a declared saturation of 108833). + if (master_file->Exists("/entry/instrument/detector/bit_depth_image")) + detector.BitDepthImage(master_file->GetInt("/entry/instrument/detector/bit_depth_image")); detector.MinFrameTime(std::chrono::microseconds(0)); detector.MinCountTime(std::chrono::microseconds(0)); detector.ReadOutTime(std::chrono::nanoseconds(0));