susan.data.Particles.MRA

class susan.data._PtclsMRA.PtclsMRA[source]

Bases: object

Multi-reference alignment helpers for Particles.

All methods are static and operate on a Particles instance. Accessible as Particles.MRA.

Static Methods

static duplicate(ptcls, ref_idx=0) → None[source]

Append a copy of one or more reference slots to the alignment arrays.

Adds a new reference entry (or entries) to ali_eu, ali_t, ali_cc, and ali_w by copying from the specified slot(s). Modifies ptcls in-place.

Parameters:
  • ptcls (Particles) – Modified in-place; n_refs increases by one (or more).

  • ref_idx (int or array-like of int, optional) – Index (or indices) of the reference slot(s) to duplicate. Default 0.

static select_ref(ptcls, ref_idx) → Particles[source]

Select particles assigned to specific reference(s) and keep only those slots.

Filters ptcls to particles whose ref_cix matches ref_idx and trims the alignment arrays to only the requested reference(s). ref_cix values in the result are remapped to 0-based indices. Returns a new Particles object; the original is unchanged.

Parameters:
  • ptcls (Particles)

  • ref_idx (int or array-like of int) – Reference index (or indices) to retain.

Return type:

Particles