Lite Controller (rojak.orchestrator.lite_controller)#

Business logic behind the rojak lite turbulence commands

Each public function here implements one step of the low-memory, step-by-step turbulence workflow driven by rojak.cli.lite_interface: computing diagnostic distribution parameters (compute_distribution_parameters()), severity thresholds (compute_thresholds()), exporting raw diagnostic values (export_turbulence_diagnostics()), converting diagnostics into an ensemble EDR (compute_and_export_ensemble_edr()), and computing correlation between thresholded diagnostics (correlation_between_diagnostics()). Diagnostic values are obtained either by computing them fresh from meteorological data, or by loading them back from a previous export_turbulence_diagnostics() run (see DiagnosticsFormat and get_computed_diagnostic_helper()).

Functions

blocking_wait_futures(dask_collection)

Block until every dask future backing dask_collection has completed

compute_and_export_ensemble_edr(context, /, ...)

Convert every diagnostic configured in context into EDR and export the ensemble-mean result

compute_distribution_parameters(context, /, ...)

Compute and export the log-normal distribution parameters of every diagnostic configured in context

compute_thresholds(context, /, diagnostics_from)

Compute and export percentile-based severity thresholds for every diagnostic configured in context

correlation_between_diagnostics(context, *, ...)

Compute the Matthew's Correlation Coefficient between every pair of diagnostics, thresholded at severities

create_diagnostic_dataset(context, /, ...)

Combine every diagnostic configured in context into a single Dataset

export_json(obj_to_dump, output_dir, ...[, ...])

Serialise obj_to_dump to a timestamped JSON file under output_dir

export_turbulence_diagnostics(context, *, ...)

Compute every diagnostic configured in context from meteorological data and export each to its own zarr store

get_computed_diagnostic_helper(context, ...)

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

load_distribution_parameters_from_file(file_path)

Load a mapping of diagnostic name to DistributionParameters from JSON

load_thresholds_from_file(file_path)

Load a mapping of diagnostic name to TurbulenceThresholds from JSON