calc_absolute_offsets

calc_absolute_offsets#

pypulseqpp.calc_absolute_offsets()[source]#

Return an RF or ADC event’s frequency and phase offsets with its ppm offsets resolved.

Parameters:
  • event (RF or ADC event) – Any object carrying freq_offset (Hz) and phase_offset (rad). freq_ppm (ppm) and phase_ppm (rad/MHz) count as zero where absent.

  • system (Opts, default=None) – The gamma (Hz/T) and B0 (T) the ppm offsets are resolved at; the default system when None.

Returns:

  • freq_offset (float) – freq_offset + freq_ppm * f in Hz, where f = 1e-6 * gamma * B0 is the Larmor frequency in MHz, which is also its value in Hz per ppm.

  • phase_offset (float) – phase_offset + phase_ppm * f in rad.

See also

pypulseqpp.io.SequenceLibraries.absolute_offsets

the same for every RF and ADC row of a sequence.

Examples

>>> import pypulseqpp as pp
>>> fat = pp.make_block_pulse(1.0, duration=4e-3, freq_ppm=-3.45)
>>> frequency, phase = pp.calc_absolute_offsets(fat, system=pp.Opts(B0=3.0))
>>> round(frequency, 2), phase
(-440.66, 0.0)