DiagnosticSuite#
- class rojak.turbulence.diagnostic.DiagnosticSuite(_factory, _diagnostics)[source]#
A collection of computed turbulence diagnostics
The diagnostics can either be freshly computed via a
DiagnosticFactory, or reloaded from anxarray.Dataset(e.g. as read back from zarr byload_from_zarr()) containing already-computed values.- Parameters:
_factory (DiagnosticFactory | Dataset)
_diagnostics (list[TurbulenceDiagnostics])
- __init__(_factory, _diagnostics)[source]#
- __init__(factory, diagnostics)
- __init__(factory, diagnostics)
- Parameters:
_factory (DiagnosticFactory | Dataset) – Either a
DiagnosticFactoryto compute_diagnosticsfrom, or a Dataset of already-computed diagnostic values_diagnostics (list[TurbulenceDiagnostics]) – Turbulence diagnostics to include in the suite
- Raises:
TypeError – If
_factoryis not aDiagnosticFactoryorxarray.Dataset- Return type:
None
Methods
__init__()as_dataset()Combine every diagnostic's computed value into a single Dataset
computed_values(progress_description)Iterate over the name and computed value of each diagnostic in the suite
computed_values_as_dict()Same as
computed_values(), collected eagerly into a dict (without a progress bar)diagnostic_names()Names of the diagnostics in the suite
export_as_zarr(output_path, /, *[, zarr_format])Export every diagnostic's computed value (see
as_dataset()) to a zarr storeget_prototype_computed_diagnostic()An arbitrary diagnostic's computed value, used where any one diagnostic's shape/coords will do
load_from_zarr(path, target_diagnostics, *)Construct a
DiagnosticSuitefrom a zarr store of previously-exported diagnostic values