isofit.inversion ================ .. py:module:: isofit.inversion Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/isofit/inversion/inverse/index /autoapi/isofit/inversion/inverse_mcmc/index /autoapi/isofit/inversion/inverse_simple/index Classes ------- .. autoapisummary:: isofit.inversion.ClassicInversion isofit.inversion.MCMCInversion Functions --------- .. autoapisummary:: isofit.inversion.Inversion Package Contents ---------------- .. py:class:: ClassicInversion(full_config: Config, forward: ForwardModel) .. py:attribute:: config .. py:attribute:: lasttime .. py:attribute:: fm .. py:attribute:: hashtable .. py:attribute:: max_table_size .. py:attribute:: state_indep_S_hat :value: False .. py:attribute:: windows .. py:attribute:: mode .. py:attribute:: winidx .. py:attribute:: outside_ret_windows .. py:attribute:: counts :value: 0 .. py:attribute:: inversions :value: 0 .. py:attribute:: integration_grid .. py:attribute:: grid_as_starting_points .. py:attribute:: x_fixed :value: None .. py:attribute:: least_squares_params .. py:method:: full_statevector(x_free) .. py:method:: 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). .. py:method:: 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). .. py:method:: 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). .. py:method:: 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. .. py:method:: 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 :rtype: total_jac .. py:method:: loss_function(x_free, geom, Seps_inv_sqrt, meas) -> (numpy.array, numpy.array) 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. :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. :param 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) :rtype: total_residual .. py:method:: 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 :rtype: final_solution .. py:method:: 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 :param x: statevector :param meas: a one-D scipy vector of radiance in uW/nm/sr/cm2 :param 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 :rtype: lamb .. py:class:: MCMCInversion(full_config: Config, forward: ForwardModel) Bases: :py:obj:`isofit.inversion.inverse.Inversion` .. py:attribute:: iterations .. py:attribute:: burnin .. py:attribute:: regularizer .. py:attribute:: proposal_scaling .. py:attribute:: verbose .. py:attribute:: restart_every .. py:method:: stable_mvnpdf(mean, cov, x) Stable inverse via Singular Value Decomposition, using only the significant eigenvectors. .. py:method:: log_density(x, rdn_meas, geom, bounds) Log probability density combines prior and likelihood terms. .. py:method:: invert(rdn_meas, geom) Inverts a meaurement. Returns an array of state vector samples. Similar to Inversion.invert() but returns a list of samples. .. py:function:: Inversion(config, fm) Retrieves the correct Inversion model to initialize and returns