-
Notifications
You must be signed in to change notification settings - Fork 5
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
Multi file support #31
Comments
Hi! Indeed, this feature is not available in GRIBDatasets, and is not trivial to implement. Unfortunately, I don't have much time to work on this right know, but I can provide support if someone wants to get into it ! |
With JuliaGeo/CommonDataModel.jl@e630054 and GRIBDataset (4f13871), I got the following to work: using CommonDataModel: MFDataset
using GRIBDatasets
using Test
fnames = ["/mnt/data1/abarth/.julia/packages/GRIB/6rlik/test/samples/regular_latlon_surface.grib2",
"/mnt/data1/abarth/.julia/packages/GRIB/6rlik/test/samples/regular_latlon_surface.grib2"]
# open all grib data files
ds = GRIBDataset.(fnames)
# concatenate all files along the dimension named "valid_time"
mfds = MFDataset(ds,aggdim = "valid_time")
@test length(mfds["valid_time"]) == 2 It might also work with previous versions of GRIBDatasets, but I only tested for the current main version. Note that I used twice the same file. |
Sorry for my delay.
I have updated the libraries:
But with no luck. |
The change in CommonDataModel is not jet in a released version. Can you try again by installing the current main version of CommonDataModel from github?
Sorry if this was not clear. |
It works! I have tested it with grib files and also with NetCDF files (in this case, I have used "NCDataset()" instead of "GRIBDataset()"). And it works for both of them. I think this feature should be integrated into the Rasters and YAXArrays libraries. As a suggestion, perhaps it is appropriate that GRIBDataset() and NCDataset() are similar, so that, in the same manner that NCDataset() can load a list of files, so GRIBDataset() could do too. Additionally, it could be also useful to have one function in the CommonDataModel library that can load either gribs of NetCDFs. Its name could be CDataset(), or COMMONDataset(), or something like that. Thanks a lot! |
It seems that NCDatasets has multi-file support, aggregating different nc files. But this feature seems to be missing in GRIBDatasets, and it would be very nice to have it. Are you planning to incorporate this feature?
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: