susan.utils.datatypes

class susan.utils.datatypes.fsc_info(fpix: float, res: float)[source]

Bases: object

Resolution estimate returned by susan.utils.fsc_analyse().

Attributes

fpix

Resolution in Fourier pixels.

Type:

float

res

Resolution in Ångstroms. 0.0 if the FSC never drops below the requested threshold.

Type:

float

class susan.utils.datatypes.ssnr(S: float, F: float)[source]

Bases: object

Ad-hoc SSNR model used by susan.modules.Aligner and susan.modules.Averager.

The spectral signal-to-noise ratio is modelled as:

\[SSNR(s) = 10^{3S} \cdot e^{-100 F s}\]

where s is the spatial frequency in 1/Angstrom (\(s = r/(N \cdot apix)\), with r the Fourier-pixel radius and N the box size). This is the SSNR of a single projection, not of the reconstructed map: the term \(1/SSNR(s)\) is added to the Wiener denominator once per projection, so the resulting filter does not depend on how many particles or tilts contribute. See the Ad-hoc SSNR definition for background.

Attributes

S

Strength parameter: the SSNR at zero frequency is \(10^{3S}\). Typically set to 1.

Type:

float

F

Fall-off parameter, typically in the range 0 – 0.5. The SSNR loses one decade every \(0.023/F\) 1/Angstrom. Its value depends on the noise level of the data. With S = 1, the Wiener filter reaches half power at roughly \(16 \cdot F\) Angstrom.

Type:

float

class susan.utils.datatypes.bandpass(highpass: float, lowpass: float, rolloff: float)[source]

Bases: object

Bandpass filter descriptor with cosine-decay edges.

The filter is flat between highpass and lowpass and uses a cosine rolloff of width rolloff at both edges.

../_images/bandpass_def_light.svg ../_images/bandpass_def_dark.svg

Attributes

highpass

High-pass cutoff in Fourier pixels.

Type:

float

lowpass

Low-pass cutoff in Fourier pixels.

Type:

float

rolloff

Width of the cosine taper at each edge, in Fourier pixels.

Type:

float

class susan.utils.datatypes.search_params(span: float, step: float)[source]

Bases: object

Generic angular or offset search range and step.

Attributes

span

Total search range (half-range is span / 2).

Type:

float

step

Step size of the search.

Type:

float

class susan.utils.datatypes.offset_params(span: list, step: float, kind: str)[source]

Bases: object

Offset (translation) search parameters.

../_images/offsets_def_light.svg ../_images/offsets_def_dark.svg

Attributes

span

Offset range in 3-D, ordered [X, Y, Z].

Type:

list of float

step

Offset step size in pixels. For 3-D searches defaults to 1 but also accepts sub-pixel values such as 0.5 or 0.25. For 2-D searches it is fixed to 1.

Type:

float

kind

Shape of the search volume. Valid options for 3-D searches: 'ellipsoid' (default), 'cylinder', 'cuboid'. For 2-D searches only 'circle' is accepted.

Type:

str

class susan.utils.datatypes.refine_params(levels: int, factor: int)[source]

Bases: object

Multi-level angular refinement parameters.

Modelled after DYNAMO’s angular refinement policy.

Attributes

levels

Number of refinement levels. Each level halves the angular step.

Type:

int

factor

Range multiplier per level. Given the angular step ang at the current level, the search range is ±``factor`` · ang.

Type:

int

class susan.utils.datatypes.range_params(min_val: int, max_val: int)[source]

Bases: object

Integer range descriptor.

Attributes

min_val

Minimum value (inclusive).

Type:

int

max_val

Maximum value (inclusive).

Type:

int

class susan.utils.datatypes.mpi_params(cmd=None, arg=None)[source]

Bases: object

Configuration for launching MPI-parallel processing modules.

The MPI binary is invoked roughly as:

cmd = mpi_params.cmd % mpi_params.arg + ' susan_aligner_mpi ' + aligner.get_args()
os.system(cmd)

Attributes

cmd

Base MPI launch command, e.g. 'srun -n %d' (SLURM) or 'mpirun -n %d' (generic MPI). None disables MPI.

Type:

str or None

arg

Argument substituted into cmd (typically the number of nodes). Defaults to None (no substitution).

Type:

int or None

Methods

gen_cmd()[source]

Build the complete MPI prefix string.

Returns:

Empty string if cmd is None or empty. cmd alone if arg is None. Otherwise cmd % arg followed by a trailing space.

Return type:

str

class susan.utils.datatypes.inversion_params(ite: int, std: float)[source]

Bases: object

Parameters for iterative inversion of the sampling function.

Note

This is an advanced parameter. The defaults work well in most cases; change only if you understand the sampling-function correction.

Used to correct for non-uniform angular sampling in reconstruction. See Pipe & Menon (1999).

Attributes

ite

Number of iterations. Default: 10.

Type:

int

std

Standard deviation of the Gaussian used to approximate the gridding kernel. Values of 0 or less select it from the gridding method: 0.41 for linear, 0.69 for Kaiser-Bessel, 0.74 when splatting. Default: -1 (automatic).

Type:

float

class susan.utils.datatypes.boost_lowfreq_params(scale: float, value: float, decay: float)[source]

Bases: object

Low-frequency boost for reconstructions with few particles.

Warning

This is an experimental feature. Results may change in future versions and the parameter defaults have not been validated on all data types.

Applies an extra multiplicative weight to the lowest spatial frequencies before reconstruction.

Attributes

scale

Strength of the boost. Typically 5–10.

Type:

float

value

Frequency up to which the boost is applied, in Fourier pixels. Typically 2–5.

Type:

float

decay

Width of the cosine decay that tapers the boost to zero. Typically 3–6.

Type:

float