pyradtran.params.ParamResolver#

class pyradtran.params.ParamResolver(config, params: Dict[str, Any] | None = None, schema: Any = 'auto')[source]#

Bases: object

Resolve a user params mapping into validated per-point values.

Responsibilities:

  • Apply and consume dotted config overrides ("simulation_defaults.albedo_value") onto config — they never reach the uvspec input file.

  • Split remaining entries into literals (validated immediately) and Var references (validated per point).

  • Tag every value with its provenance.

Parameters:
  • config (SimulationConfig) – Mutated in place by dotted keys.

  • params (dict, optional) – Mapping of registry keys / raw uvspec keywords to literal values or Var references.

Raises:

ValidationError – If any literal value fails its registry validation. All offending keys are reported in one exception.

__init__(config, params: Dict[str, Any] | None = None, schema: Any = 'auto')[source]#
resolve_point(point_ds)[source]#

Resolve all parameters for one stacked point.

Parameters:

point_ds (xarray.Dataset) – A single point (0-d variables), as produced by stacked_ds.isel({sample_dim: i}).

Returns:

  • resolved (dict) – key -> (value, provenance) merged from literals and per-point references.

  • skipped (list of str) – Keys omitted for this point because the dataset value was NaN.

static_params() Dict[str, Tuple[Any, str]][source]#

Return key -> (value, provenance) for point-independent values.

validate_var_targets(ds) None[source]#

Check every Var target (and hijack-suspects) against ds.

Raises:

ValidationError – If a Var names a variable missing from ds, or if a bare string literal matches a dataset variable name (ambiguous — the user almost certainly meant Var).