Skip to content
Snippets Groups Projects
Commit fe2b0c2b authored by Nils Brüggemann's avatar Nils Brüggemann Committed by Fraser William Goldsworth
Browse files

pyic_anim.py: Not existing directory for figures and animation will be created...

pyic_anim.py: Not existing directory for figures and animation will be created if it does not exist. Open multiples netcdf files without any mfdset_kwargs if opening with them fails.
parent 806de596
No related branches found
No related tags found
1 merge request!42Draft: cartopy projections
......@@ -191,6 +191,10 @@ def str_to_array(string):
array = np.array(string.split(','), dtype=float)
return array
path = os.path.dirname(iopts.fpath_out)
if not os.path.exists(path):
os.makedirs(path)
if not iopts.only_animation:
if iopts.cmap.startswith('cmo.'):
import cmocean
......@@ -227,11 +231,15 @@ if not iopts.only_animation:
compat='override', join='override', parallel=True)
ds = xr.open_mfdataset(flist, **mfdset_kwargs)
except:
print('open_mfdset: parallel=True did not work, try without.')
mfdset_kwargs = dict(combine='nested', concat_dim='time',
data_vars='minimal', coords='minimal',
compat='override', join='override')
ds = xr.open_mfdataset(flist, **mfdset_kwargs)
try:
print('open_mfdset: parallel=True did not work, try without.')
mfdset_kwargs = dict(combine='nested', concat_dim='time',
data_vars='minimal', coords='minimal',
compat='override', join='override')
ds = xr.open_mfdataset(flist, **mfdset_kwargs)
except:
print('open_mfdset: mfdset options did not work, trying without...')
ds = xr.open_mfdataset(flist)
data = ds[iopts.var]
data = data.assign_attrs(uuidOfHGrid=ds.attrs['uuidOfHGrid'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment