calc_ramp

Contents

calc_ramp#

pypulseqpp.calc_ramp()[source]#

Join the points k0 and k_end in three-dimensional k-space in minimal time, observing the gradient and slew limits (max_grad and max_slew respectively), and the gradient strength G0 before k0[:, 1] and Gend after k_end[:, 1]. In the context of a fixed gradient dwell time this is a discrete problem with an a priori unknown number of discretization steps. Therefore this method tries out the optimization with 0 steps, then 1 step, and so on, until all conditions can be fulfilled, thus yielding a short connection.

Parameters:
  • k0 (numpy.ndarray) – Two preceding points in k-space. Shape is [3, 2]. From these points, the starting gradient will be calculated.

  • k_end (numpy.ndarray) – Two following points in k-space. Shape is [3, 2]. From these points, the target gradient will be calculated.

  • max_grad (float or array_like, default=0) – Maximum total gradient strength. Either a single value or one value for each coordinate, of shape [3, 1].

  • max_points (int, default=500) – Maximum number of k-space points to be used in connecting k0 and k_end.

  • max_slew (float or array_like, default=0) – Maximum total slew rate. Either a single value or one value for each coordinate, of shape [3, 1].

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

  • oversampling (bool, default=False) – Boolean flag to indicate if gradient is oversampled by a factor of 2.

Returns:

  • k_out (numpy.ndarray) – Connected k-space trajectory.

  • success (bool) – Boolean flag indicating if k0 and k_end were successfully joined.

Notes

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