phase_rotate

Tests for the functions in phase_rotate.phase_tracking, which simply attempt to undo phase tracking on visibilities.

test_remove_phase_tracking.py

Tests the phase_tracking.remove_phase_tracking function, which should remove the phase tracking applied to visibilities. The original MWA correlator did not phase track, so the RTS expects no phase tracking on the data, so to input WODEN simulations into the RTS, have to undo the phase-tracking. The RTS calculates it’s own u,v,w, so I only fiddle the visibilities here so be warned.

This test starts by creating a random array layout via:

num_antennas = 50
##Make a random array layout
east = np.random.uniform(-1000, 1000, num_antennas)
north = np.random.uniform(-1000, 1000, num_antennas)
height = np.random.uniform(0, 10, num_antennas)

These coordinates can then be used the calculate u,v,w coodinates for a given array location (I’m using the MWA site) and phase-centre.

First of all, for 10 frequency channels (100MHz to 190MHz at 10MHz resolution), and for 10 time steps (at a 2s resolution), calculate the phase-tracked measurement equation:

\[V_{\textrm{phased}} = \exp\left[2\pi i \left(ul + vm + w(n-1) \right) \right]\]

where the \(u,v,w\) and \(l,m,n\) are calculated with a phase centre of RA, Dec = \(40^\circ, -50^\circ\), and I calculate a single \(l,m,n\) for a source at RA, Dec = \(10^\circ, -15^\circ\) (so in this setup, \(u,v,w\) change with time, and \(l,m,n\) are constant).

I also calculate the measurement equation without phase tracking, where I calculate \(u_{\mathrm{zen}},v_{\mathrm{zen}},w_{\mathrm{zen}}\) and \(l_{\mathrm{zen}},m_{\mathrm{zen}},n_{\mathrm{zen}}\), using the zenith of the instrument as a coordinate system centre, and use the following equation:

\[V_{\textrm{unphased}} = \exp\left[2\pi i \left(u_{\mathrm{zen}}l_{\mathrm{zen}} + v_{\mathrm{zen}}m_{\mathrm{zen}} + w_{\mathrm{zen}}n_{\mathrm{zen}} \right) \right]\]

(in this setup, \(u_{\mathrm{zen}},v_{\mathrm{zen}},w_{\mathrm{zen}}\) are constant with time, and \(l_{\mathrm{zen}},m_{\mathrm{zen}},n_{\mathrm{zen}}\) change with time).

I then use \(V_{\textrm{phased}}\) as an input to phase_rotate.remove_phase_tracking along with \(w\), and use that to unwrap the phase tracking. I then assert that the output of phase_rotate.remove_phase_tracking matches \(V_{\textrm{unphased}}\).