atmos_flux_inversion.optimal_interpolation module

Inversions using Optimal Interpolaiton.

Also known as Kalman Matrix Inversion or batch inversion.

atmos_flux_inversion.optimal_interpolation.fold_common(background, background_covariance, observations, observation_covariance, observation_operator, reduced_background_covariance, reduced_observation_operator)[source]

Solve the inversion problem, evaluating sub-expressions only once.

Assumes all arrays fit in memory with room to spare.

Assumes everything follows a multivariate normal distribution with the specified covariance matrices. Under this assumption analysis_covariance is exact, and analysis is the Maximum Likelihood Estimator and the Best Linear Unbiased Estimator for the underlying state in the frequentist framework, and specify the posterior distribution for the state in the Bayesian framework. If these are not satisfied, these still form the Generalized Least Squares estimates for the state and an estimated uncertainty.

Parameters
  • background (array_like[N]) – The background state estimate.

  • background_covariance (array_like[N, N]) – Covariance of background state estimate across realizations/ensemble members. “Ensemble” is here interpreted in the sense used in statistical mechanics or frequentist statistics, and may not be derived from a sample as in meteorological ensemble Kalman filters

  • observations (array_like[M]) – The observations constraining the background estimate.

  • observation_covariance (array_like[M, M]) – Covariance of observations across realizations/ensemble members. “Ensemble” again has the statistical meaning.

  • observation_operator (array_like[M, N]) – The relationship between the state and the observations.

  • reduced_background_covariance (array_like[Nred, Nred], optional) – The covariance for a smaller state space, usually obtained by reducing resolution in space and time. Note that reduced_observation_operator must also be provided

  • reduced_observation_operator (array_like[M, Nred], optional) – The relationship between the reduced state space and the observations. Note that reduced_background_covariance must also be provided.

Returns

  • analysis (array_like[N]) – Analysis state estimate

  • analysis_covariance (array_like[Nred, Nred] or array_like[N, N]) – Estimated uncertainty of analysis across realizations/ensemble members. Calculated using reduced_background_covariance and reduced_observation_operator if possible

atmos_flux_inversion.optimal_interpolation.save_sum(background, background_covariance, observations, observation_covariance, observation_operator, reduced_background_covariance=None, reduced_observation_operator=None)[source]

Solve the inversion problem, evaluating sub-expressions only once.

Assumes all arrays fit in memory with room to spare.

Assumes everything follows a multivariate normal distribution with the specified covariance matrices. Under this assumption analysis_covariance is exact, and analysis is the Maximum Likelihood Estimator and the Best Linear Unbiased Estimator for the underlying state in the frequentist framework, and specify the posterior distribution for the state in the Bayesian framework. If these are not satisfied, these still form the Generalized Least Squares estimates for the state and an estimated uncertainty.

Parameters
  • background (array_like[N]) – The background state estimate.

  • background_covariance (array_like[N, N]) – Covariance of background state estimate across realizations/ensemble members. “Ensemble” is here interpreted in the sense used in statistical mechanics or frequentist statistics, and may not be derived from a sample as in meteorological ensemble Kalman filters

  • observations (array_like[M]) – The observations constraining the background estimate.

  • observation_covariance (array_like[M, M]) – Covariance of observations across realizations/ensemble members. “Ensemble” again has the statistical meaning.

  • observation_operator (array_like[M, N]) – The relationship between the state and the observations.

  • reduced_background_covariance (array_like[Nred, Nred], optional) – The covariance for a smaller state space, usually obtained by reducing resolution in space and time. Note that reduced_observation_operator must also be provided

  • reduced_observation_operator (array_like[M, Nred], optional) – The relationship between the reduced state space and the observations. Note that reduced_background_covariance must also be provided.

Returns

  • analysis (array_like[N]) – Analysis state estimate

  • analysis_covariance (array_like[Nred, Nred] or array_like[N, N]) – Estimated uncertainty of analysis across realizations/ensemble members. Calculated using reduced_background_covariance and reduced_observation_operator if possible

