lib_pcal module

Phase calibration routines.

lib_pcal.accumulate_pcal(acc_pcal, v1pcal, count_acc_pcal)[source]

[Used in one-baseline-per-task mode.]

lib_pcal.accumulate_pcal_all(acc_pcal, pre_pcal, n_bins_pcal, dtype_complex=<class 'complex'>)[source]

Accumulate pcal window (all-baselines-per-task mode).

lib_pcal.adjust_shift_acc_pcal(acc_pcal, F_pcal_fix, bypass_adjust_pcal=0, v=0)[source]

Remove delay shift due to delay model.

acc_pcal
accumulation matrix for the phase calibration signals.
F_pcal_fix
number of samples to roll each of the arrays in acc_pcal.
bypass_adjust_pcal
0 by default.
v
verbose if 1.
acc_pcal_out
acc_pcal with the rolls (circular shift) applied as defined in F_pcal_fix.

TO DO:

Asses error raised from this correction. It should be inside a sample in phase.
Check that corrections are applied to the proper row (F_refs...).
lib_pcal.fr_gcd(a, b)[source]
lib_pcal.get_pcal_ind(freqs, sidebands, fs, f_pcal, o_pcal)[source]

Compute window length for phase calibration and get tone seperation.

freqs : list of float
start frequency for the bands [Hz].
sidebands : list of str
sideband identifier (L/U).
fs : int
sampling frequency [Hz].
f_pcal : int
frequency separation for phase calibration tones [Hz].
o_pcal : int
frequency offset for phase calibration tones [Hz].
n_bins_pcal
number of samples in pcal window.
f_pcal
pcal tone separation [Hz].

Limitations / TO DO:

Currently only LSB, add USB.
Change int for float.
Offset untested.
lib_pcal.normalize_pcal(pcal_fft, count_acc_pcal)[source]

Normalize the FFTs coefficients containing the phase calibration accumulations.


TO DO:

This needs to be corrected.
lib_pcal.reshape_pcal(v1_pcal, n_bins_pcal)[source]

[Used in one-baseline-per-task mode.]


**TO DO:

Remove and merge implementation with all-baslines-per-task.