8. MediaCorrections#
- class MediaCorrections(name: str, instrument: Instrument)#
Bases:
Measurement
Calculates media correction delays for ionosophere and troposphere that is applied to real models. Performs a summation of coefficients that are added together and used to return a delay uncertainty in the RTLT.
- Parameters:
See also
scarabaeus.Units
Utilizes Dimensions in its construction.
scarabaeus.ArrayWUnits
Dependent on Units and Dimensions.
References
Examples
MediaCorrection objects can be constructed with strings:
# initial setup import scarabaeus as scb import numpy as np # create a MediCorrection object using a string media_correction = MediaCorrection( name="GS1 Doppler Media Corrections", instrument=scb.GroundStation("DSS-24"), )
Attributes
The instrument.
The name of the model.
Methods
compute_coefficient_sum
(media_data, ...)Generates the sum of media correction coefficients related to ionosphere, troposphere, or seasonal model.
compute_partials
(target, epoch_array[, frame])Stacks together measurement partials for an epoch array at different epochs.
computed_rtlt_delays
(media_file_path, ...[, ...])Computes the media correction delay between target and instrument (2-way).
generate_measurement_dataset
(dataset_name, ...)Generates a MeasurementDataSet object that can be used by filters downstream.
observed_measurements
(file_name[, ...])Reads measurements from a .json file.
residuals
(observed_meas, computed_meas)Generates the measurement model's residuals given observed and computed ArrayWFrames.
write_observed_measurements
(target[, ...])Generates synthetic measurements and write them as a .json file.
- compute_coefficient_sum(media_data, epoch_time, media_type, epoch_index) float #
Generates the sum of media correction coefficients related to ionosphere, troposphere, or seasonal model.
- Parameters:
media_data (
pandas dataframe
) – Coefficients and relevant information for media correctionsepoch_time (
scb.Epoch
) – Time tag epochs in ET as scb Epoch objectmedia_type (
str
) – Name of the media correction model ‘tropo’, ‘iono’, or ‘seasonal’epoch_index (
int
) – Row index for data with matching epoch time range
- Return type:
Float
Notes
All inputs are automatically determined through the computed_rtlt_delays method
- compute_partials(target: ~scarabaeus.spacecraft.Spacecraft.Spacecraft, epoch_array: ~scarabaeus.timeAndFrame.EpochArray.EpochArray, frame: ~scarabaeus.timeAndFrame.Frame.Frame = J2000 (0 - SOLAR SYSTEM BARYCENTER)) list #
Stacks together measurement partials for an epoch array at different epochs.
- Parameters:
target (
Spacecraft
) – The target spacecraft.epoch_array (
EpochArray
) – The epochs.frame (
Frame
, optional) – The reference frame. Defaults to a J2000 Frame object.
- Returns:
partials – A list with all the partials evaluated at different epochs in the
epoch_array
.- Return type:
- computed_rtlt_delays(media_file_path: str, target, frequency_array, frame: ~scarabaeus.timeAndFrame.Frame.Frame = J2000 (0 - SOLAR SYSTEM BARYCENTER), epoch_array: ~scarabaeus.timeAndFrame.EpochArray.EpochArray = None) ArrayWFrame #
Computes the media correction delay between target and instrument (2-way).
- Parameters:
media_file_path (
str
) – String name of .json file path containing the media coefficient measurement informationtarget (
Body | Spacecraft
) – Target spacecraft as Spacecraft or Body objectfrequency_array (
list | numpy.ndarray
) – Array with frequencies for specific leg of light path, used to compute the ionosphere rtlt delayframe (
str | Frame
) – Frame to be used to write the output AWF. Defaults to J2000 Frame object.epoch_array (
list | numpy.ndarray
) – Array with recieve or transmit time tags (ET) as scb Epoch array object
- Returns:
Array with troposphere corrections
Array with ionosphere corrections
Notes
Needs to be run for both t3 and t1 epochs, then outputs are summed into a total delta epoch_array and frequency_array should be the same size array
Examples
media_correction.computed_rtlt_delays( media_file_path = 'Users/data/Media_corrections_2021_121_2021_152.json', target = "-64", frequency_array = [124092, 1249049, 1249345], frame = 'ITRF93', epoch_array = [128401294, 182492924, 189481294], )
- generate_measurement_dataset(dataset_name: str, measurement_type: str, target: ~scarabaeus.body.Body.Body, observed_meas: ~scarabaeus.timeAndFrame.ArrayWFrame.ArrayWFrame = None, frame: ~scarabaeus.timeAndFrame.Frame.Frame = J2000 (0 - SOLAR SYSTEM BARYCENTER), noisy: bool = False, prior_range_bias=None) list[MeasurementDataSet] #
Generates a MeasurementDataSet object that can be used by filters downstream.
- Parameters:
dataset_name (
str
) – The name of the MeasurementDataSet.target (
Spacecraft
) – The target spacecraft.epoch_list (
EpochArray
, optional) – The epochs. Defaults toNone
.epoch_start (
EpochArray
, optional) – The starting epoch. Defaults toNone
.epoch_end (
EpochArray
, optional) – The end epoch. Defaults toNone
.tstep (
int
, optional) – The integration timestep. Defaults to1
.observed_measurements (
list
, optional) – The observed measurements. Defaults toNone
.frame (
Frame
, optional) – The reference frame. Defaults to a J2000 Frame object.noisy (
bool
, optional) – Indicates if noise is added to the measurements or not. Defaults toFalse
.
- Returns:
mds_list – A list of MeasurementDataSet objects representing the measurements with their key properties to be used by a filter.
- Return type:
list[MeasurementDataSet]
Notes
The MeasurementDataSet output is generated in 6 steps:
Computed measurements
Partials
Residuals
Sigmas
Pack everything in a list
Pack the list in a MeasurementDataSet object
- observed_measurements(file_name, meas_name: str = 'meas_ideal', units: ~scarabaeus.units.Units.Units = unitless, frame: ~scarabaeus.timeAndFrame.Frame.Frame = J2000 (0 - SOLAR SYSTEM BARYCENTER)) Tuple[EpochArray, ndarray, ArrayWFrame] #
Reads measurements from a .json file.
- Parameters:
file_name (
str
) – The filename of the .json file containig the measurement information.meas_name (
str
, optional) – The name of the measurement data to access from the dictionary. Defaults to'meas_ideal'
.units (
Units
, optional) – Units to be used to write the output AWU. Defaults tounitless
.frame (
Frame
, optional) – Frame to be used to write the output AWF. Defaults to a J2000 Frame object.
- Returns:
meas_time_et, meas_sec, meas_obs – A tuple with the following values corresponding to their respective indices:
[0]
= meas_time_etEpochArrayThe time in ephemeris time.
[1]
= meas_Secnumpy.ndarrayThe times in seconds.
[2]
= meas_obsArrayWFrameAn AWF with the quantities in AWU.
- Return type:
Tuple[EpochArray
,numpy.ndarray
,ArrayWFrame]
Notes
The writing of the json assumes or requires units and frames.
- residuals(observed_meas: ArrayWFrame, computed_meas: ArrayWFrame) ArrayWFrame #
Generates the measurement model’s residuals given observed and computed ArrayWFrames.
- Parameters:
observed_meas (
ArrayWFrame
) – The observed measurements values (O).computed_meas (
ArrayWFrame
) – The computed measurements values (C).
- Returns:
residuals – AWF with the residual O-C.
- Return type:
- write_observed_measurements(target: Spacecraft, epoch_array: EpochArray = None, epoch_start: EpochArray = None, epoch_end: EpochArray = None, tstep: float = 1, frame: Frame = None, noisy: bool = False, prior_range_bias: float = None, file_name: str = 'ideal_measurement') None #
Generates synthetic measurements and write them as a .json file. The input of this method encapsulate the ones needed for the “computed_meas” method in each measurement model class.
- Parameters:
target (
Spacecraft
) – The target spacecraft for which the range measurement is to be computed.epoch_array (
EpochArray
, optional) – An array of epochs (times) at which the range measurements should be computed. If provided, overridesepoch_start
,epoch_end
, andtstep
.epoch_start (
EpochArray
, optional) – The starting epoch for the range measurement computations. Required ifepoch_array
is not provided.epoch_end (
EpochArray
, optional) – The ending epoch for the range measurement computations. Required ifepoch_array
is not provided.tstep (
float
, optional) – The time step, in seconds, between consecutive range measurements. If epoch_array is not provided. Defaults to1
second.frame (Frame , optional) – The reference frame in which the range computation is performed. Defaults to
None
.noisy (bool , optional) – Whether to add noise to the computed range measurement. Defaults to
False
.prior_range_bias (
float
, optional) – A prior bias value to add to the computed range measurements. Defaults toNone
.file_name (
str
, optional) – The filename of the JSON in which the measurement is saved, Defaults to'ideal_measurement'
.
- Return type:
- property instrument: Instrument#
The instrument.