-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: dataset over multiple NetCDF files. #461
Comments
There is an undocumented function: YAXArrays.jl/src/DatasetAPI/Datasets.jl Line 335 in 04aaaad
and YAXArrays.jl/src/DatasetAPI/Datasets.jl Line 945 in 04aaaad
I do not remember exactly how to use it, something along the lines of:
|
Yes I've used it successfully too 😃 I think it ought to be documented though, right? |
Is there a for example, in Python I can do: import xarray as xr
import numpy as np
def preprocessing(ds):
time_str = os.path.basename(ds.encoding['source']).split('_')[0:2] # get year and month from filename
time_str.append('01') # add a hardcoded day to list of time
time_str = "-".join(time_str) # create a single date string
ds['time'] = np.datetime64(time_str, 'ns') # assign to dataset ds
ds = ds.set_coords('time') # specify time as a coordinate
return ds
ds_crps = xr.open_mfdataset(list_of_files, concat_dim='time', combine='nested', preprocess = preprocessing) |
How does one open a dataset spread over multiple files (like with xarray's
open_mfdataset
function)?The text was updated successfully, but these errors were encountered: