[ecco-support] (no subject)
Fanglou Liao
flch at udel.edu
Mon Aug 10 09:32:33 EDT 2020
Dear ECCO support
I was trying to use ecco-v4 python package for some calculations based on
ECCOv5 alpha. As I noticed that recursive_load_ecco_var_from_years_nc is
not working for ECCO v5 file format, I write a new function similar to it
and it can load the variables now. But when I run the
calc_section_heat_trsp_adv function, an error occurred:
ValueError: Coordinate k_p1 has invalid or missing `c_grid_axis_shift`
attribute `True`
I checked that but still couldn't solve it myself. could you please let me
know what needs to be done for a smooth application of ecco-v4.py for ECCO
v5?
Thank you very much,
Liao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/ecco-support/attachments/20200810/d52c4cb0/attachment.html
-------------- next part --------------
def load_ecco_var_13tiles(data_root_dir, vars_to_load):
g_all = []; varNO = 0;
Num = len(vars_to_load);
for nn in range(Num):
var_path = Path(data_root_dir + r'/' + vars_to_load[nn]);
files = list(var_path.glob('**/*nc'));
step = 0; g = [];
# a loop for one variable
for file in files: # loop for 13 tiles
g = xr.open_dataset(file, chunks = 270);
g=g.expand_dims({'i5':1});
g=g.transpose('i1','i2','i3','i4','i5');
if step == 0:
g0 = g;
else:
g = xr.concat((g0,g), dim = 'i5');
g0 = g;
step = step+1;
print('Done with loading: ' + vars_to_load[nn]);
# a loop for one variable
if varNO == 0:
g_all = g; del g;
else:
g_all = xr.merge((g_all,g),compat='override'); del g;
varNO = varNO+1;
return g_all
More information about the ecco-support
mailing list