random_noiseΒΆ

When simulating observations, it is often useful to add random noise to the observations to emulate the behaviour of real data. The functions in this module are used to settings for this noise to the simulation of observations. At present, simple Python functions are used directly as input. The noise functions take the time as input (typically as a float) and return the associated randomly generated noise as a np.ndarray (rather than a float, to permit consistency with multi-valued observations; for single-valued observations such as range or Doppler the noise function should return an array of size 1).

The main interface with Tudat is that these noise functions are can be added to ObservationSimulationSettings objects, which are in turn used as input to observation simulation (see observations_simulation_settings). The noise function can be set in these objects directly using the noise_function attribute. For convenience there are options to set a custom-defined noise function to a list of simulation settings (using the add_noise_function_to_all(), add_noise_function_to_observable() and add_noise_function_to_observable_for_link_ends() functions). Similarly, there are functions to create a Gaussian noise function (with zero mean) and add this to the simulation settings (sing the add_gaussian_noise_to_all(), add_gaussian_noise_to_observable() and add_gaussian_noise_to_observable_for_link_ends() functions).

As an example, adding Gaussian noise to all observations of type one_way_range_type is done by:

from tudatpy.estimation.observations_setup import random_noise
from tudatpy.estimation.observable_models_setup import model_settings

# Create a list[ObservationSimulationSettings]
observation_simulation_settings_list = ....

# Add random noise settings
noise_level = 0.1
random_noise.add_gaussian_noise_to_observable(
    observation_simulation_settings_list,
    noise_level,
    model_settings.one_way_range_type
)

which will add 0.1 m standard deviation Gaussian random noise to each one-way range setting in the observation_simulation_settings_list list. In this case (the add_gaussian_noise_to_observable() function).

An example of doing the exact same procedure, but using the custom noise function interface:

import numpy as np
from tudatpy.estimation.observations_setup import random_noise
from tudatpy.estimation.observable_models_setup import model_settings

def custom_noise_function(current_time):
    return np.array([np.random.lognormal(0.0, 1.0)])

random_noise.add_noise_function_to_observable(
    observation_simulation_settings_list,
    custom_noise_function,
    model_settings.one_way_range_type
)

where it is important to realize that the noise function must have a single float representing time as input, and returns a vector (of the size of a single observation) as output (for range, this size is equal to 1)

FunctionsΒΆ

add_noise_function_to_all(...)

Function for adding a custom noise function to all existing observation simulation settings.

add_noise_function_to_observable(...)

Function for adding a custom noise function to selected existing observation simulation settings of a given observable type.

add_noise_function_to_observable_for_link_ends(...)

Function for adding a custom noise function to existing observation simulation settings of a given observable type and link definition.

add_gaussian_noise_to_all(...)

Function for adding gaussian noise function to all existing observation simulation settings.

add_gaussian_noise_to_observable(...)

Function for adding gaussian noise function to existing observation simulation settings of a given observable type.

add_gaussian_noise_to_observable_for_link_ends(...)

Function for adding gaussian noise function to existing observation simulation settings of a given observable type and link definition.

add_noise_function_to_all(observation_simulation_settings_list: list[tudatpy.kernel.estimation.observations_setup.observations_simulation_settings.ObservationSimulationSettings], noise_amplitude: Callable[[float | SupportsIndex], numpy.ndarray[numpy.float64[m, 1]]]) NoneΒΆ

Function for adding a custom noise function to all existing observation simulation settings.

Function for including a custom noise function to the simulation settings of all observables. The noise settings are added to all ObservationSimulationSettings object(s) in the observation_simulation_settings list.

Note: the ObservationSimulationSettings objects are modified in-place by this function, and thus the function does not return anything.

Parameters:
  • observation_simulation_settings_list (List[ ObservationSimulationSettings ]) – Observation simulation settings, given by a list of one or more existing ObservationSimulationSettings objects.

  • noise_function (callable[ [Time], numpy.ndarray[numpy.float64[m, 1]] ]) – Function providing the observation noise factors as a function of observation time.

Returns:

The ObservationSimulationSettings object(s) are changed in-place.

Return type:

None

add_noise_function_to_observable(observation_simulation_settings_list: list[tudatpy.kernel.estimation.observations_setup.observations_simulation_settings.ObservationSimulationSettings], noise_amplitude: Callable[[float | SupportsIndex], numpy.ndarray[numpy.float64[m, 1]]], observable_type: tudatpy.kernel.estimation.observable_models_setup.model_settings.ObservableType) NoneΒΆ

