get_computed_diagnostic_helper#

rojak.orchestrator.lite_controller.get_computed_diagnostic_helper(context, diagnostics_from)[source]#

Build a function computing/loading a single diagnostic’s value by name

Parameters:
  • context (BaseTurbulenceContext) – Configuration describing the data to compute diagnostics from, or the directory to load precomputed diagnostics from

  • diagnostics_from (DiagnosticsFormat) – If FROM_MET_DATA, the returned function computes the diagnostic fresh from context’s meteorological data. If PRECOMPUTED_FROM_ZARR, it loads the diagnostic’s previously exported values from context.data_dir (see export_turbulence_diagnostics()).

Returns:

Function mapping a diagnostic name to its computed values

Return type:

Callable[[str], DataArray]