apply_system_derates

apply_system_derates#

pypulseqpp.apply_system_derates()[source]#

Return a copy with gradient and slew limits scaled from their base values.

Base limits are retained on the copy, so repeated derating does not compound.

Parameters:
  • opts (Opts) – System limits. Not modified.

  • grad_derate (float, default=MAX_GRAD_DERATE) – Fraction of the base max_grad / max_slew to allow.

  • slew_derate (float, default=MAX_SLEW_DERATE) – Fraction of the base max_grad / max_slew to allow.

Returns:

The derated copy.

Return type:

Opts

See also

cap_system

the same copy-not-mutate contract, for an absolute ceiling.

Notes

The default fractions, MAX_GRAD_DERATE and MAX_SLEW_DERATE, leave a margin below the gradient amplitude and slew-rate limits for a waveform designed on one axis at a time and played while other axes are active.

Examples

>>> import pypulseqpp as pp
>>> opts = pp.Opts(max_grad=40, grad_unit="mT/m", max_slew=150, slew_unit="T/m/s")
>>> derated = pp.apply_system_derates(opts)
>>> derated.max_grad == 0.9 * opts.max_grad
True
>>> derated is opts
False

The caller’s own limits are untouched, and repeating does not compound:

>>> pp.apply_system_derates(derated).max_grad == derated.max_grad
True