skretrieval.retrieval.scipy.SciPyMinimizer

skretrieval.retrieval.scipy.SciPyMinimizer#

class skretrieval.retrieval.scipy.SciPyMinimizer(method='trf', max_nfev=20, ftol=0.001, xtol=1e-36, x_scale='jac', tr_solver='exact', apply_state_scaling=False, include_bounds=False, num_passes=1, **kwargs)[source]#

Bases: Minimizer

A minimization wrapper around Scipy’s least_squares function

Parameters:
  • method (str, optional) – Minimization method, see scipy.least_squares, by default “trf”. Recommended to only use “lm” or “trf”.

  • max_nfev (int, optional) – Maximum function evalations, see scipy.least_squares, by default 20

  • ftol (_type_, optional) – Tolerance on the cost function, see sci, by default 1e-3

  • xtol (_type_, optional) – Tolerance on the change in state, by default 1e-36

  • x_scale (str, optional) – Internal scaling applyed by the minimizer, by default “jac”

  • tr_solver (str, optional) – For the “trf” method, how to solve the trust region problem, by default “exact”

  • apply_state_scaling (bool, optional) – If true, then the state vector is scaled relative to the apriori in the solver, useful when the state vector elements are of largely varying magnitudes and you have a well specified prior, by default False

  • include_bounds (bool, optional) – If true, then bounds are included inside the solver. Only has an effect weth method is “trf”, by default False

  • num_passes (int, optional) – Number of passes to do through the minimizer. After each pass the noise covariance is adjusted where measurements with large residuals are given less weight on the next pass, by default 1

__init__(method='trf', max_nfev=20, ftol=0.001, xtol=1e-36, x_scale='jac', tr_solver='exact', apply_state_scaling=False, include_bounds=False, num_passes=1, **kwargs) None[source]#

A minimization wrapper around Scipy’s least_squares function

Parameters:
  • method (str, optional) – Minimization method, see scipy.least_squares, by default “trf”. Recommended to only use “lm” or “trf”.

  • max_nfev (int, optional) – Maximum function evalations, see scipy.least_squares, by default 20

  • ftol (_type_, optional) – Tolerance on the cost function, see sci, by default 1e-3

  • xtol (_type_, optional) – Tolerance on the change in state, by default 1e-36

  • x_scale (str, optional) – Internal scaling applyed by the minimizer, by default “jac”

  • tr_solver (str, optional) – For the “trf” method, how to solve the trust region problem, by default “exact”

  • apply_state_scaling (bool, optional) – If true, then the state vector is scaled relative to the apriori in the solver, useful when the state vector elements are of largely varying magnitudes and you have a well specified prior, by default False

  • include_bounds (bool, optional) – If true, then bounds are included inside the solver. Only has an effect weth method is “trf”, by default False

  • num_passes (int, optional) – Number of passes to do through the minimizer. After each pass the noise covariance is adjusted where measurements with large residuals are given less weight on the next pass, by default 1

Methods

__init__([method, max_nfev, ftol, xtol, ...])

A minimization wrapper around Scipy's least_squares function

retrieve(measurement_l1, forward_model, ...)

retrieve(measurement_l1: RadianceBase, forward_model: ForwardModel, retrieval_target: RetrievalTarget)[source]#
Parameters:
  • measurement_l1 (RadianceBase) – The data we are trying to match, either from a real instrument or simulations.

  • forward_model (ForwardModel) – A model for the data in measurement_l1

  • retrieval_target (RetrievalTarget) – What we are trying to retrieve

Returns:

Various parameters specific to the minimizer

Return type:

dict