Struct birli::flags::FlagContext
source · [−]pub struct FlagContext {
pub timestep_flags: Vec<bool>,
pub coarse_chan_flags: Vec<bool>,
pub fine_chan_flags: Vec<bool>,
pub antenna_flags: Vec<bool>,
pub autos: bool,
}
Expand description
Which timesteps, channels and baselines are flagged in a given observation
Fields
timestep_flags: Vec<bool>
Which mwalib timestep indices are flagged
coarse_chan_flags: Vec<bool>
Which mwalib coarse channel indices are flagged
fine_chan_flags: Vec<bool>
Which fine channel indices are flagged in every coarse channel
antenna_flags: Vec<bool>
Which mwalib antenna indices are flagged
autos: bool
Whether auto-correlations are flagged
Implementations
sourceimpl FlagContext
impl FlagContext
sourcepub fn blank_from_dimensions(
num_timesteps: usize,
num_coarse_chans: usize,
num_fine_chans_per_coarse: usize,
num_ants: usize
) -> Self
pub fn blank_from_dimensions(
num_timesteps: usize,
num_coarse_chans: usize,
num_fine_chans_per_coarse: usize,
num_ants: usize
) -> Self
Create a new FlagContext
with all flags false, in the given dimensions
sourcepub fn from_mwalib(corr_ctx: &CorrelatorContext) -> Self
pub fn from_mwalib(corr_ctx: &CorrelatorContext) -> Self
Create a new FlagContext
from a marlu::mwalib::CorrelatorContext
, flagging anything not provided.
- Timesteps are flagged in they are not provided in any of the gpubox files.
- Coarse channels are flagged if they appear in the metafits, but are not provided.
- No fine channel flags are set by default.
Examples
use birli::{FlagContext, mwalib::CorrelatorContext};
// define our input files
let metafits_path = "tests/data/1196175296_mwa_ord/1196175296.metafits";
let gpufits_paths = vec![
"tests/data/1196175296_mwa_ord/1196175296_20171201145440_gpubox01_00.fits",
"tests/data/1196175296_mwa_ord/1196175296_20171201145540_gpubox01_01.fits",
"tests/data/1196175296_mwa_ord/1196175296_20171201145440_gpubox02_00.fits",
"tests/data/1196175296_mwa_ord/1196175296_20171201145540_gpubox02_01.fits",
];
// Create an mwalib::CorrelatorContext for accessing visibilities.
let corr_ctx = CorrelatorContext::new(&metafits_path, &gpufits_paths).unwrap();
let flag_ctx = FlagContext::from_mwalib(&corr_ctx);
assert!(!flag_ctx.antenna_flags[0]);
assert!(flag_ctx.antenna_flags[63]);
assert!(flag_ctx.coarse_chan_flags[0]);
assert!(!flag_ctx.coarse_chan_flags[23]);
TODO:
- quack time
- flag side bandwidth
- auto flag centre
Trait Implementations
sourceimpl Debug for FlagContext
impl Debug for FlagContext
sourceimpl Default for FlagContext
impl Default for FlagContext
sourcefn default() -> FlagContext
fn default() -> FlagContext
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for FlagContext
impl Send for FlagContext
impl Sync for FlagContext
impl Unpin for FlagContext
impl UnwindSafe for FlagContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more