Sequence.event_definitions

Sequence.event_definitions#

Sequence.event_definitions()[source]#

Return the definition each RF, gradient and ADC event was deduplicated onto.

Entry i of each array is event id i + 1, and the value is a definition id counted from 1. Events sharing a definition play the same thing at different amplitudes, offsets or phases.

Composed with the block table of libraries(), this gives the definitions a block plays without interning them a second time.

Returns:

rf, gradient and adc, each by event id.

Return type:

EventDefinitions

Examples

>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> for amplitude in (1e5, -1e5):
...     gx = pp.make_trapezoid(
...         "x", amplitude=amplitude, rise_time=1e-4, flat_time=1e-3
...     )
...     _ = seq.add_block(gx)
>>> seq.event_definitions().gradient.tolist()  # one timing, two amplitudes
[1, 1]