Readers: polarization from miniCBF and d*TREK headers (RESULT-CHANGING)

No reader parsed a polarization, and ApplyRugnuxExperimentDefaults then set
P = 0.99 (an undulator value) unconditionally, so laboratory-source data were
corrected as if from a synchrotron. Every d*TREK (Rigaku Saturn/A200) header in
the open arm states SOURCE_POLARZ=0.5 1 0 0, i.e. unpolarized; at Cu K-alpha and
2 A the wrong factor puts a +-33% azimuthal modulation on the intensities.

- d*TREK SMV: SOURCE_POLARZ is the fraction f followed by the plane normal (as
  dxtbx's FormatSMVRigaku reads it); stored as degree 2f - 1, negative where the
  normal lies along lab x (plane containing y).
- miniCBF: "# Polarization f" is the fraction in the horizontal plane; stored as
  2f - 1 ("None" or a missing line leave it unset).
- ApplyRugnuxExperimentDefaults sets 0.99 only where the file stated none;
  --polarization still overrides. ADSC SMV, marCCD and NXmx state nothing and
  keep 0.99.
- The "Header:" log line reports the stated polarization.

RESULT-CHANGING: d*TREK home-source sets (0.99 -> 0), one Rigaku miniCBF set
(0.99 -> 0), miniCBF sets stating 0.99 (0.99 -> 0.98).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PXc1zD1yxHqaR1DGdCTHL4
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-18 09:25:14 +02:00
1 parent 14ee27f362
commit b17b643bd9
11 files changed
+84 -14

No files matched your search

+7
View File
@@ -197,6 +197,13 @@ void ParseDtrek(const std::map<std::string, std::string> &kv, const std::string
h.wavelength_A = !scan_wavelength.empty() ? scan_wavelength[0]
: (source_wavelength.size() >= 2 ? source_wavelength[1] : 0.0);
// Read as dxtbx's FormatSMVRigaku reads it: the fraction first, then the plane normal.
const auto polarz = Nums(kv, "SOURCE_POLARZ");
if (polarz.size() >= 4) {
h.polarization_fraction = polarz[0];
h.polarization_normal = std::array<double, 3>{polarz[1], polarz[2], polarz[3]};
}
h.overflow_ratio = static_cast<int64_t>(Num(kv, "RAXIS_COMPRESSION_RATIO"));
const auto id = kv.find(det + "DETECTOR_IDENTIFICATION");
if (id != kv.end())