-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration of CommonDataModel sources (#416)
* adapt ncdatasets source for commondatamodel * rename sources/ncdatasets.jl * fix for lazy = false in stack * cf attributes * Conflicts: src/Rasters.jl src/sources/commondatamodel.jl test/runtests.jl * reorganize project * move writing code to ncdatasets_source * fix error if dim not a coordinate * small fixes * issue with building dims for variables * fix grid mapping * comments in test * diskarray wrapper for CFVariable * update compat for NCDatasets * update readme * update GRIBDatasets compat * skip GRIBDatasets test on windows
- Loading branch information
Showing
12 changed files
with
684 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module RastersGRIBDatasetsExt | ||
|
||
@static if isdefined(Base, :get_extension) # julia < 1.9 | ||
using Rasters, GRIBDatasets, CommonDataModel | ||
else | ||
using ..Rasters, ..GRIBDatasets, ..CommonDataModel | ||
end | ||
|
||
import DiskArrays, | ||
FillArrays, | ||
Extents, | ||
GeoInterface, | ||
Missings | ||
|
||
using Dates, | ||
DimensionalData, | ||
GeoFormatTypes | ||
|
||
using Rasters.LookupArrays | ||
using Rasters.Dimensions | ||
using Rasters: GRIBsource | ||
|
||
using CommonDataModel: AbstractDataset | ||
|
||
const RA = Rasters | ||
const DD = DimensionalData | ||
const DA = DiskArrays | ||
const GI = GeoInterface | ||
const LA = LookupArrays | ||
|
||
include("gribdatasets_source.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const GDS = GRIBDatasets | ||
|
||
RA.FileStack{GRIBsource}(ds::AbstractDataset, filename::AbstractString; write=false, keys) = RA.FileStack(GRIBsource, ds, filename; write, keys) | ||
|
||
function RA.OpenStack(fs::RA.FileStack{GRIBsource,K}) where K | ||
RA.OpenStack{GRIBsource,K}(GDS.GRIBDataset(RA.filename(fs))) | ||
end | ||
|
||
# In GRIBDatasets, the file is open for reading the values and closed afterwards. | ||
Base.close(os::RA.OpenStack{GRIBsource}) = nothing | ||
|
||
function RA._open(f, ::Type{GRIBsource}, filename::AbstractString; write=false, kw...) | ||
isfile(filename) || _filenotfound_error(filename) | ||
ds = GRIBDatasets.GRIBDataset(filename) | ||
RA._open(f, GRIBsource, ds; kw...) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.