isofit.inversion.inverse
- class Inversion(full_config, forward)[source]
Bases:
object
- calc_conditional_prior(x_free, geom)[source]
Calculate prior distribution of radiance. This depends on the location in the state space. Return the inverse covariance and its square root (for non-quadratic error residual calculation).
- calc_prior(x, geom)[source]
Calculate prior distribution of radiance. This depends on the location in the state space. Return the inverse covariance and its square root (for non-quadratic error residual calculation).
- calc_posterior(x, geom, meas)[source]
Calculate posterior distribution of state vector. This depends both on the location in the state space and the radiance (via noise).
- calc_Seps(x, meas, geom)[source]
Calculate (zero-mean) measurement distribution in radiance terms. This depends on the location in the state space. This distribution is calculated over one or more subwindows of the spectrum. Return the inverse covariance and its square root.
- jacobian(x_free, geom, Seps_inv_sqrt)[source]
Calculate measurement Jacobian and prior Jacobians with respect to cost function. This is the derivative of cost with respect to the state, commonly known as the gradient or loss surface. The cost is expressed as a vector of ‘residuals’ with respect to the prior and measurement, expressed in absolute (not quadratic) terms for the solver; It is the square root of the Rodgers (2000) Chi-square version. All measurement distributions are calculated over subwindows of the full spectrum. :type x_free: :param x_free: decision variables - portion of the statevector not fixed by a static integration grid :type geom: :param geom: Geometry to use for inversion :type Seps_inv_sqrt: :param Seps_inv_sqrt: Inverse square root of the covariance of “observation noise”,
including both measurement noise from the instrument as well as variability due to unknown variables.
- Returns:
The complete (measurement and prior) jacobian
- Return type:
total_jac
- loss_function(x_free, geom, Seps_inv_sqrt, meas)[source]
Calculate cost function expressed here in absolute (not quadratic) terms for the solver, i.e., the square root of the Rodgers (2000) Chi-square version. We concatenate ‘residuals’ due to measurment and prior terms, suitably scaled. All measurement distributions are calculated over subwindows of the full spectrum.
- Parameters:
x_free – decision variables - portion of the statevector not fixed by a static integration grid
geom – Geometry to use for inversion
Seps_inv_sqrt – Inverse square root of the covariance of “observation noise”, including both measurement noise from the instrument as well as variability due to unknown variables.
meas – a one-D scipy vector of radiance in uW/nm/sr/cm2
- Returns:
the complete, calculated residual x: the complete (x_free + any x_fixed augmented in)
- Return type:
total_residual
- invert(meas, geom)[source]
Inverts a meaurement and returns a state vector. :type meas: :param meas: a one-D scipy vector of radiance in uW/nm/sr/cm2 :type geom: :param geom: a geometry object
- Returns:
a converged state vector solution
- Return type:
final_solution
- forward_uncertainty(x, meas, geom)[source]
- Parameters:
x – statevector
meas – a one-D scipy vector of radiance in uW/nm/sr/cm2
geom – a geometry object
- Returns:
the converged lambertian surface reflectance path: the converged path radiance estimate mdl: the modeled radiance estimate S_hat: the posterior covariance of the state vector K: the derivative matrix d meas_x / d state_x G: the G matrix from the CD Rodgers 2000 formalism
- Return type:
lamb