isofit.inversion

Submodules

Classes

ClassicInversion

MCMCInversion

Functions

Inversion(config, fm)

Retrieves the correct Inversion model to initialize and returns

Package Contents

class ClassicInversion(full_config: Config, forward: ForwardModel)
config
lasttime
fm
hashtable
max_table_size
state_indep_S_hat = False
windows
mode
winidx
outside_ret_windows
counts = 0
inversions = 0
integration_grid
grid_as_starting_points
x_fixed = None
least_squares_params
full_statevector(x_free)
calc_conditional_prior(x_free, geom)

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)

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)

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)

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) numpy.ndarray

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. :param x_free: decision variables - portion of the statevector not fixed by a static integration grid :param geom: Geometry to use for inversion :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)

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)

Inverts a meaurement and returns a state vector. :param meas: a one-D scipy vector of radiance in uW/nm/sr/cm2 :param geom: a geometry object

Returns:

a converged state vector solution

Return type:

final_solution

forward_uncertainty(x, meas, geom)

Can this be depreciated? Uncertainty file is generated by a direct call to calc_posterior.

Dev branch path and mdl will not return expected values:
-> keys don’t match

rfl != rho_dir_dir for example

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

class MCMCInversion(full_config: Config, forward: ForwardModel)[source]

Bases: isofit.inversion.inverse.Inversion

iterations
burnin
regularizer
proposal_scaling
verbose
restart_every
stable_mvnpdf(mean, cov, x)[source]

Stable inverse via Singular Value Decomposition, using only the significant eigenvectors.

log_density(x, rdn_meas, geom, bounds)[source]

Log probability density combines prior and likelihood terms.

invert(rdn_meas, geom)[source]

Inverts a meaurement. Returns an array of state vector samples. Similar to Inversion.invert() but returns a list of samples.

Inversion(config, fm)[source]

Retrieves the correct Inversion model to initialize and returns