Sequence.mod_grad_axis

Sequence.mod_grad_axis#

Sequence.mod_grad_axis()[source]#

Scale the amplitude of every gradient on axis by modifier.

Parameters:
  • axis ({'x', 'y', 'z'}) – Which axis to act on.

  • modifier (float) – Factor applied to the amplitudes; -1 inverts the axis and 0 zeroes it.

Raises:
  • ValueError – If axis is not one of ‘x’, ‘y’ or ‘z’.

  • RuntimeError – If a gradient event is played on axis and on another axis.

Notes

Only the amplitude is scaled. Rise, flat and fall times, delays and waveform shapes are unchanged, so areas scale with the amplitude and the timing does not change.

Examples

>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> seq.add_block(pp.make_trapezoid("x", area=1000, duration=2e-3))
1
>>> seq.mod_grad_axis("x", 0.5)
>>> seq.get_block(1).gx.area
500.0