atmos_flux_inversion.optimal_interpolation.scipy_chol(background, background_covariance, observations, observation_covariance, observation_operator, reduced_background_covariance=None, reduced_observation_operator=None)[source]

Use the Cholesky decomposition to solve the inverison problem.

Assumes all arrays fit in memory with room to spare. Uses cholesky decomposition for solving a matrix equation rather than using matrix inverses.

Assumes everything follows a multivariate normal distribution with the specified covariance matrices. Under this assumption analysis_covariance is exact, and analysis is the Maximum Likelihood Estimator and the Best Linear Unbiased Estimator for the underlying state in the frequentist framework, and specify the posterior distribution for the state in the Bayesian framework. If these are not satisfied, these still form the Generalized Least Squares estimates for the state and an estimated uncertainty.

Parameters
  • background (array_like[N]) – The background state estimate.

  • background_covariance (array_like[N, N]) – Covariance of background state estimate across realizations/ensemble members. “Ensemble” is here interpreted in the sense used in statistical mechanics or frequentist statistics, and may not be derived from a sample as in meteorological ensemble Kalman filters

  • observations (array_like[M]) – The observations constraining the background estimate.

  • observation_covariance (array_like[M, M]) – Covariance of observations across realizations/ensemble members. “Ensemble” again has the statistical meaning.

  • observation_operator (array_like[M, N]) – The relationship between the state and the observations.

  • reduced_background_covariance (array_like[Nred, Nred], optional) – The covariance for a smaller state space, usually obtained by reducing resolution in space and time. Note that reduced_observation_operator must also be provided

  • reduced_observation_operator (array_like[M, Nred], optional) – The relationship between the reduced state space and the observations. Note that reduced_background_covariance must also be provided.

Returns

  • analysis (array_like[N]) – Analysis state estimate

  • analysis_covariance (array_like[Nred, Nred] or array_like[N, N]) – Estimated uncertainty of analysis across realizations/ensemble members. Calculated using reduced_background_covariance and reduced_observation_operator if possible

atmos_flux_inversion.optimal_interpolation.simple(background, background_covariance, observations, observation_covariance, observation_operator, reduced_background_covariance, reduced_observation_operator)[source]

Solve the inversion problem using the equations literally.

Assumes all arrays fit in memory with room to spare. A direct translation of the matrix inversion equations to Python.

Assumes everything follows a multivariate normal distribution with the specified covariance matrices. Under this assumption analysis_covariance is exact, and analysis is the Maximum Likelihood Estimator and the Best Linear Unbiased Estimator for the underlying state in the frequentist framework, and specify the posterior distribution for the state in the Bayesian framework. If these are not satisfied, these still form the Generalized Least Squares estimates for the state and an estimated uncertainty.

Parameters
  • background (array_like[N]) – The background state estimate.

  • background_covariance (array_like[N, N]) – Covariance of background state estimate across realizations/ensemble members. “Ensemble” is here interpreted in the sense used in statistical mechanics or frequentist statistics, and may not be derived from a sample as in meteorological ensemble Kalman filters

  • observations (array_like[M]) – The observations constraining the background estimate.

  • observation_covariance (array_like[M, M]) – Covariance of observations across realizations/ensemble members. “Ensemble” again has the statistical meaning.

  • observation_operator (array_like[M, N]) – The relationship between the state and the observations.

  • reduced_background_covariance (array_like[Nred, Nred], optional) – The covariance for a smaller state space, usually obtained by reducing resolution in space and time. Note that reduced_observation_operator must also be provided

  • reduced_observation_operator (array_like[M, Nred], optional) – The relationship between the reduced state space and the observations. Note that reduced_background_covariance must also be provided.

Returns

  • analysis (array_like[N]) – Analysis state estimate

  • analysis_covariance (array_like[Nred, Nred] or array_like[N, N]) – Estimated uncertainty of analysis across realizations/ensemble members. Calculated using reduced_background_covariance and reduced_observation_operator if provided