check_grad_continuity

check_grad_continuity#

pypulseqpp.safety.check_grad_continuity()[source]#

Check gradient amplitude continuity across block boundaries.

Parameters:
  • seq (Sequence) – The sequence to check.

  • system (pypulseqpp.Opts, default=None) – Source of max_slew (Hz/m/s), which a discontinuity is compared with, and grad_raster_time (s); seq.system when None.

Returns:

  • is_ok (bool) – True when no discontinuity is found and every gradient waveform ends at zero amplitude.

  • report (SimpleNamespace) – limit; the discontinuities found, each naming the block, the axis, the amplitudes before and after the boundary and the slew rate the step implies; and ends_at_zero.

Raises:

ValueError – If neither system nor seq.system is available.

Notes

Endpoints are compared after each block’s rotation. An absent gradient contributes zero amplitude. A discontinuity is evaluated over one gradient raster period, and the final amplitude on every axis must be zero. Block indices are 1-based, axes are zero-based integers, amplitudes are in Hz/m and slew rates in Hz/m/s.