JuliaDataCubes / YAXArrays.jl

Yet Another XArray-like Julia package
https://juliadatacubes.github.io/YAXArrays.jl/
Other
89 stars 12 forks source link

Opening a set of NetCDF fails #365

Open Sonicious opened 5 months ago

Sonicious commented 5 months ago

Opening a set of NetCDF results in error through multiple ways:

using YAXArrays, NetCDF

filelist = readdir("Path/to/NetCDF/directory", join = true)
Cube = YAXArrays.Datasets.open_mfdataset(filelist) # ERROR: KeyError: key :Ti not found
using YAXArrays, NetCDF
filelist = readdir("Path/to/NetCDF/directory", join = true)
cubes = Cube.(filelist)
cat(cubes...,dims=Ti) # ERROR: TypeError: in keyword argument dims, expected Int64, got a value of type Tuple{Int64}

Is there a way to use a bunch of netcdf and open them? Is there an alternative way to convert these to a zarr archive?

felixcremer commented 5 months ago

On what version of DiskArrays are you? With DiskArrays master the last version should work.

Sonicious commented 5 months ago

According to Manifest.toml I use version = "0.3.22" which is the latest release coupled with YAXArrays 0.5.3

felixcremer commented 5 months ago

Yes, we need to tag a new DiskArrays release.

felixcremer commented 5 months ago

With DiskArrays 0.3.23 cat should work.

Sonicious commented 5 months ago

In case of cat(cubes...,dims=Ti) I now get ERROR: KeyError: key :Ti not found

  [3c3547ce] DiskArrays v0.3.23
  [30363a11] NetCDF v0.11.7
  [c21b50f5] YAXArrays v0.5.3
  [0a941bbe] Zarr v0.9.1
julia> using YAXArrays, NetCDF
julia> filelist = readdir("D:\\LAI\\LAI_AVHRR", join = true);
julia> cubes = Cube.(filelist);
julia> cat(cubes...,dims=Ti)
ERROR: UndefVarError: `Ti` not defined
Stacktrace:
 [1] top-level scope
   @ REPL[22]:1