torchref.maps package
Maps module for torchref.
Provides classes for computing and writing crystallographic electron density maps.
Classes
- Map
Base class for 2mFo-DFc and Fcalc maps.
- DifferenceMap
Isomorphous difference map from two datasets.
- class torchref.maps.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')
- class torchref.maps.DifferenceMap(data, data_reference, model, gridsize=None, device=None)[source]
Bases:
MapIsomorphous difference map between two datasets.
Scales both datasets to a common reference using
DatasetCollection, then computes difference Fourier coefficients:DF * exp(i * phi_calc)whereDF = F_data - F_reference.- Parameters:
data (ReflectionData) – Reflection data for the perturbed state (e.g., light, derivative).
data_reference (ReflectionData) – Reflection data for the reference state (e.g., dark, native).
model (ModelFT) – Model for computing phases.
gridsize (tuple of int, optional) – Grid dimensions (nx, ny, nz). If None, determined automatically.