torchref.maps.map module
Base Map class for crystallographic electron density map computation.
Supports 2mFo-DFc and Fcalc map types. Computes maps via FFT of map coefficients placed on a reciprocal-space grid.
FFT convention: ρ(r) = sum_h F(h) * exp(-2πi h·r) This corresponds to torch.fft.fftn (forward DFT with exp(-2πi) kernel). Hermitian symmetry F(-h) = F*(h) is enforced by place_on_grid to ensure a real-valued map.
- class torchref.maps.map.Map(data, model, gridsize=None, map_type='2mFo-DFc', device=None)[source]
Bases:
DeviceMixinCrystallographic electron density map.
- Parameters:
data (ReflectionData) – Observed reflection data with amplitudes, hkl, cell, and spacegroup.
model (ModelFT) – Model for computing Fcalc (structure factors).
gridsize (tuple of int, optional) – Grid dimensions (nx, ny, nz). If None, determined automatically from cell parameters and resolution.
map_type (str, optional) – Type of map to compute. One of
"2mFo-DFc"or"Fcalc". Default is"2mFo-DFc".
- VALID_MAP_TYPES = ('2mFo-DFc', 'Fcalc')