susan.project.SubtomoAvgMonitor

class susan.project.SubtomoAvg.SubtomoAvgMonitor(prj_name)[source]

Bases: SubtomoAvgBase

Read-only monitor for an existing subtomogram averaging project.

Inherits all path helpers and query methods from SubtomoAvgBase but has no processing modules and cannot run iterations. Useful for inspection, visualisation, and scripting on top of a finished or in-progress project.

Parameters:

prj_name (str) – Path to an existing project directory.

Path Helpers

iteration_dir(ite) → str

Return the directory path for iteration ite.

Parameters:

ite (int)

Returns:

<prj_name>/ite_NNNN/

Return type:

str

iteration_files(ite) → _IterationFiles

Return the standard file-path bundle for iteration ite.

Parameters:

ite (int) – Use 0 for the initial state.

Return type:

_IterationFiles

path_map(ite, ref=1) → str

Path to the full reference map for iteration ite.

Parameters:
  • ite (int)

  • ref (int, optional) – 1-based class index (default 1).

Return type:

str

path_halfmap(ite, ref=1) → tuple[str, str]

Paths to the two half-maps for iteration ite.

Returns:

(half1_path, half2_path)

Return type:

tuple of str

path_mask(ite, ref=1) → str

Path to the soft mask for iteration ite.

Return type:

str

path_refstxt(ite) → str

Path to the .refstxt file for iteration ite.

Return type:

str

path_ptcls(ite) → str

Path to the .ptclsraw file for iteration ite.

Return type:

str

path_map_rec(ite) → str

Base path prefix used by the averager when reconstructing iteration ite.

The averager appends _classNNN.mrc, _classNNN_half1.mrc, etc. to this prefix.

Returns:

<prj_name>/ite_NNNN/map

Return type:

str

Data Access

get_map(ite, ref=1) → ndarray

Load and return the reference map for iteration ite.

Return type:

numpy.ndarray

get_mask(ite, ref=1) → ndarray

Load and return the soft mask for iteration ite.

Return type:

numpy.ndarray

get_ptcls(ite) → Particles

Load and return the particles for iteration ite.

Return type:

Particles

get_cc(ite, ref=1) → ndarray

Per-particle CC scores for iteration ite, reference ref.

Return type:

numpy.ndarray, shape (N,)

get_fsc(ite, ref=1) → ndarray

Compute the FSC curve for iteration ite, reference ref.

Return type:

numpy.ndarray

map_change(ite, ref=1) → float

L2 norm of the voxel-wise difference between iterations ite and ite-1.

Useful as a convergence monitor: a decreasing value indicates the reference is stabilising.

Parameters:
  • ite (int) – Iteration number (≥ 1).

  • ref (int, optional) – 1-based reference index. Default: 1.

Return type:

float