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 viacompute_thresholds(), or EDR distribution parameters viacompute_distribution_parameters()) or loads a previously computed result from file, perTurbulenceCalibrationConfig.- Parameters:
phases (TurbulenceCalibrationPhases)
spatial_domain (SpatialDomain)
output_dir (Path)
name (RunName)
start_time (TimeStr)
- __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_dirstart_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
suiteand export itcreate_diagnostic_suite(diagnostics, chunks)Load the calibration data and compute
diagnosticsfrom itexport_distribution_parameters(...)Export computed distribution histograms to a JSON file under
self._output_dir / self._nameexport_thresholds(diagnostic_thresholds)Export computed thresholds to a JSON file under
self._output_dir / self._namelaunch(diagnostics, chunks)Run every configured calibration phase
load_distribution_parameters_from_file()Load previously computed distribution histograms from
diagnostic_distribution_file_pathload_thresholds_file()Load previously computed severity thresholds from
thresholds_file_pathperform_calibration(suite)Compute severity thresholds for every diagnostic in
suiteand export themrun_phase(current_phase, suite)Run a single calibration phase, either loading its result from file or computing it from
suite