Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,25 @@ def process_data(
if exp["moc"] != "":
ohc_variable = Variable("ohc")
dataset_wrapper = DatasetWrapper(exp["moc"])
exp["annual"]["ohc"], _ = dataset_wrapper.globalAnnual(ohc_variable)
ohc_data_array, _ = dataset_wrapper.globalAnnual(ohc_variable)
exp["annual"]["ohc"] = ohc_data_array
# Populate year key if not already present
if "year" not in exp["annual"]:
years = ohc_data_array.coords["time"].values
exp["annual"]["year"] = [x.year for x in years]
# anomalies with respect to first year
exp["annual"]["ohc"][:] = exp["annual"]["ohc"][:] - exp["annual"]["ohc"][0]

logger.info("Reading vol")
if exp["vol"] != "":
vol_variable = Variable("volume")
dataset_wrapper = DatasetWrapper(exp["vol"])
exp["annual"]["volume"], _ = dataset_wrapper.globalAnnual(vol_variable)
vol_data_array, _ = dataset_wrapper.globalAnnual(vol_variable)
exp["annual"]["volume"] = vol_data_array
# Populate year key if not already present
if "year" not in exp["annual"]:
years = vol_data_array.coords["time"].values
exp["annual"]["year"] = [x.year for x in years]
# annomalies with respect to first year
exp["annual"]["volume"][:] = (
exp["annual"]["volume"][:] - exp["annual"]["volume"][0]
Expand Down
Loading