susan.project.Schedulers

Bandpass

class susan.project.Schedulers.Bandpass.Fixed(box_size, fp_max=None)

Bases: object

Return a copy of current_bandpass with lowpass clamped to fp_max. The lowpass set on the aligner before the loop is used unchanged (only clamping is applied).

Parameters:
  • box_size (int)

  • fp_max (int, optional) – Hard ceiling on lowpass in Fourier pixels. Defaults to box_size // 2 - rolloff (computed from the bandpass rolloff at call time).

class susan.project.Schedulers.Bandpass.Adaptive(box_size, max_step=None, fp_max=None, reduce='max')

Bases: object

Chase the FSC-estimated resolution each iteration.

lowpass = min(bp_est, fp_max). An optional max_step limits how much lowpass can increase in a single iteration relative to the current bandpass.

Parameters:
  • box_size (int)

  • max_step (float, optional) – Maximum increase in lowpass per iteration. None means unlimited.

  • fp_max (int, optional) – Hard ceiling. Defaults to box_size // 2 - rolloff.

  • reduce (str, optional) – Reduction applied to a per-reference (MRA) bp_est array before it is used as a single global lowpass: 'max' (default, chase the best-resolving class), 'min' (limit to the worst-resolving class), or 'mean' (aliases 'average' / 'avg'). Ignored for a scalar bp_est.

class susan.project.Schedulers.Bandpass.Ramp(box_size, step=2.5, fp_max=None)

Bases: object

Increase lowpass by a fixed step each iteration, capped at fp_max. bp_est is ignored.

Parameters:
  • box_size (int)

  • step (float, optional) – Increase per iteration. Default: 2.5.

  • fp_max (int, optional) – Hard ceiling. Defaults to box_size // 2 - rolloff.

Iteration Type

class susan.project.Schedulers.IterationType.Fixed(type_)

Bases: object

Always return the same iteration type.

Parameters:

type (str) – '3D', '2D', or 'ctf'.

class susan.project.Schedulers.IterationType.Alternating(odd='ctf', even='2D', sync_to_ite=True)

Bases: object

Alternate between two types based on iteration parity or an internal counter.

Parameters:
  • odd (str, optional) – Type for odd iterations (or odd counter values). Default: 'ctf'.

  • even (str, optional) – Type for even iterations (or even counter values). Default: '2D'.

  • sync_to_ite (bool, optional) – If True, parity is determined by ite % 2. If False, an internal counter is used. Default: True.

reset(phase=0)

Reset the internal counter.

Parameters:

phase (int, optional) – 0 → next call returns the “even” value; 1 → “odd”. Default: 0.

class susan.project.Schedulers.IterationType.Cyclic(sequence, sync_to_ite=True)

Bases: object

Cycle through a sequence of iteration types.

Parameters:
  • sequence (list of str) – Ordered list of types to cycle through, e.g. ['3D', '3D', 'ctf', '2D'].

  • sync_to_ite (bool, optional) – If True, index = (ite - 1) % len(sequence). If False, an internal counter is used. Default: True.

reset(phase=0)

Reset the internal counter.

Parameters:

phase (int, optional) – Starting index into the sequence. Default: 0.