Sequence.calc_rf_power

Sequence.calc_rf_power#

Sequence.calc_rf_power()[source]#

Return the RF’s mean power, peak power, RMS amplitude and energy.

As MATLAB Pulseq’s calcRfPower.

Parameters:
  • block_range (Sequence[int], default=None) – First and last block, 1-based and inclusive; all by default.

  • window_duration (float, default=None) – Seconds. Energy, mean power and rms are then the largest over runs of whole blocks no longer than this, each divided by it.

Returns:

  • mean_pwr (float) – Hz^2.

  • peak_pwr (float) – Hz^2.

  • rf_rms (float) – Hz.

  • total_energy (float) – Hz^2 s.

Notes

Each pulse is read as pypulseqpp.calc_rf_power() reads it, a dynamic pTx pulse as the root-sum-square of its channels. The values are relative: divide rf_rms by gamma for tesla and the powers by gamma squared. pypulseqpp.safety.check_sar() gives SAR.

Examples

>>> import numpy as np
>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> seq.add_block(pp.make_block_pulse(np.pi / 2, duration=1e-3))
1
>>> mean_pwr, peak_pwr, rf_rms, total_energy = seq.calc_rf_power()
>>> round(peak_pwr), round(total_energy, 3)
(62500, 62.5)