curepy.container.retrieval_input module#

Container for all retrieval inputs

class curepy.container.retrieval_input.RetrievalInput(measurement_function_obj: MeasurementFunction | None = None, measurement_obj: Measurement | None = None, ancillary_obj: AncillaryParameter | None = None, prior_obj: Prior | None = None)[source]#

Bases: object

build_ancillary(b: list | None = None, u_b: list | None = None, corr_b: list | None = None, corr_between_b: Any | None = None, b_samples: Any | None = None, b_MC_steps: int | None = None) None[source]#

Construct ancillary_obj from ancillary parameter data.

Parameters:
  • b – Ancillary parameter values.

  • u_b – Uncertainties for the ancillary parameters.

  • corr_b – Correlation specification for each ancillary parameter.

  • corr_between_b – Correlation matrix between ancillary parameters.

  • b_samples – Pre-generated MC samples for ancillary parameters.

  • b_MC_steps – Number of MC steps for ancillary parameter sampling.

build_from_obsarray(obs_ds: Any, y_name: str, measurement_func: Callable, initial_guess: Any, b_name: List[str] | None = None, multiple_guess_measurements: bool = False, input_quantities_names: str | List[str] = None, prior_shape: List[str] = None, prior_params: List[dict] = [{}], prior_correlation: Any | None = None, b_samples: Any | None = None, b_MC_steps: int | None = None) None[source]#

Construct all retrieval input sub-objects from an obsarray dataset.

The measurement variable, uncertainty, and error-correlation are read directly from the dataset. Ancillary parameters are optionally sourced from the same dataset by name.

Parameters:
  • obs_dsobsarray dataset containing measurement and ancillary variables with associated uncertainty information.

  • y_name – Name of the measurement variable in obs_ds.

  • measurement_func – Callable measurement/forward-model function.

  • initial_guess – Initial values for the retrieval parameters.

  • b_name – List of ancillary parameter variable names in obs_ds, or None if no ancillary parameters are used.

  • multiple_guess_measurements – If True, the initial guess contains multiple measurements per parameter.

  • input_quantities_names – Optional name(s) for input quantities.

  • prior_shape – List of prior distribution shape names.

  • prior_params – List of prior parameter dictionaries.

  • prior_correlation – Correlation matrix for the prior.

  • b_samples – Pre-generated MC samples for ancillary parameters.

  • b_MC_steps – Number of MC steps for ancillary parameter sampling.

build_measurement(y: Any, u_y_total: Any | None = None, u_y_rand: Any | None = None, u_y_syst: Any | None = None, corr_y: str | Any | None = None) None[source]#

Construct measurement_obj from measurement data.

Parameters:
  • y – Measurement variable.

  • u_y_total – Total uncertainty of the measurement variable.

  • u_y_rand – Random uncertainty of the measurement variable.

  • u_y_syst – Systematic uncertainty of the measurement variable.

  • corr_y – Error-correlation of the measurement variable (None, "rand", "syst", or a square matrix).

build_measurement_function(measurement_func: Callable, initial_guess: Any, multiple_guess_measurements: bool = False, measurement_name: str = None, input_quantities_names: str | List[str] = None) None[source]#

Construct measurement_function_obj from individual components.

Parameters:
  • measurement_func – Callable measurement/forward-model function.

  • initial_guess – Initial values for the retrieval parameters.

  • multiple_guess_measurements – If True, the initial guess contains multiple measurements per parameter.

  • measurement_name – Optional name for the measured quantity.

  • input_quantities_names – Optional name(s) for input quantities.

build_prior(prior_shape: List[str] = None, prior_params: List[dict] = [{}], prior_correlation: Any | None = None) None[source]#

Construct prior_obj from prior distribution specifications.

Parameters:
  • prior_shape – List of prior distribution shape names.

  • prior_params – List of prior parameter dictionaries.

  • prior_correlation – Correlation matrix for the prior.

build_retrieval_inputs(measurement_func: Callable, initial_guess: Any, y: Any, u_y_total: Any | None = None, u_y_rand: Any | None = None, u_y_syst: Any | None = None, corr_y: str | Any | None = None, multiple_guess_measurements: bool = False, measurement_name: str = None, input_quantities_names: str | List[str] = None, prior_shape: List[str] = None, prior_params: List[dict] = [{}], prior_correlation: Any | None = None, b: list | None = None, u_b: list | None = None, corr_b: list | None = None, corr_between_b: Any | None = None, b_samples: Any | None = None, b_MC_steps: int | None = None) None[source]#

Construct all retrieval input sub-objects in a single call.

Parameters:
  • measurement_func – Callable measurement/forward-model function.

  • initial_guess – Initial values for the retrieval parameters.

  • y – Measurement variable.

  • u_y_total – Total uncertainty of the measurement variable.

  • u_y_rand – Random uncertainty of the measurement variable.

  • u_y_syst – Systematic uncertainty of the measurement variable.

  • corr_y – Error-correlation of the measurement variable (None, "rand", "syst", or a square matrix).

  • multiple_guess_measurements – If True, the initial guess contains multiple measurements per parameter.

  • measurement_name – Optional name for the measured quantity.

  • input_quantities_names – Optional name(s) for input quantities.

  • prior_shape – List of prior distribution shape names.

  • prior_params – List of prior parameter dictionaries.

  • prior_correlation – Correlation matrix for the prior.

  • b – Ancillary parameter values.

  • u_b – Uncertainties for the ancillary parameters.

  • corr_b – Correlation specification for each ancillary parameter.

  • corr_between_b – Correlation matrix between ancillary parameters.

  • b_samples – Pre-generated MC samples for ancillary parameters.

  • b_MC_steps – Number of MC steps for ancillary parameter sampling.