CalibrationStage#

class rojak.orchestrator.turbulence.CalibrationStage(phases, spatial_domain, output_dir, name, start_time)[source]#

Runs the turbulence calibration stage

For each configured TurbulenceCalibrationPhaseOption, either computes the result from a calibration dataset (thresholds via compute_thresholds(), or EDR distribution parameters via compute_distribution_parameters()) or loads a previously computed result from file, per TurbulenceCalibrationConfig.

Parameters:
__init__(phases, spatial_domain, output_dir, name, start_time)[source]#
Parameters:
  • phases (TurbulenceCalibrationPhases) – Which calibration phases to run, and their configuration

  • spatial_domain (SpatialDomain) – Spatial (and optionally vertical) domain to restrict calibration data to

  • output_dir (Path) – Base directory to export phase results into

  • name (RunName) – Name of this run, used to namespace exported files under output_dir

  • start_time (TimeStr) – Timestamp identifying this run, used to name exported files

Return type:

None

Methods

__init__(phases, spatial_domain, output_dir, ...)

compute_distribution_parameters(suite)

Compute the log-normal distribution histogram for every diagnostic in suite and export it

create_diagnostic_suite(diagnostics, chunks)

Load the calibration data and compute diagnostics from it

export_distribution_parameters(...)

Export computed distribution histograms to a JSON file under self._output_dir / self._name

export_thresholds(diagnostic_thresholds)

Export computed thresholds to a JSON file under self._output_dir / self._name

launch(diagnostics, chunks)

Run every configured calibration phase

load_distribution_parameters_from_file()

Load previously computed distribution histograms from diagnostic_distribution_file_path

load_thresholds_file()

Load previously computed severity thresholds from thresholds_file_path

perform_calibration(suite)

Compute severity thresholds for every diagnostic in suite and export them

run_phase(current_phase, suite)

Run a single calibration phase, either loading its result from file or computing it from suite