pyradtran.interface.execute_simulation_batch

pyradtran.interface.execute_simulation_batch#

pyradtran.interface.execute_simulation_batch(config: SimulationConfig, input_ds: Dataset, params: Dict[str, Any] | None = None, time_var: str = 'time', lat_var: str = 'latitude', lon_var: str = 'longitude', albedo_var: str | None = None, surface_temperature_var: str | None = None, surface_type_var: str | None = None, altitude_var: str | None = None, era5_atmosphere: Dataset | None = None, era5_clouds: bool | Dict[str, Any] = False, parameter_overrides: Dict[str, Any] | None = None, progress_callback: callable | None = None, cloud_wc_var: str | None = None, cloud_ic_var: str | None = None, cloud_reff_var: str | None = None, cloud_ic_reff_var: str | None = None, cloud_top_var: str | None = None, cloud_bottom_var: str | None = None, show_progress: bool = True, return_outcomes: bool = False) List[ParsedOutput | None][source]#

Run uvspec in parallel for every point in input_ds.

The input dataset is flattened (stacked) over all its dimensions so that each combination of coordinates becomes one simulation. Results are returned in the same flat order, ready for convert_batch().

Parameters:
  • config (SimulationConfig) – Merged configuration.

  • input_ds (xarray.Dataset) – Input coordinates (arbitrary number of dimensions).

  • params (dict, optional) – Unified parameter mapping: registry keys / raw uvspec keywords / dotted config paths to literal values or Var per-point dataset references. Preferred over the deprecated *_var and parameter_overrides kwargs below.

  • time_var (str) – Names of core coordinate variables.

  • lat_var (str) – Names of core coordinate variables.

  • lon_var (str) – Names of core coordinate variables.

  • albedo_var (str, optional) – Deprecated — use params={"albedo": Var(...)}.

  • surface_temperature_var (str, optional) – Deprecated — use params={"sur_temperature": Var(...)}.

  • surface_type_var (str, optional) – Deprecated — use params={"brdf_rpv_type": Var(...)}.

  • altitude_var (str, optional) – Deprecated — use params={"zout": Var(...)}.

  • era5_atmosphere (xarray.Dataset, optional) – ERA5 dataset for atmosphere file generation. Accepts raw CDS or ARCO-ERA5 naming — it is normalised via pyradtran.era5.normalize_era5() before use. When an ozone profile (o3) is present it is written into the radiosonde file and the config ozone_du scaling is skipped.

  • era5_clouds (bool or dict, default False) – When truthy, additionally derive per-point wc_file / ic_file cloud profiles from the ERA5 clwc / ciwc fields. A dict is forwarded as keyword arguments to pyradtran.era5.cloud_profiles() (e.g. {"reff_water_um": 8.0}). Explicit cloud parameters (params or the cloud_*_var kwargs) take precedence for points where both are present. Requires era5_atmosphere.

  • parameter_overrides (dict, optional) – Deprecated — use params instead.

  • progress_callback (callable, optional) – callback(current, total) invoked after each simulation.

  • show_progress (bool, default True) – Show a tqdm progress bar. Set to False to suppress it (e.g. when running inside a rendered Jupyter notebook).

  • return_outcomes (bool, default False) – When True, return the full list of PointOutcome (status codes + failure detail) instead of bare parsed outputs.

  • cloud_wc_var (str, optional) – Dataset variables for liquid / ice water content.

  • cloud_ic_var (str, optional) – Dataset variables for liquid / ice water content.

  • cloud_reff_var (str, optional) – Effective-radius variables.

  • cloud_ic_reff_var (str, optional) – Effective-radius variables.

  • cloud_top_var (str, optional) – Cloud-boundary variables (km). Required when cloud_wc_var or cloud_ic_var is set.

  • cloud_bottom_var (str, optional) – Cloud-boundary variables (km). Required when cloud_wc_var or cloud_ic_var is set.

Notes

When execution.max_workers is 1, points run serially in-process (no process pool); None or >1 uses a process pool.

A failures_<YYYYmmdd_HHMMSS>.log file is written to config.paths.working_dir whenever at least one point fails, with one block per failure (point id, status, and detail/stderr).

Returns:

One entry per flattened input point. None for failed runs. When return_outcomes is True, a list of PointOutcome instead.

Return type:

list of ParsedOutput or None

Raises:

PyRadtranError – If all simulations fail.