torchref.maps.difference_map module

Isomorphous difference map from two datasets.

Computes a difference Fourier map using DF = F_data - F_reference with phases from a model, after scaling both datasets to a common reference.

class torchref.maps.difference_map.DifferenceMap(data, data_reference, model, gridsize=None, device=None)[source]

Bases: Map

Isomorphous difference map between two datasets.

Scales both datasets to a common reference using DatasetCollection, then computes difference Fourier coefficients: DF * exp(i * phi_calc) where DF = 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.

__init__(data, data_reference, model, gridsize=None, device=None)[source]
calculate()[source]

Compute the isomorphous difference map.

Returns:

3D real-space difference map tensor.

Return type:

torch.Tensor