Function for adding a custom noise function to selected existing observation simulation settings of a given observable type.

As add_noise_function_to_all(), except that the function only adds noise to entries of the observation_simulation_settings list that matches the specified observable_type.

Parameters:
  • observation_simulation_settings_list (List[ ObservationSimulationSettings ]) – Observation simulation settings, given by a list of one or more existing ObservationSimulationSettings objects.

  • noise_function (callable[ [Time], numpy.ndarray[numpy.float64[m, 1]] ]) – Function providing the observation noise factors as a function of observation time.

  • observable_type (ObservableType) – Identifies the observable type in the observation simulation settings to which the noise is to be added.

Returns:

The ObservationSimulationSettings object(s) are changed in-place.

Return type:

None

Function for adding a custom noise function to existing observation simulation settings of a given observable type and link definition.

As add_noise_function_to_all(), except that the function only adds noise to entries of the observation_simulation_settings list that matches the specified observable_type and link_definition.

Parameters:
  • observation_simulation_settings (List[ ObservationSimulationSettings ]) – Observation simulation settings, given by a list of one or more existing ObservationSimulationSettings objects.

  • noise_function (callable[ [Time], numpy.ndarray[numpy.float64[m, 1]] ]) – Function providing the observation noise factors as a function of observation time.

  • observable_type (ObservableType) – Identifies the observable type in the observation simulation settings to which the noise is to be added.

  • link_definition (LinkDefinition) – Identifies the link definition in the observation simulation settings for which the noise is to be added.

Returns:

The ObservationSimulationSettings object(s) are changed in-place.

Return type:

None

add_gaussian_noise_to_all(observation_simulation_settings_list: list[tudatpy.kernel.estimation.observations_setup.observations_simulation_settings.ObservationSimulationSettings], noise_amplitude: float | SupportsIndex) NoneΒΆ

Function for adding gaussian noise function to all existing observation simulation settings.

Function for including simple time-independent and time-uncorrelated Gaussian noise function to the simulation settings of one or more observable(s). The noise settings are added to all ObservationSimulationSettings object(s) in the observation_simulation_settings list.

Note: the ObservationSimulationSettings objects are modified in-place by this function, and thus the function does not return anything.

Parameters:
Returns:

The ObservationSimulationSettings object(s) are changed in-place.

Return type:

None

add_gaussian_noise_to_observable(observation_simulation_settings_list: list[tudatpy.kernel.estimation.observations_setup.observations_simulation_settings.ObservationSimulationSettings], noise_amplitude: float | SupportsIndex, observable_type: tudatpy.kernel.estimation.observable_models_setup.model_settings.ObservableType) NoneΒΆ

Function for adding gaussian noise function to existing observation simulation settings of a given observable type.

As add_gaussian_noise_to_all(), except that the function only adds noise to entries of the observation_simulation_settings list that matches the specified observable_type.

Parameters:
  • observation_simulation_settings (List[ ObservationSimulationSettings ]) – Observation simulation settings, given by a list of one or more existing ObservationSimulationSettings objects.

  • noise_amplitude (float) – Standard deviation defining the un-biased Gaussian distribution for the noise.

  • observable_type (ObservableType) – Identifies the observable type in the observation simulation settings to which the noise is to be added.

Returns:

The ObservationSimulationSettings object(s) are changed in-place.

Return type:

None

Function for adding gaussian noise function to existing observation simulation settings of a given observable type and link definition.

As add_gaussian_noise_to_all(), except that the function only adds noise to entries of the observation_simulation_settings list that matches the specified observable_type and link_definition.

Parameters:
  • observation_simulation_settings (List[ ObservationSimulationSettings ]) – Observation simulation settings, given by a list of one or more existing ObservationSimulationSettings objects.

  • noise_amplitude (float) – Standard deviation defining the un-biased Gaussian distribution for the noise.

  • observable_type (ObservableType) – Identifies the observable type in the observation simulation settings to which the noise is to be added.

  • link_definition (LinkDefinition) – Identifies the link definition in the observation simulation settings for which the noise is to be added.

Returns:

The ObservationSimulationSettings object(s) are changed in-place.

Return type:

None