From dc6f91bcf388172fe2b78126b96b691d2d2db584 Mon Sep 17 00:00:00 2001 From: Robert Gieseke Date: Fri, 13 Dec 2024 10:52:31 +0100 Subject: [PATCH] Add time dimension on SSA tas output Needed so ncview can plot graph. Fixes #114 --- attrici/ssa.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/attrici/ssa.py b/attrici/ssa.py index 35027ec..f6b4644 100644 --- a/attrici/ssa.py +++ b/attrici/ssa.py @@ -16,8 +16,11 @@ def ssa(filename, variable, window_size, subset, output): ) output_dataset = xr.Dataset( - data_vars={variable: ssa_values}, - coords={"time": ssa_times}, + data_vars={ + variable: xr.DataArray( + ssa_values, coords={"time": ssa_times}, dims=("time",) + ) + }, attrs=get_data_provenance_metadata( input_file=Path(filename).name, subset=subset,