Expand description
Selecting a subset of correlator visibilities from an observation using mwalib indices.
Observations can sometimes be too large to fit in memory. This method will only load visibilities from the selected timesteps, coarse channels and baselines in order to enable processing in “chunks”
The timesteps are specified as a range of indices in the marlu::mwalib::CorrelatorContext
’s
timestep array, which should be a contiguous superset of times from all provided coarse gpubox
files. A similar concept applies to coarse channels. Instead of reading visibilities for all
known timesteps / coarse channels, it is recommended to use common_coarse_chan_indices
and
common_timestep_indices
, as these ignore timesteps and coarse channels which are missing
contiguous data. common_good_timestep_indices
is also a good choice to avoid quack time.
For more details, see the documentation.
Note: it doesn’t make sense to ask aoflagger to flag non-contiguous timesteps or coarse channels, and so this interface only allows to ranges to be used. For flagging an obeservation with “picket fence” coarse channels or timesteps, contiguous ranges should be flagged separately.
Examples
use marlu::{VisSelection};
let mut vis_sel = VisSelection {
timestep_range: 0..1,
coarse_chan_range: 0..1,
baseline_idxs: vec![0, 1],
};
// Create a blank array to store flags and visibilities
let fine_chans_per_coarse = 2;
let mut jones_array = vis_sel.allocate_jones(fine_chans_per_coarse).unwrap();
let dims = jones_array.dim();
// now try only with a different range of timesteps
vis_sel.timestep_range = 0..2;
let mut jones_array = vis_sel.allocate_jones(fine_chans_per_coarse).unwrap();
// different selections have different sized arrays.
assert_ne!(dims, jones_array.dim());
Structs
- Keep track of which mwalib indices the values in a jones array, its’ weights and its’ flags came from. Similar to a
VisContext
, but requires anmwalib::CorrelatorContext
to be fully interpreted