diff --git a/rugnux/rugnux_cli.cpp b/rugnux/rugnux_cli.cpp index cc30c1bb5..9fb9bac46 100644 --- a/rugnux/rugnux_cli.cpp +++ b/rugnux/rugnux_cli.cpp @@ -2163,15 +2163,22 @@ int RugnuxInputRun::PrepareRugnuxInput() { output_provenance.collection_date = dataset->arm_date; { // The header as the file states it, before anything is measured: what a question about a run - // is answered from first. + // is answered from first. The wavelength is the one used: --wavelength, where given, is not + // refined later, so the file's value would be printed for a run that never used it (--mode scale + // keeps the wavelength its reflections were integrated at). const auto &x = dataset->experiment; const auto gonio = x.GetGoniometer(); const auto [direct_x, direct_y] = x.GetDiffractionGeometry().GetDirectBeam_pxl(); - logger.Info("Header: {} images, detector {} {} x {} px of {:.4f} mm, wavelength {:.5f} A, distance " + const bool wavelength_given = wavelength_A && mode != RugnuxMode::Scale; + const float used_wavelength_A = wavelength_given ? *wavelength_A : x.GetWavelength_A(); + const std::string wavelength_source = + wavelength_given ? fmt::format(" (--wavelength; the file states {:.5f} A)", x.GetWavelength_A()) : ""; + logger.Info("Header: {} images, detector {} {} x {} px of {:.4f} mm, wavelength {:.5f} A{}, distance " "{:.3f} mm, beam {:.2f} {:.2f} px (direct beam {:.2f} {:.2f}), tilt {:.4f} {:.4f} deg, {}, " "polarization {}", reader.GetNumberOfImages(), x.GetDetectorDescription(), x.GetXPixelsNum(), x.GetYPixelsNum(), - x.GetPixelSize_mm(), x.GetWavelength_A(), x.GetDetectorDistance_mm(), x.GetBeamX_pxl(), + x.GetPixelSize_mm(), used_wavelength_A, wavelength_source, x.GetDetectorDistance_mm(), + x.GetBeamX_pxl(), x.GetBeamY_pxl(), direct_x, direct_y, x.GetPoniRot1_rad() * 180.0 / PI, x.GetPoniRot2_rad() * 180.0 / PI, gonio ? fmt::format("rotation from {:.3f} deg by {:.4f} deg per image", gonio->GetStart_deg(), @@ -2181,7 +2188,7 @@ int RugnuxInputRun::PrepareRugnuxInput() { : std::string("not stated")); console->OnNote(fmt::format("{} images, {} {} x {} px", reader.GetNumberOfImages(), x.GetDetectorDescription(), x.GetXPixelsNum(), x.GetYPixelsNum())); - console->OnNote(fmt::format("{:.4f} A, {:.1f} mm, {}", x.GetWavelength_A(), x.GetDetectorDistance_mm(), + console->OnNote(fmt::format("{:.4f} A, {:.1f} mm, {}", used_wavelength_A, x.GetDetectorDistance_mm(), gonio ? fmt::format("{:.3f} deg per image", gonio->GetIncrement_deg()) : std::string("no rotation axis"))); }