cap_system

Contents

cap_system#

pypulseqpp.cap_system()[source]#

Return a copy with gradient, slew and RF limits lowered to the specified ceilings.

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

  • max_grad (float, default=None) – Gradient amplitude ceiling, in grad_unit; the limit is unchanged when None or already lower.

  • max_slew (float, default=None) – Slew-rate ceiling, in slew_unit; as max_grad.

  • grad_unit (str, default='mT/m') – Unit of max_grad.

  • slew_unit (str, default='T/m/s') – Unit of max_slew.

  • max_b1 (float, default=None) – Peak RF amplitude ceiling, in b1_unit; as max_grad. A system with no RF limit takes it.

  • b1_unit (str, default='uT') – Unit of max_b1: Hz (gamma B1), T, mT, uT or G.

Returns:

The capped copy.

Return type:

Opts

Notes

On a system apply_system_derates() has derated, a limit becomes the lower of the derated limit and the ceiling, and stays so when the copy is derated again: the margin is taken from the system’s limit, not from the ceiling.

Examples

>>> import pypulseqpp as pp
>>> from pypulseq.convert import convert
>>> system = pp.Opts(max_grad=80, grad_unit="mT/m", max_slew=200, slew_unit="T/m/s")
>>> capped = pp.cap_system(system, max_grad=40, max_slew=150)
>>> capped is system
False
>>> round(convert(from_value=capped.max_grad, from_unit="Hz/m", to_unit="mT/m", gamma=capped.gamma))
40