pub struct CorrelatorContext {
Show 35 fields pub metafits_context: MetafitsContext, pub mwa_version: MWAVersion, pub timesteps: Vec<TimeStep, Global>, pub num_timesteps: usize, pub coarse_chans: Vec<CoarseChannel, Global>, pub num_coarse_chans: usize, pub common_timestep_indices: Vec<usize, Global>, pub num_common_timesteps: usize, pub common_coarse_chan_indices: Vec<usize, Global>, pub num_common_coarse_chans: usize, pub common_start_unix_time_ms: u64, pub common_end_unix_time_ms: u64, pub common_start_gps_time_ms: u64, pub common_end_gps_time_ms: u64, pub common_duration_ms: u64, pub common_bandwidth_hz: u32, pub common_good_timestep_indices: Vec<usize, Global>, pub num_common_good_timesteps: usize, pub common_good_coarse_chan_indices: Vec<usize, Global>, pub num_common_good_coarse_chans: usize, pub common_good_start_unix_time_ms: u64, pub common_good_end_unix_time_ms: u64, pub common_good_start_gps_time_ms: u64, pub common_good_end_gps_time_ms: u64, pub common_good_duration_ms: u64, pub common_good_bandwidth_hz: u32, pub provided_timestep_indices: Vec<usize, Global>, pub num_provided_timesteps: usize, pub provided_coarse_chan_indices: Vec<usize, Global>, pub num_provided_coarse_chans: usize, pub num_timestep_coarse_chan_bytes: usize, pub num_timestep_coarse_chan_floats: usize, pub num_gpubox_files: usize, pub gpubox_batches: Vec<GpuBoxBatch, Global>, pub gpubox_time_map: BTreeMap<u64, BTreeMap<usize, (usize, usize)>>, /* private fields */
}
Expand description

mwalib correlator observation context. This represents the basic metadata for a correlator observation.

Fields

metafits_context: MetafitsContext

Observation Metadata obtained from the metafits file

mwa_version: MWAVersion

MWA version, derived from the files passed in

timesteps: Vec<TimeStep, Global>

This is an array of all known timesteps (union of metafits and provided timesteps from data files). The only exception is when the metafits timesteps are offset from the provided timesteps, in which case see description in timestep::populate_metafits_provided_superset_of_timesteps.

num_timesteps: usize

Number of timesteps in the timesteps vector

coarse_chans: Vec<CoarseChannel, Global>

Vector of coarse channel structs which is the same as the metafits provided coarse channels

num_coarse_chans: usize

Number of coarse channels in the coarse channel vector

common_timestep_indices: Vec<usize, Global>

Vector of (in)common timestep indices

num_common_timesteps: usize

Number of common timesteps

common_coarse_chan_indices: Vec<usize, Global>

Vector of (in)common coarse channel indices

num_common_coarse_chans: usize

Number of common coarse channels

common_start_unix_time_ms: u64

The start of the observation (the time that is common to all provided gpubox files).

common_end_unix_time_ms: u64

end_unix_time_ms is the common end time of the observation i.e. start time of last common timestep plus integration time.

common_start_gps_time_ms: u64

start_unix_time_ms but in GPS milliseconds

common_end_gps_time_ms: u64

end_unix_time_ms but in GPS milliseconds

common_duration_ms: u64

Total duration of common timesteps

common_bandwidth_hz: u32

Total bandwidth of the common coarse channels

common_good_timestep_indices: Vec<usize, Global>

Vector of (in)common timestep indices only including timesteps after the quack time

num_common_good_timesteps: usize

Number of common timesteps only including timesteps after the quack time

common_good_coarse_chan_indices: Vec<usize, Global>

Vector of (in)common coarse channel indices only including timesteps after the quack time

num_common_good_coarse_chans: usize

Number of common coarse channels only including timesteps after the quack time

common_good_start_unix_time_ms: u64

The start of the observation (the time that is common to all provided gpubox files) only including timesteps after the quack time

common_good_end_unix_time_ms: u64

end_unix_time_ms is the common end time of the observation only including timesteps after the quack time i.e. start time of last common timestep plus integration time.

common_good_start_gps_time_ms: u64

common_good_start_unix_time_ms but in GPS milliseconds

common_good_end_gps_time_ms: u64

common_good_end_unix_time_ms but in GPS milliseconds

common_good_duration_ms: u64

Total duration of common_good timesteps

common_good_bandwidth_hz: u32

Total bandwidth of the common coarse channels only including timesteps after the quack time

