Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions tripyview/sub_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def load_climatology(mesh, datapath, vname, mon=None, depth=None, depidx=False,
#___________________________________________________________________________
# see if longitude dimension needs to be periodically rolled so it agrees with
# the fesom2 mesh focus
lon = data.coords[coord_lon].values
lon = data.coords[coord_lon].values.copy()
if any(lon>mesh.focus+180.0) or any(lon<mesh.focus-180.0):
# identify rolling index
if any(lon>mesh.focus+180.0):
Expand Down Expand Up @@ -425,7 +425,7 @@ def load_climatology_uv(mesh, datapath, vnameu, vnamev, mon=None, depth=None, de
#___________________________________________________________________________
# see if longitude dimension needs to be periodically rolled so it agrees with
# the fesom2 mesh focus
lon = data.coords[coord_lon].values
lon = data.coords[coord_lon].values.copy()
if any(lon>mesh.focus+180.0) or any(lon<mesh.focus-180.0):
# identify rolling index
if any(lon>mesh.focus+180.0):
Expand Down
10 changes: 4 additions & 6 deletions tripyview/sub_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
message=r".*Large object of size \\d+\\.\\d+ detected in task graph.*")

import xarray as xr
from xarray.coding.times import encode_cf_datetime
from xarray.coding.cftimeindex import CFTimeIndex

import pandas as pd
Expand Down Expand Up @@ -397,7 +396,7 @@ def _preprocess(x, do_prec, transpose):
if (do_cftime): use_cftime=True

# Build decode_times argument correctly
decode_times = True
time_coder = xr.coders.CFDatetimeCoder(use_cftime=use_cftime)
decode_coords = False
if engine == 'netcdf4' :
engine_dict = dict({'engine' :'netcdf4' ,
Expand All @@ -416,8 +415,7 @@ def _preprocess(x, do_prec, transpose):
}})# load normal FESOM2 run file
engine_dict.update({'combine' :'by_coords' ,
'decode_coords' :decode_coords ,
'decode_times' :decode_times ,
'use_cftime' :use_cftime , })
'decode_times' :time_coder , })
#'combine' :'nested',
#'concat_dim' :'time'
#'compat' :'override', !!! ATTENTION DO NOT USE THAT OPTION it overrides concated years with NaNs!!!
Expand Down Expand Up @@ -1432,8 +1430,8 @@ def do_time_arithmetic(data, do_tarithm):
#___________________________________________________________________
# annual means
if do_tarithm in ['ymean', 'annual']:
# 'AS' = year-start based on original calendar
return data.resample(time='AS').mean(keep_attrs=True), str_atim
# 'YS' = year-start based on original calendar
return data.resample(time='YS').mean(keep_attrs=True), str_atim

#___________________________________________________________________
# monthly means
Expand Down
Loading