reader: read sensor thickness/material from the HDF5 metadata
HDF5MetadataSource ignored /entry/instrument/detector/sensor_thickness and sensor_material and left the DetectorSetup default (320 um, Si). Read them when present (NXmx stores thickness in metres), so reprocessing honours the recorded sensor -- which the parallax/absorption model needs. (The acquisition path still records the 320 um default because DetDECTRIS sets no per-model thickness; that is a separate, acquisition-side fix.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -647,6 +647,12 @@ HDF5MetadataSource::OpenResult HDF5MetadataSource::Open(const std::string &filen
|
||||
|
||||
DetectorSetup detector = DetDECTRIS(image_size_x, image_size_y, detector_name, {});
|
||||
detector.PixelSize_um(master_file->GetFloat("/entry/instrument/detector/x_pixel_size") * 1e6);
|
||||
// Sensor thickness/material drive the parallax/absorption model, so take them from the file
|
||||
// rather than the DetectorSetup default (NXmx stores thickness in metres).
|
||||
if (master_file->Exists("/entry/instrument/detector/sensor_thickness"))
|
||||
detector.SensorThickness_um(master_file->GetFloat("/entry/instrument/detector/sensor_thickness") * 1e6);
|
||||
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"));
|
||||
detector.MinFrameTime(std::chrono::microseconds(0));
|
||||
detector.MinCountTime(std::chrono::microseconds(0));
|
||||
|
||||
Reference in New Issue
Block a user