rugnux: the unmerged MTZ carries the sensor efficiency in its own column, not inside LP
LP is a column other programs read and un-apply. It is documented as the Lorentz-polarization factor, and until the sensor efficiency was folded into the same product that is what it held. Measured on our own unmerged file, LP spanned a factor of 1.1343 across the detector where pure L/P spans nothing of the sort - the excess is the efficiency, 13% end to end at 13 keV and 34% at 18 keV. Both reference implementations keep it out. Recomputing pure L/P from a stored XDS file's own geometry over its 124k reflections leaves RLP flat to 0.1% from 8.6 to 33.7 degrees, where a folded-in efficiency would have shown a 7% trend - and XDS has the sensor numbers in hand. DIALS fills LP from lorentz and polarization alone and writes QE as a separate column, even a column of ones. Split them: LP is L/P again, QE is the efficiency, and the intensity is unchanged, so a reader that un-applies LP recovers what it expects and one that wants raw counts divides by LP and multiplies by QE. Only the unmerged file moves - every other column is bit-identical and the file grows by exactly one float per reflection plus one header record. The merged files are byte for byte what they were. The process file gains an optional qe dataset beside the existing one rather than changing what that one means, so a file written before the efficiency existed still loads, and reads back as a correction of exactly one - which is what it was. It is stored rather than recomputed on read because the writer has no geometry to recompute it from, and because recomputing would have written a radial trend into every stored file that never had one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFEJG6WBQv8th4UJFNe53N
This commit is contained in:
@@ -15,7 +15,7 @@ void HDF5DataFilePluginReflection::Write(const DataMessage &msg, uint64_t image_
|
||||
return;
|
||||
|
||||
std::vector<int32_t> h, k, l;
|
||||
std::vector<float> I, sigma, d, lp;
|
||||
std::vector<float> I, sigma, d, lp, qe;
|
||||
std::vector<float> image, phi, pred_x, pred_y, obs_x, obs_y, bkg, var_bkg, partiality, zeta,
|
||||
scale_factor;
|
||||
|
||||
@@ -32,6 +32,7 @@ void HDF5DataFilePluginReflection::Write(const DataMessage &msg, uint64_t image_
|
||||
bkg.reserve(msg.reflections.size());
|
||||
var_bkg.reserve(msg.reflections.size());
|
||||
lp.reserve(msg.reflections.size());
|
||||
qe.reserve(msg.reflections.size());
|
||||
partiality.reserve(msg.reflections.size());
|
||||
image.reserve(msg.reflections.size());
|
||||
phi.reserve(msg.reflections.size());
|
||||
@@ -53,6 +54,7 @@ void HDF5DataFilePluginReflection::Write(const DataMessage &msg, uint64_t image_
|
||||
bkg.emplace_back(refl.bkg);
|
||||
var_bkg.emplace_back(refl.var_bkg);
|
||||
lp.emplace_back(1.0/refl.prescaling_corr);
|
||||
qe.emplace_back(1.0/refl.qe_corr);
|
||||
partiality.emplace_back(refl.partiality);
|
||||
phi.emplace_back(refl.delta_phi_deg);
|
||||
zeta.emplace_back(refl.zeta);
|
||||
@@ -77,6 +79,7 @@ void HDF5DataFilePluginReflection::Write(const DataMessage &msg, uint64_t image_
|
||||
image_group.SaveVector("background_variance", var_bkg);
|
||||
image_group.SaveVector("observed_frame", image);
|
||||
image_group.SaveVector("lp", lp);
|
||||
image_group.SaveVector("qe", qe);
|
||||
image_group.SaveVector("partiality", partiality);
|
||||
image_group.SaveVector("zeta", zeta);
|
||||
image_group.SaveVector("image_scale_corr", scale_factor);
|
||||
|
||||
Reference in New Issue
Block a user