calc_duration

Contents

calc_duration#

pypulseqpp.calc_duration()[source]#

Calculate the duration of an event or block. The duration of an event is the time taken by the actual event itself plus its delay. If multiple events are provided, the calculated duration is for a block comprised of these events, which is given by the maximum duration of the events.

Although it is possible to provide events that can’t be actually be combined into a block (e.g. multiple events of the same type), the result is still the maximum duration of all events.

Parameters:

args (SimpleNamespace) – Block or events.

Returns:

duration – Maximum duration of args.

Return type:

float

Notes

This is PyPulseq’s function. Events go in as the namespaces it expects and come back with their fields in slots.