Struct mwalib::MetafitsContext

source ·
pub struct MetafitsContext {
Show 75 fields pub mwa_version: Option<MWAVersion>, pub obs_id: u32, pub sched_start_gps_time_ms: u64, pub sched_end_gps_time_ms: u64, pub sched_start_unix_time_ms: u64, pub sched_end_unix_time_ms: u64, pub sched_start_utc: DateTime<FixedOffset>, pub sched_end_utc: DateTime<FixedOffset>, pub sched_start_mjd: f64, pub sched_end_mjd: f64, pub sched_duration_ms: u64, pub dut1: Option<f64>, pub ra_tile_pointing_degrees: f64, pub dec_tile_pointing_degrees: f64, pub ra_phase_center_degrees: Option<f64>, pub dec_phase_center_degrees: Option<f64>, pub az_deg: f64, pub alt_deg: f64, pub za_deg: f64, pub az_rad: f64, pub alt_rad: f64, pub za_rad: f64, pub sun_alt_deg: Option<f64>, pub sun_distance_deg: Option<f64>, pub moon_distance_deg: Option<f64>, pub jupiter_distance_deg: Option<f64>, pub lst_deg: f64, pub lst_rad: f64, pub hour_angle_string: String, pub grid_name: String, pub grid_number: i32, pub creator: String, pub project_id: String, pub obs_name: String, pub mode: MWAMode, pub geometric_delays_applied: GeometricDelaysApplied, pub cable_delays_applied: CableDelaysApplied, pub calibration_delays_and_gains_applied: bool, pub corr_fine_chan_width_hz: u32, pub corr_int_time_ms: u64, pub corr_raw_scale_factor: f32, pub num_corr_fine_chans_per_coarse: usize, pub volt_fine_chan_width_hz: u32, pub num_volt_fine_chans_per_coarse: usize, pub receivers: Vec<usize>, pub num_receivers: usize, pub delays: Vec<u32>, pub num_delays: usize, pub calibrator: bool, pub calibrator_source: String, pub global_analogue_attenuation_db: f64, pub quack_time_duration_ms: u64, pub good_time_unix_ms: u64, pub good_time_gps_ms: u64, pub num_ants: usize, pub antennas: Vec<Antenna>, pub num_rf_inputs: usize, pub rf_inputs: Vec<Rfinput>, pub num_ant_pols: usize, pub num_metafits_timesteps: usize, pub metafits_timesteps: Vec<TimeStep>, pub num_metafits_coarse_chans: usize, pub metafits_coarse_chans: Vec<CoarseChannel>, pub num_metafits_fine_chan_freqs: usize, pub metafits_fine_chan_freqs_hz: Vec<f64>, pub obs_bandwidth_hz: u32, pub coarse_chan_width_hz: u32, pub centre_freq_hz: u32, pub num_baselines: usize, pub baselines: Vec<Baseline>, pub num_visibility_pols: usize, pub metafits_filename: String, pub oversampled: bool, pub deripple_applied: bool, pub deripple_param: String,
}
Expand description

Metafits context. This represents the basic metadata for an MWA observation.

Fields§

§mwa_version: Option<MWAVersion>

mwa version

§obs_id: u32

Observation id

§sched_start_gps_time_ms: u64

Scheduled start (gps time) of observation

§sched_end_gps_time_ms: u64

Scheduled end (gps time) of observation

§sched_start_unix_time_ms: u64

Scheduled start (UNIX time) of observation

§sched_end_unix_time_ms: u64

Scheduled end (UNIX time) of observation

§sched_start_utc: DateTime<FixedOffset>

Scheduled start (UTC) of observation

§sched_end_utc: DateTime<FixedOffset>

Scheduled end (UTC) of observation

§sched_start_mjd: f64

Scheduled start (MJD) of observation

§sched_end_mjd: f64

Scheduled end (MJD) of observation

§sched_duration_ms: u64

Scheduled duration of observation

§dut1: Option<f64>

DUT1 (i.e. UTC-UT1). The UTC of the obsid is used to determine this value. Calculated by astropy. Made optional for compatibility.

§ra_tile_pointing_degrees: f64

RA tile pointing

§dec_tile_pointing_degrees: f64

DEC tile pointing

§ra_phase_center_degrees: Option<f64>

RA phase centre

§dec_phase_center_degrees: Option<f64>

DEC phase centre

§az_deg: f64

AZIMUTH of the pointing centre in degrees

§alt_deg: f64

ALTITUDE (a.k.a. elevation) of the pointing centre in degrees

§za_deg: f64

Zenith angle of the pointing centre in degrees

§az_rad: f64

AZIMUTH of the pointing centre in radians

§alt_rad: f64

ALTITUDE (a.k.a. elevation) of the pointing centre in radians

§za_rad: f64

Zenith angle of the pointing centre in radians

§sun_alt_deg: Option<f64>

Altitude of Sun

§sun_distance_deg: Option<f64>

Distance from pointing center to Sun

§moon_distance_deg: Option<f64>

Distance from pointing center to the Moon

