make_extended_trapezoid

make_extended_trapezoid#

pypulseqpp.make_extended_trapezoid()[source]#

Create a gradient by specifying a set of points (amplitudes) at specified time points(times) at a given channel with given system limits. Returns an arbitrary gradient object.

See also

-, -, -

Parameters:
  • channel (str) – Orientation of extended trapezoidal gradient event. Must be one of ‘x’, ‘y’ or ‘z’.

  • convert_to_arbitrary (bool, default=False) – Boolean flag to indicate if the extended trapezoid gradient has to be converted into an arbitrary gradient.

  • amplitudes (numpy.ndarray, default=09) – Values defined at times time indices.

  • max_grad (float, default=0) – Maximum gradient strength.

  • max_slew (float, default=0) – Maximum slew rate.

  • system (Opts, default=Opts()) – System limits.

  • skip_check (bool, default=False) – Boolean flag to indicate if amplitude check is to be skipped.

  • times (numpy.ndarray, default=np.zeros(1)) – Time points at which amplitudes defines amplitude values.

Returns:

grad – Extended trapezoid gradient event.

Return type:

SimpleNamespace

Raises:

ValueError – If invalid channel is passed. Must be one of ‘x’, ‘y’ or ‘z’. If all elements in times are zero. If elements in times are not in ascending order or not distinct. If all elements in amplitudes are zero. If first amplitude of a gradient is non-ero and does not connect to a previous block.

Notes

This is PyPulseq’s factory; the event it builds is returned with its fields in slots.