Sequence.apply_soft_delay

Sequence.apply_soft_delay#

Sequence.apply_soft_delay()[source]#

Set each named soft delay to the value given.

A soft delay says how long its block lasts in terms of a value the console supplies: duration = value / factor + offset, rounded onto the block duration raster. Naming one here writes that duration into every block that plays it.

Parameters:

**kwargs – What each delay, by its hint, is to be set to, in seconds. A delay in the sequence that is not named here is left unchanged.

Raises:

ValueError – If a name given is not in the sequence, if a hint and a numeric id do not agree about which delay they name, or if the value asked for would make a block last less than nothing.

Warns:

UserWarning – When a duration had to move more than half a microsecond to reach the raster. Once per delay, not once per block.

Notes

Finding the soft delays is a compiled pass over the block table: nothing else in a block is decoded to answer whether it heads one.

Examples

>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> seq.add_block(pp.make_delay(1e-3), pp.make_soft_delay("TE", numID=0))
1
>>> seq.apply_soft_delay(TE=5e-3)
>>> seq.block_durations[1]
0.005