susan.project.SubtomoAvgBase

class susan.project.SubtomoAvg.SubtomoAvgBase(prj_name, box_size=None)[source]

Bases: object

Project infrastructure: file paths and read-only query methods.

Can be instantiated without box_size to inspect an existing project.

Parameters:
  • prj_name (str) – Project directory. Created when box_size is supplied.

  • box_size (int, optional) – Subvolume box size in pixels. Reads info.prjtxt when omitted.

Warning

Developer-only. SubtomoAvgBase is internal infrastructure (project paths and read-only queries) shared by the public classes. Application code should use SubtomoAvg to run a project or SubtomoAvgMonitor to inspect one, not this base class directly.

Path Helpers

iteration_dir(ite) → str[source]

Return the directory path for iteration ite.

Parameters:

ite (int)

Returns:

<prj_name>/ite_NNNN/

Return type:

str

iteration_files(ite) → _IterationFiles[source]

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[source]

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][source]

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[source]

Path to the soft mask for iteration ite.

Return type:

str

path_refstxt(ite) → str[source]

Path to the .refstxt file for iteration ite.

Return type:

str

path_ptcls(ite) → str[source]

Path to the .ptclsraw file for iteration ite.

Return type:

str

path_map_rec(ite) → str[source]

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[source]

Load and return the reference map for iteration ite.

Return type:

numpy.ndarray

get_mask(ite, ref=1) → ndarray[source]

Load and return the soft mask for iteration ite.

Return type:

numpy.ndarray

get_ptcls(ite) → Particles[source]

Load and return the particles for iteration ite.

Return type:

Particles

get_cc(ite, ref=1) → ndarray[source]

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

Return type:

numpy.ndarray, shape (N,)

get_fsc(ite, ref=1) → ndarray[source]

Compute the FSC curve for iteration ite, reference ref.

Return type:

numpy.ndarray

map_change(ite, ref=1) → float[source]

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