Files
Jungfraujoch/gemmi_gph/ccp4.cpp
T
leonarski_fandClaude Opus 4.8 5addb4483c gemmi_gph: vendor the model / structure-factor headers into the single gemmi target
Extend the vendored GEMMI subset (v0.7.5) with the atomic-model, structure-factor,
bulk-solvent and map machinery so the whole thing builds as one static `gemmi`
library instead of a separate target:

  - add the model/SF/map sources compiled into `gemmi`:
    pdb, resinfo, polyheur, calculate, eig3, ccp4
  - add the v0.7.5 headers these pull in (model.hpp, dencalc.hpp, sfcalc.hpp,
    solmask.hpp, scaling.hpp, fourier.hpp, grid.hpp, ccp4.hpp, it92.hpp, ...)
    plus third_party/pocketfft (FFT), half, tinydir

Only the low-level string/math/symmetry headers were present before; this makes
the vendored copy a complete, self-consistent gemmi that can read a PDB and do
density / structure-factor / map calculations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 21:27:44 +02:00

31 lines
669 B
C++

// Copyright 2021 Global Phasing Ltd.
#include "gemmi/ccp4.hpp"
#include "gemmi/gz.hpp" // for MaybeGzipped
namespace gemmi {
Ccp4<float> read_ccp4_map(const std::string& path, bool setup) {
Ccp4<float> ccp4;
ccp4.read_ccp4(MaybeGzipped(path));
if (setup)
ccp4.setup(NAN);
return ccp4;
}
Ccp4<int8_t> read_ccp4_mask(const std::string& path, bool setup) {
Ccp4<int8_t> ccp4;
ccp4.read_ccp4(MaybeGzipped(path));
if (setup)
ccp4.setup(-1);
return ccp4;
}
Ccp4Base read_ccp4_header(const std::string& path) {
Ccp4Base ccp4;
ccp4.read_ccp4_header_(nullptr, *MaybeGzipped(path).create_stream(), path);
return ccp4;
}
} // namespace gemmi