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

Create a new FlagContext with all flags false, in the given dimensions

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

Produce a vector of flags for baslines where either antenna is flagged in antenna_flags or if autos is true and it is an autocorrelation.

Set flags from this context in an existing array.

Errors

Can throw error if array is not the correct shape.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.