Sequence.waveforms

Sequence.waveforms#

Sequence.waveforms()[source]#

Return gradient corners as time (s) over amplitude (Hz/m), per axis.

Parameters:
  • append_RF (bool, default=False) – Also return the RF envelope, as a fourth, complex channel in Hz.

  • time_range (Sequence[float], default=None) – Two times in seconds; only the blocks they touch are expanded.

  • block_range (Sequence[int], default=None) – Two 1-based block indices. Not with time_range.

Returns:

One (2, n) array of time over amplitude per axis, empty where an axis plays nothing, then the RF channel when asked for; the first value waveforms_and_times returns.

Return type:

list[NDArray]

Examples

>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> seq.add_block(pp.make_trapezoid("x", flat_area=1000, flat_time=3.2e-3))
1
>>> gx, gy, gz = seq.waveforms()
>>> gx.shape, gy.shape
((2, 4), (2, 0))