Struct birli::VisSelection
source · pub struct VisSelection {
pub timestep_range: Range<usize>,
pub coarse_chan_range: Range<usize>,
pub baseline_idxs: Vec<usize, Global>,
}
Expand description
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 an mwalib::CorrelatorContext
to be
fully interpreted
TODO: this definitely needs fine_chans_per_coarse
TODO: what about https://doc.rust-lang.org/std/ops/trait.RangeBounds.html insetad of Range?
Fields§
§timestep_range: Range<usize>
selected range of mwalib timestep indices
coarse_chan_range: Range<usize>
selected range of mwalib coarse channel indices
baseline_idxs: Vec<usize, Global>
selected mwalib baseline indices
Implementations§
source§impl VisSelection
impl VisSelection
sourcepub fn from_mwalib(
corr_ctx: &CorrelatorContext
) -> Result<VisSelection, SelectionError>
pub fn from_mwalib( corr_ctx: &CorrelatorContext ) -> Result<VisSelection, SelectionError>
Produce a VisSelection
from a given [marlu::mwalib::CorrelatorContext
].
- timesteps are selected from the first common to the last provided.
- only common coarse channels are selected
- all baselines are selected
For more details, see mwalib core concepts
Examples
use marlu::{mwalib::CorrelatorContext, VisSelection};
// 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",
];
let corr_ctx = CorrelatorContext::new(metafits_path, &gpufits_paths).unwrap();
let vis_sel = VisSelection::from_mwalib(&corr_ctx).unwrap();
assert_eq!(vis_sel.timestep_range.len(), 4);
Errors
This will return SelectionError::NoProvidedTimesteps
if mwalib has determined that no
timesteps have been provided, SelectionError::NoCommonTimesteps
if none of the provided
gpuboxes have timesteps in common
sourcepub fn get_ant_pairs(
&self,
meta_ctx: &MetafitsContext
) -> Vec<(usize, usize), Global>
pub fn get_ant_pairs( &self, meta_ctx: &MetafitsContext ) -> Vec<(usize, usize), Global>
The selected antenna index pairs corresponding to sel_baselines_idxs
sourcepub fn get_shape(&self, fine_chans_per_coarse: usize) -> (usize, usize, usize)
pub fn get_shape(&self, fine_chans_per_coarse: usize) -> (usize, usize, usize)
Get the shape of the jones, flag or weight array for this selection
sourcepub fn estimate_bytes_best(&self, fine_chans_per_coarse: usize) -> usize
pub fn estimate_bytes_best(&self, fine_chans_per_coarse: usize) -> usize
Estimate the memory size in bytes required to store the given selection without redundant pols.
sourcepub fn allocate_jones(
&self,
fine_chans_per_coarse: usize
) -> Result<ArrayBase<OwnedRepr<Jones<f32>>, Dim<[usize; 3]>>, SelectionError>
pub fn allocate_jones( &self, fine_chans_per_coarse: usize ) -> Result<ArrayBase<OwnedRepr<Jones<f32>>, Dim<[usize; 3]>>, SelectionError>
Allocate a jones array to store visibilities for the selection
Errors
can raise SelectionError::InsufficientMemory
if not enough memory.
Trait Implementations§
source§impl Clone for VisSelection
impl Clone for VisSelection
source§fn clone(&self) -> VisSelection
fn clone(&self) -> VisSelection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more