atmos_flux_inversion package

Submodules

Inversion functions

All inversion functions have the same signature and give similar answers: the difference is how they get there. PSAS and Variational methods use iterative solvers. Optimal Interpolation uses a Gauss-Jordan solver. Variational methods use a different but equivalent formulation of the problem.

Module contents

Root package for inversion methods.

Import subpackages for specific versions.

The general idea is to take two bits of data about some state, one direct and one related by means of a known function, together with information about their distribution, to produce a best guess as to the state.

The state is typically referred to by the variable \(\vec{x}\). The indirect information is called an observation and denoted \(\vec{y}\). The state provided to the inversion is called the background, a priori, or prior state, while that given by the inversion is called the analysis, a posteriori, or posterior state. The function relating \(\vec{x}\) and \(\vec{y}\) is called the observation operator and is called \(h\).

These methods assume that \(h\) is differentiable near the states of interest, so we may take the Taylor series expansion

\[h(\vec{x}) \approx h(\vec{x}_0) + H (\vec{x} - \vec{x}_0) + O((\vec{x} - \vec{x}_0)^2)\]

as being a close approximation for \(\vec{x}\) near \(\vec{x}_0\), where \(H\) is the derivative of \(h\) at \(\vec{x}_0\), defined by

\[H := \frac{d h}{d\vec{x}} \bigg|_{\vec{x}=\vec{x}_0}\]

Note

The subpackages will generally be taking a frequentist approach to the problem in the descriptions.

Note

The many submodules use a from module import names pattern to get needed functions. This is to allow a substitution from other libraries (e.g., using dask.array.exp() instead of numpy.exp() for out-of-core evaluation, …)

exception atmos_flux_inversion.ConvergenceError(msg, result, guess=None, hess_inv=None)[source]

Bases: ValueError

An iterative scheme did not reach convergence.

The idea is that those who want good answers or nothing will get them, and those who want to take a chance with a bad one can do so. I feel good or nothing is the better default.

atmos_flux_inversion.GRAD_TOL = 1e-05

How small the gradient norm must be to declare convergence.

From gtol option to the BFGS method of scipy.optimize.minimize()

Used by variational and PSAS schemes to constrain iterative minimization.

atmos_flux_inversion.MAX_ITERATIONS = 40

Max. iterations allowed during minimizations.

I think 40 is what the operational centers use.

Used by variational and PSAS schemes to constrain iterative minimization.