MeasurementDataSet#

class MeasurementDataSet(set_name: str, measurements: list, names: list[str], instrument: Instrument, target: Body, epochs_t3: EpochArray, measurement_type: str = None, station_two: GroundStation = None, units=None, frame=None)#

Bases: object

Groups together measurement data from different measurement models. Used by the active filter.

Generates a list of packaged data from a given measurement. At each epoch at which the filter has a valid measurement, provides access to its computed and observed value, residual, numerical value of the partial, and the standard deviation of the measurement.

Parameters:
  • set_name (str) – The name of the dataset.

  • measurements (list) – List with AWU, np.array, and lists of measurements data (e.g. observed, computed, residuals, partials, sigmas).

  • names (list[str]) – List of values in the measurement list (["computed", "observed", "residuals", "partials", "sigma"]).

  • instrument (Instrument) – Instrument used to generate these measurements (e.g. antenna, camera, etc.)

  • target (Body) – Target body of the measurement model.

  • epochs_t3 (EpochArray) – Epochs of the measurements.

  • measurement_type (str, optional) –

    The type of measurements. Can be given as:

    • range

    • range real

    • rangerate

    • doppler

    • doppler real

    • opnav

    • dor

    Defaults to None.

  • station_two (GroundStation, optional) – Optional Ground station object for three-way and DOR measurements. Defaults to None.

Notes

The dataset is populated by generate_measurement_dataset() and stores all quantities needed by a filter at each measurement epoch: computed value, observed value, prefit residual, measurement partials (\(H\) row), and measurement noise standard deviation (\(\sigma\)). The outlier_flag column (value 0/1) allows downstream editing without removing data permanently.

See also

scarabaeus.Measurement

Abstract base class for all measurement models.

Attributes:
data

The measurement data dictionary (computed, observed, residuals, partials, sigmas).

epochs_t3

The reception epochs linked to the measurements.

frame

Frame the measurements were generated in (a Frame object), or None.

instrument

The instrument that generated the measurements.

measurement_type

The measurement type string tag (e.g.

set_name

The name of the dataset.

station_two

The second ground station, for three-way and DOR measurement types.

target

Target body of the measurement model.

units

Units of the measurement values (an ArrayWUnits units object), or None.

Methods

add_data(data, name)

Adds data to an existing dataset.

flag_outliers_by_resid([mean_outlier, ...])

Flag outliers in the MeasurementDataset based on residual values.

remove_outliers()

Remove from the MeasurementDataSet object the data and epochs_t3 associated to measurements with outlier_flag equal to 1.

add_data(data: list, name: str)#

Adds data to an existing dataset.

Parameters:
  • data (list) – Extra data to add to an existing MeasurementDataset object.

  • name (str) – The name of the dataset.

flag_outliers_by_resid(mean_outlier: float | None = None, sigma_outlier: float | None = None) None#

Flag outliers in the MeasurementDataset based on residual values.

Identifies measurements whose residuals fall outside the interval [mean - sigma, mean + sigma] and marks them as outliers.

Parameters:
  • mean_outlier (float, optional) – Center of the acceptable residual interval. If None, uses the mean of current residuals. Default is None.

  • sigma_outlier (float, optional) – Half-width of the acceptable residual interval. If None, uses 5 times the standard deviation of current residuals. Default is None.

Returns:

Modifies self.data[‘outlier_flag’] in place.

Return type:

None

Raises:
  • KeyError – If ‘outlier_flag’ column is missing from self.data.

  • KeyError – If ‘residuals’ column is missing from self.data.

Notes

  • By default (when both parameters are None), uses 5-sigma criterion

  • Outliers are flagged with value 1 in the ‘outlier_flag’ column

  • Existing outlier flags are preserved and combined with new detections

Examples

>>> # Flag outliers using default 5-sigma criterion
>>> dataset.flag_outliers_by_resid()
>>> # Flag outliers using custom interval
>>> dataset.flag_outliers_by_resid(mean_outlier=0.0, sigma_outlier=3.0)
remove_outliers()#

Remove from the MeasurementDataSet object the data and epochs_t3 associated to measurements with outlier_flag equal to 1.

Raises:

KeyError – If outlier_flag key is missing from self.data.

property data: list[str]#

The measurement data dictionary (computed, observed, residuals, partials, sigmas).

property epochs_t3: EpochArray#

The reception epochs linked to the measurements.

property frame#

Frame the measurements were generated in (a Frame object), or None.

property instrument: Instrument#

The instrument that generated the measurements.

property measurement_type#

The measurement type string tag (e.g. "range", "doppler").

property set_name: str#

The name of the dataset.

property station_two: GroundStation#

The second ground station, for three-way and DOR measurement types.

property target: Body#

Target body of the measurement model.

property units#

Units of the measurement values (an ArrayWUnits units object), or None.