provided_timestep_indices: Vec<usize, Global>

The indices of any timesteps which we have some data for

num_provided_timesteps: usize

Number of provided timestep indices we have at least some data for

provided_coarse_chan_indices: Vec<usize, Global>

The indices of any coarse channels which we have some data for

num_provided_coarse_chans: usize

Number of provided coarse channel indices we have at least some data for

num_timestep_coarse_chan_bytes: usize

The number of bytes taken up by a scan/timestep in each gpubox file.

num_timestep_coarse_chan_floats: usize

The number of floats in each gpubox HDU.

num_gpubox_files: usize

This is the number of gpubox files per batch.

gpubox_batches: Vec<GpuBoxBatch, Global>

gpubox_batches must be sorted appropriately. See gpubox::determine_gpubox_batches. The order of the filenames corresponds directly to other gpubox-related objects (e.g. gpubox_hdu_limits). Structured: gpubox_batches[batch][filename].

gpubox_time_map: BTreeMap<u64, BTreeMap<usize, (usize, usize)>>

We assume as little as possible about the data layout in the gpubox files; here, a BTreeMap contains each unique UNIX time from every gpubox, which is associated with another BTreeMap, associating each gpubox number with a gpubox batch number and HDU index. The gpubox number, batch number and HDU index are everything needed to find the correct HDU out of all gpubox files.

Implementations

From a path to a metafits file and paths to gpubox files, create an CorrelatorContext.

The traits on the input parameters allow flexibility to input types.

Arguments
  • metafits_filename - filename of metafits file as a path or string.

  • gpubox_filenames - slice of filenames of gpubox files as paths or strings.

Returns
  • Result containing a populated CorrelatorContext object if Ok.

For a given slice of correlator coarse channel indices, return a vector of the center frequencies for all the fine channels in the given coarse channels

Arguments
  • corr_coarse_chan_indices - a slice containing correlator coarse channel indices for which you want fine channels for. Does not need to be contiguous.
Returns
  • a vector of f64 containing the centre sky frequencies of all the fine channels for the given coarse channels.

Read a single timestep for a single coarse channel The output visibilities are in order: baseline,frequency,pol,r,i

Arguments
  • corr_timestep_index - index within the CorrelatorContext timestep array for the desired timestep. This corresponds to the element within mwalibContext.timesteps.

  • corr_coarse_chan_index - index within the CorrelatorContext coarse_chan array for the desired coarse channel. This corresponds to the element within mwalibContext.coarse_chans.

Returns
  • A Result containing vector of 32 bit floats containing the data in [baseline][frequency][pol][r][i] order, if Ok.

Read a single timestep for a single coarse channel The output visibilities are in order: frequency,baseline,pol,r,i

Arguments
  • corr_timestep_index - index within the CorrelatorContext timestep array for the desired timestep. This corresponds to the element within mwalibContext.timesteps.

  • corr_coarse_chan_index - index within the CorrelatorContext coarse_chan array for the desired coarse channel. This corresponds to the element within mwalibContext.coarse_chans.

Returns
  • A Result containing vector of 32 bit floats containing the data in frequency,baseline,pol,r,i order, if Ok.

Read a single timestep for a single coarse channel The output visibilities are in order: baseline,frequency,pol,r,i

Arguments
  • corr_timestep_index - index within the CorrelatorContext timestep array for the desired timestep.

  • corr_coarse_chan_index - index within the CorrelatorContext coarse_chan array for the desired coarse channel.

  • buffer - Float buffer as a slice which will be filled with data from the HDU read in [baseline][frequency][pol][r][i] order.

Returns
  • A Result of Ok if success or a GpuboxError on failure.

Read a single timestep for a single coarse channel into a supplied buffer The output visibilities are in order: frequency,baseline,pol,r,i

Arguments
  • corr_timestep_index - index within the CorrelatorContext timestep array for the desired timestep.

  • corr_coarse_chan_index - index within the CorrelatorContext coarse_chan array for the desired coarse channel.

  • buffer - Float buffer as a slice which will be filled with data from the HDU read in [baseline][frequency][pol][r][i] order.

Returns
  • A Result of Ok if success or a GpuboxError on failure.

Trait Implementations

Formats the value using the given formatter. Read more

Implements fmt::Display for CorrelatorContext struct

Arguments

  • f - A fmt::Formatter

Returns

  • fmt::Result - Result of this method

Formats the value using the given formatter. 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

Converts the given value to a String. 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.