Files
Jungfraujoch/image_analysis/WriteReflections.h
T
leonarski_fandClaude Opus 4.8 a79f05134b
Build Packages / Unit tests (push) Successful in 1h19m28s
Build Packages / build:windows:cuda (push) Successful in 13m16s
Build Packages / build:viewer-tgz:cpu (push) Successful in 6m54s
Build Packages / build:viewer-tgz:cuda (push) Successful in 7m28s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 9m13s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 9m53s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m36s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m55s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m18s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m23s
Build Packages / build:rpm (rocky8) (push) Successful in 10m55s
Build Packages / build:rpm (rocky9) (push) Successful in 11m37s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 10m38s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 10m37s
Build Packages / DIALS test (push) Successful in 11m59s
Build Packages / XDS test (durin plugin) (push) Successful in 7m25s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 8m0s
Build Packages / XDS test (neggia plugin) (push) Successful in 7m16s
Build Packages / Generate python client (push) Successful in 25s
Build Packages / Build documentation (push) Successful in 56s
Build Packages / Create release (push) Skipped
Build Packages / Unit tests (pull_request) Successful in 1h2m9s
Build Packages / build:windows:nocuda (pull_request) Successful in 11m23s
Build Packages / build:viewer-tgz:cpu (pull_request) Successful in 6m33s
Build Packages / build:viewer-tgz:cuda (pull_request) Successful in 7m26s
Build Packages / build:rpm (rocky8_nocuda) (pull_request) Successful in 9m29s
Build Packages / build:rpm (rocky9_nocuda) (pull_request) Successful in 9m40s
Build Packages / build:rpm (ubuntu2204_nocuda) (pull_request) Successful in 8m58s
Build Packages / build:rpm (ubuntu2404_nocuda) (pull_request) Successful in 8m35s
Build Packages / build:rpm (rocky8_sls9) (pull_request) Successful in 9m47s
Build Packages / build:rpm (rocky9_sls9) (pull_request) Successful in 10m32s
Build Packages / build:rpm (rocky8) (pull_request) Successful in 9m44s
Build Packages / build:rpm (rocky9) (pull_request) Successful in 11m1s
Build Packages / build:rpm (ubuntu2204) (pull_request) Successful in 10m11s
Build Packages / build:rpm (ubuntu2404) (pull_request) Successful in 9m49s
Build Packages / DIALS test (pull_request) Successful in 11m41s
Build Packages / XDS test (durin plugin) (pull_request) Successful in 7m25s
Build Packages / XDS test (JFJoch plugin) (pull_request) Successful in 7m2s
Build Packages / XDS test (neggia plugin) (pull_request) Successful in 6m25s
Build Packages / Generate python client (pull_request) Successful in 19s
Build Packages / Build documentation (pull_request) Successful in 52s
Build Packages / Create release (pull_request) Skipped
Build Packages / build:windows:nocuda (push) Successful in 10m34s
Build Packages / build:windows:cuda (pull_request) Successful in 18m35s
rugnux: also write merged reflections as SHELX HKLF-4 (.hkl)
WriteReflections now emits a third format alongside the MTZ and mmCIF: a
SHELX HKLF-4 text file (<prefix>.hkl), the direct input for SHELXC / ANODE /
SHELXD. Fixed FORMAT(3I4,2F8.2), one record per reflection as h k l I sig(I),
ending with the 0 0 0 terminator.

Two things make it a valid substructure-solution input:
- Bijvoet mates are written separately (I(+) at +hkl, I(-) at -hkl) so the
  anomalous differences survive; a reflection with no anomalous split is
  written once as its mean.
- Intensities are put on a common scale so the largest value fits the fixed
  F8.2 field (negative weak intensities would otherwise overflow it). I and
  sigma share the scale, so the anomalous signal is untouched; the absolute
  scale is irrelevant to SHELXC/ANODE, which use only ratios.

The MTZ writer's Bijvoet row-building is factored into a shared BuildMergedRows
helper so the MTZ and HKL outputs agree (MTZ output is byte-equivalent to
before). docs/RUGNUX.md updated to describe the three reflection formats.

Validated end-to-end on lysozyme: SHELXC reads the .hkl and reports real
anomalous signal (<d"/sig> 1.6 at low res), and ANODE locates the Met/Cys S
and a chloride at 6.5-9 sigma from the unmodified file.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 07:56:55 +02:00

40 lines
1.7 KiB
C++

// SPDX-FileCopyrightText: 2025 Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <string>
#include <vector>
#include "../common/Reflection.h"
#include "../common/UnitCell.h"
#include "../common/DiffractionExperiment.h"
struct MergeStatistics;
struct TwinningAnalysisResult;
void WriteMmcifReflections(const std::vector<MergedReflection> &reflections,
const UnitCell &unitCell,
const DiffractionExperiment &experiment,
const MergeStatistics &statistics,
const std::string &isa,
const TwinningAnalysisResult &twinning,
const std::string &filename);
void WriteMtzReflections(const std::vector<MergedReflection> &reflections,
const UnitCell &unitCell,
const DiffractionExperiment &experiment,
const std::string &filename);
// SHELX HKLF-4 text file (h k l I sigma(I), Bijvoet mates separate) for SHELXC / ANODE.
void WriteShelxHklReflections(const std::vector<MergedReflection> &reflections,
const DiffractionExperiment &experiment,
const std::string &filename);
void WriteReflections(const std::vector<MergedReflection> &reflections,
const UnitCell &unitCell,
const DiffractionExperiment &experiment,
const MergeStatistics &statistics,
const std::string &isa,
const TwinningAnalysisResult &twinning,
const std::string &filename);