Closed wwieder closed 3 years ago
from @djk2120
Would something like this work? (might be too slow??)
import glob
path = .../*.h0.*.nc
da = xr.open_mfdataset(glob.glob(path),combine='by_coords')
I used the glob
module, because it seems to handle wildcards better than xarray itself.
da = xr.open_mfdataset(glob.glob(path),combine='by_coords')
glob.glob()
can return bizarre ordering (the sortedness of glob.glob's output is platform-dependent). Because of this, you may end up with a time coordinate that is not monotonic after the concatenation step. To be safe, you probably want to sort the output of glob.glob()
:
da = xr.open_mfdataset(sorted(glob.glob(path)),combine='by_coords')
This is now handled by import_ds()
.
We need to develop a script that handles concatenating a variable (or variables) from monthly history files for looking at results before they've been converted to single variable time series.