§jupiter_distance_deg: Option<f64>

Distance from pointing center to Jupiter

§lst_deg: f64

Local Sidereal Time in degrees (at the midpoint of the observation)

§lst_rad: f64

Local Sidereal Time in radians (at the midpoint of the observation)

§hour_angle_string: String

Hour Angle of pointing center (as a string)

§grid_name: String

GRIDNAME

§grid_number: i32

GRIDNUM

§creator: String

CREATOR

§project_id: String

PROJECT

§obs_name: String

Observation name

§mode: MWAMode

MWA observation mode

§geometric_delays_applied: GeometricDelaysApplied

Which Geometric delays have been applied to the data?

§cable_delays_applied: CableDelaysApplied

Have cable delays been applied to the data?

§calibration_delays_and_gains_applied: bool

Have calibration delays and gains been applied to the data?

§corr_fine_chan_width_hz: u32

Correlator fine_chan_resolution

§corr_int_time_ms: u64

Correlator mode dump time

§corr_raw_scale_factor: f32

Correlator visibility scaling factor used to get the visibilities in Jansky-like units

§num_corr_fine_chans_per_coarse: usize

Number of fine channels in each coarse channel for a correlator observation

§volt_fine_chan_width_hz: u32

Voltage fine_chan_resolution

§num_volt_fine_chans_per_coarse: usize

Number of fine channels in each coarse channel for a voltage observation

§receivers: Vec<usize>

Array of receiver numbers

§num_receivers: usize

Number of recievers

§delays: Vec<u32>

Array of beamformer delays

§num_delays: usize

Number of beamformer delays

§calibrator: bool

Intended for calibration

§calibrator_source: String

Calibrator source

§global_analogue_attenuation_db: f64

ATTEN_DB // global analogue attenuation, in dB

§quack_time_duration_ms: u64

Seconds of bad data after observation starts

§good_time_unix_ms: u64

OBSID+QUACKTIM as Unix timestamp (first good timestep)

§good_time_gps_ms: u64

Good time expressed in GPS seconds

§num_ants: usize

Total number of antennas (tiles) in the array

§antennas: Vec<Antenna>

We also have just the antennas

§num_rf_inputs: usize

Total number of rf_inputs (tiles * 2 pols X&Y)

§rf_inputs: Vec<Rfinput>

The Metafits defines an rf chain for antennas(tiles) * pol(X,Y)

§num_ant_pols: usize

Number of antenna pols. e.g. X and Y

§num_metafits_timesteps: usize

Number of timesteps defined in the metafits file

§metafits_timesteps: Vec<TimeStep>

Vector of timesteps based on the metafits file

§num_metafits_coarse_chans: usize

Number of coarse channels based on the metafits file

§metafits_coarse_chans: Vec<CoarseChannel>

Vector of coarse channels based on the metafits file

§num_metafits_fine_chan_freqs: usize

Number of fine channels for the whole observation

§metafits_fine_chan_freqs_hz: Vec<f64>

Vector of fine channel frequencies for the whole observation

§obs_bandwidth_hz: u32

Total bandwidth of observation assuming we have all coarse channels

§coarse_chan_width_hz: u32

Bandwidth of each coarse channel

§centre_freq_hz: u32

The value of the FREQCENT key in the metafits file, but in Hz.

§num_baselines: usize

Number of baselines stored. This is autos plus cross correlations

§baselines: Vec<Baseline>

Baslines

§num_visibility_pols: usize

Number of polarisation combinations in the visibilities e.g. XX,XY,YX,YY == 4

§metafits_filename: String

Filename of the metafits we were given

§oversampled: bool

Was this observation using oversampled coarse channels?

§deripple_applied: bool

Was deripple applied to this observation?

§deripple_param: String

What was the configured deripple_param? If deripple_applied is False then this deripple param was not applied

Implementations§

source§

impl MetafitsContext

source

pub fn new<P: AsRef<Path>>( metafits: P, mwa_version: Option<MWAVersion> ) -> Result<Self, MwalibError>

From a path to a metafits file, create a MetafitsContext.

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

  • mwa_version - an Option containing the MWA version the metafits should be interpreted as. Pass None to have mwalib guess based on the MODE in the metafits.

§Returns
  • Result containing a populated MetafitsContext object if Ok.
source

pub fn generate_expected_volt_filename( &self, metafits_timestep_index: usize, metafits_coarse_chan_index: usize ) -> Result<String, VoltageFileError>

Return an expected voltage filenames for the input timestep and coarse channel indices.

§Arguments
  • metafits_timestep_index - the timestep index.

  • metafits_coarse_chan_index - the coarse channel index.

§Returns
  • Result containing the generated filename or an error

Trait Implementations§

source§

impl Clone for MetafitsContext

source§

fn clone(&self) -> MetafitsContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MetafitsContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for MetafitsContext

Implements fmt::Display for MetafitsContext struct

§Arguments

  • f - A fmt::Formatter

§Returns

  • fmt::Result - Result of this method
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

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

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.