Skip to content

RasterStack() fails to load grib files #964

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

Open
aasdelat opened this issue May 6, 2025 · 1 comment · May be fixed by #966
Open

RasterStack() fails to load grib files #964

aasdelat opened this issue May 6, 2025 · 1 comment · May be fixed by #966
Labels
bug Something isn't working

Comments

@aasdelat
Copy link

aasdelat commented May 6, 2025

RasterStack() fails to load grib files. It used to work well, but now it does not. Perhaps after an update.

Using Rasters
ds = RasterStack("ERA5_N320_1h_sl_sfc_NH15S_1980-12-01_1980-12-31_msl.grib", lazy=true)
ERROR: MethodError: no method matching Union{Nothing, Float64}(::Nothing)
The type `Union{Nothing, Float64}` exists, but no method is defined for this combination of argument types when trying to construct it.
Stacktrace:
  [1] _missingval(var::GRIBDatasets.Variable{Float64, 1, Vector{Float64}, GRIBDatasets.GRIBDataset{Float64, 2, Missing}})
    @ RastersGRIBDatasetsExt ~/.julia/packages/Rasters/mJsGi/ext/RastersGRIBDatasetsExt/gribdatasets_source.jl:27
  [2] missingval(var::GRIBDatasets.Variable{…}, ::DimensionalData.Dimensions.Lookups.Metadata{…})
    @ RastersGRIBDatasetsExt ~/.julia/packages/Rasters/mJsGi/ext/RastersGRIBDatasetsExt/gribdatasets_source.jl:21
  [3] (::Base.var"#4#5"{})(a::Tuple{…})
    @ Base ./generator.jl:37
  [4] iterate
    @ ./generator.jl:48 [inlined]
  [5] collect(itr::Base.Generator{Base.Iterators.Zip{Tuple{Vector{}, Vector{}}}, Base.var"#4#5"{typeof(missingval)}})
    @ Base ./array.jl:791
  [6] map(f::Function, it::Vector{…}, iters::Vector{…})
    @ Base ./abstractarray.jl:3495
  [7] RasterStack(ds::GRIBDatasets.GRIBDataset{…}; filename::String, source::Rasters.GRIBsource, dims::Rasters.NoKW, refdims::Tuple{}, name::Rasters.NoKW, group::Rasters.NoKW, metadata::Rasters.NoKW, layermetadata::Rasters.NoKW, layerdims::Rasters.NoKW, missingval::Rasters.NoKW, crs::Rasters.NoKW, mappedcrs::Rasters.NoKW, coerce::Rasters.NoKW, checkmem::Bool, scaled::Bool, lazy::Bool, verbose::Bool, raw::Bool, kw::@Kwargs{})
    @ Rasters ~/.julia/packages/Rasters/mJsGi/src/stack.jl:491
  [8] (::Rasters.var"#121#124"{})(ds::GRIBDatasets.GRIBDataset{…})
    @ Rasters ~/.julia/packages/Rasters/mJsGi/src/stack.jl:436
  [9] _open(f::Rasters.var"#121#124"{}, source::Rasters.GRIBsource, ds::GRIBDatasets.GRIBDataset{…}; name::Rasters.NoKW, group::Nothing, mod::Rasters.NoMod{…}, kw::@Kwargs{})
    @ Rasters ~/.julia/packages/Rasters/mJsGi/src/sources/commondatamodel.jl:87
 [10] _open(f::Function, source::Rasters.GRIBsource, ds::GRIBDatasets.GRIBDataset{Float64, 2, Missing})
    @ Rasters ~/.julia/packages/Rasters/mJsGi/src/sources/commondatamodel.jl:79
 [11] _open(f::Function, source::Rasters.GRIBsource, filename::String; write::Bool, kw::@Kwargs{})
    @ Rasters ~/.julia/packages/Rasters/mJsGi/src/sources/commondatamodel.jl:77
 [12] _open
    @ ~/.julia/packages/Rasters/mJsGi/src/sources/commondatamodel.jl:74 [inlined]
 [13] #_open#21
    @ ~/.julia/packages/Rasters/mJsGi/src/sources/sources.jl:110 [inlined]
 [14] RasterStack(filename::String; lazy::Bool, dropband::Bool, raw::Bool, source::Rasters.NoKW, missingval::Rasters.NoKW, name::Rasters.NoKW, group::Rasters.NoKW, scaled::Rasters.NoKW, coerce::Rasters.NoKW, verbose::Bool, replace_missing::Rasters.NoKW, kw::@Kwargs{})
    @ Rasters ~/.julia/packages/Rasters/mJsGi/src/stack.jl:435
 [15] RasterStack(filename::String)
    @ Rasters ~/.julia/packages/Rasters/mJsGi/src/stack.jl:400
 [16] top-level scope
    @ REPL[21]:1
Some type information was truncated. Use `show(err)` to see complete types.
Julia Version 1.11.5
Commit 760b2e5b739 (2025-04-14 06:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × AMD Ryzen 9 7950X 16-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver4)
Threads: 1 default, 0 interactive, 1 GC (on 32 virtual cores)
Environment:
  LD_LIBRARY_PATH = 
  JULIA_NUM_THREADS = 1

Status `~/.julia/environments/Rasters/Project.toml`
  [a3a2b9e3] Rasters v0.14.4

Also:
update Rasters
    Updating registry at `~/.julia/registries/General.toml`
ERROR: Unsatisfiable requirements detected for package Statistics [10745b16]:
 Statistics [10745b16] log:
 ├─possible versions are: 1.11.0 - 1.11.1 or uninstalled
 └─restricted to versions 1.10.0 by an explicit requirement — no versions left
@aasdelat aasdelat added the bug Something isn't working label May 6, 2025
@tiemvanderdeure tiemvanderdeure linked a pull request May 7, 2025 that will close this issue
@tiemvanderdeure
Copy link
Collaborator

#695 broke this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants