General Purpose DA Utilities#
Utility functions for the data assimilation module.
These are utility functions for various assimilation algorithms, but are not useful otherwise.
Any utility function that is general will likely be moved to the utility
module.
- apply_TLM_operator(ip, state, obs_time=None, eval_at=None, save_all=False, scale_by_noise=False)[source]#
Apply the tangent linear model (TLM) of the parameter-to-observble map (aka the forwrad sensitivities) to the passed state/parameter and return the resulting observation. For a linear problem, the TLM is the same as the forwrad operator (model simulation + observation operator). For a nonlinear problem, the sensitivity array is constructed and is then multiplied (transposed) by the passed state/paraemter.
For an instance of a VariationalFilter, all time arguments (obs_times, save_all) are ignored/dropped.
This function just unifies the interface for both filters and smoothers. Specifically, it identifies the underlying inverse problem and chooses the acceptable arguments from passed arguments. Despite being useful, this method is only for internal purposes (at leasto for now) and is not intended not be called directly by the user.
- ..note::
Values for all arguments should be passed. Default values are added for convenience assuming type/assertion checks are carried out by the adjoint operators in the inverse problem implementation
- ..note::
Constructing sensitivity array is not efficient, and should be replaced with matrix-free operation.
- Parameters:
ip – An inverse prlblem. Expecte to be an instance of one of two classes
VariationalFilter
orVariationalSmoother
. ATypeError
exception is raised otherwise.state – the model state/parameter to which to the TLM applied (multiplied).
- Returns:
the result (observation) of applying the simulation model followed by the applying the observation operator
- apply_adjoint_operator(ip, obs, obs_time=None, eval_at=None, save_all=False, scale_by_noise=False)[source]#
This function just unifies the interface for both filters and smoothers. Specifically, it identifies the underlying inverse problem and chooses the acceptable arguments from passed arguments. Despite being useful, this method is only for internal purposes (at leasto for now) and is not intended not be called directly by the user.
- ..note::
Values for all arguments should be passed. Default values are added for convenience assuming type/assertion checks are carried out by the adjoint operators in the inverse problem implementation
- Parameters:
ip – An inverse prlblem. Expecte to be an instance of one of two classes
VariationalFilter
orVariationalSmoother
. ATypeError
exception is raised otherwise.obs – the observation to the TLM transposed is applied to (multiplied by).
- Returns:
the result (observation) of applying the simulation model followed by the applying the observation operator