Sequence.evaluate_labels#
- Sequence.evaluate_labels()[source]#
Evaluate running label values in block order.
- Parameters:
init (dict[str, int], default=None) – Initial value of each label before evaluation begins. A label named here is reported whether or not the blocks touch it, so that a sequence can be evaluated one range at a time.
evolution ({'none', 'blocks', 'adc', 'label'}, default='none') – Where to record a value: at the end, at every block, at every block that acquires, or at every block that sets or increments one.
time_range (Sequence[float], default=None) – Two times in seconds; only the blocks they touch are walked.
block_range (Sequence[int], default=None) – Two 1-based block indices. Not with
time_range.
- Returns:
Label names mapped to their recorded values. Values are arrays if any label has more than one recorded value; otherwise they are scalars, with zero for an empty record.
- Return type:
Notes
Labels retain their values until set or incremented. For a partial range,
initsupplies the incoming state; preceding blocks are not evaluated.Examples
>>> import pypulseqpp as pp >>> seq = pp.Sequence(pp.Opts()) >>> adc = pp.make_adc(num_samples=64, duration=3.2e-3) >>> for line in range(3): ... _ = seq.add_block(pp.make_label("LIN", "SET", line), adc) >>> int(seq.evaluate_labels()["LIN"]) 2 >>> seq.evaluate_labels(evolution="adc")["LIN"] array([0, 1, 2], dtype=int32)