pub fn correct_geometry(
    context: &CorrelatorContext,
    jones_array: &mut Array3<Jones<f32>>,
    mwalib_timestep_range: &Range<usize>,
    mwalib_coarse_chan_range: &Range<usize>,
    array_pos: Option<LatLngHeight>,
    phase_centre_ra: Option<RADec>,
    draw_progress: bool
)
Expand description

Perform geometric corrections, given an observation’s [mwalib::CorrelatorContext] and an [’ndarray::Array3] of [TestJones`] visibilities

Complex visibilities are phase-shifted by an angle determined by the length of the w-coordinate for the baseline and the channel’s frequency.

Examples

use birli::{context_to_jones_array, correct_geometry, mwalib::CorrelatorContext};

// define our input files
let metafits_path = "tests/data/1297526432_mwax/1297526432.metafits";
let gpufits_paths = vec![
    "tests/data/1297526432_mwax/1297526432_20210216160014_ch117_000.fits",
    "tests/data/1297526432_mwax/1297526432_20210216160014_ch117_001.fits",
    "tests/data/1297526432_mwax/1297526432_20210216160014_ch118_000.fits",
    "tests/data/1297526432_mwax/1297526432_20210216160014_ch118_001.fits",
];

// Create an mwalib::CorrelatorContext for accessing visibilities.
let context = CorrelatorContext::new(&metafits_path, &gpufits_paths).unwrap();

// Determine which timesteps and coarse channels we want to use
let sel_coarse_chan_idxs = &context.common_coarse_chan_indices;
let sel_timestep_idxs = &context.common_timestep_indices;
let baseline_idxs = (0..context.metafits_context.num_baselines).collect::<Vec<_>>();

let sel_timestep_range =
    *sel_timestep_idxs.first().unwrap()..(*sel_timestep_idxs.last().unwrap() + 1);
let sel_coarse_chan_range =
    *sel_coarse_chan_idxs.first().unwrap()..(*sel_coarse_chan_idxs.last().unwrap() + 1);

// read visibilities out of the gpubox files
let (mut jones_array, _) = context_to_jones_array(
    &context,
    &sel_timestep_range,
    &sel_coarse_chan_range,
    None,
    false,
).unwrap();

correct_geometry(
    &context,
    &mut jones_array,
    &sel_timestep_range,
    &sel_coarse_chan_range,
    None,
    None,
    false,
);