make_hexagon_gradient_area

make_hexagon_gradient_area#

pypulseqpp.make_hexagon_gradient_area()[source]#

Design a minimum-duration gradient with specified area and endpoint amplitudes.

Parameters:
  • channel (str) – One of x, y, z.

  • grad_start (float) – Amplitude at each end, in Hz/m.

  • grad_end (float) – Amplitude at each end, in Hz/m.

  • area (float) – The area to enclose, in 1/m.

  • system (Opts, default=None) – System limits. The gradients are designed against 99 percent of them, so the waveform that comes back is inside them rather than on them.

Returns:

  • grad (SimpleNamespace) – The gradient event.

  • times (numpy.ndarray) – The corner times, in seconds.

  • amplitudes (numpy.ndarray) – The corner amplitudes, in Hz/m.

Raises:

ValueError – When either end amplitude is already over the limit, or when no waveform found encloses the area.

Examples

>>> import pypulseqpp as pp
>>> system = pp.Opts(max_grad=30, grad_unit="mT/m", max_slew=150, slew_unit="T/m/s")
>>> grad, times, amplitudes = pp.make_hexagon_gradient_area(
...     "x", grad_start=0.0, grad_end=0.0, area=1000.0, system=system
... )
>>> round(float(grad.area))
1000

Joining two arms of a readout means starting where the last one left off:

>>> grad, _, amplitudes = pp.make_hexagon_gradient_area(
...     "x", grad_start=1e5, grad_end=-1e5, area=500.0, system=system
... )
>>> float(amplitudes[0]), float(amplitudes[-1])
(100000.0, -100000.0)