JuliaDataCubes / EarthDataLab.jl

Julia interface for Reading from the Earth System Datacube
http://earthsystemdatacube.net
Other
33 stars 14 forks source link

open .zarr file as a Cube fails #284

Closed lazarusA closed 1 year ago

lazarusA commented 1 year ago

Since I'm trying to open/load a Zarr file into a Cube, I'm opening this issue here, although it seems that this is related to DiskArrayTools.

using Zarr, YAXArrays
urlStore = "https://storage.de.cloud.ovh.net/v1/AUTH_84d6da8e37fe4bb5aea18902da8c1170/uc3/FireCube_time1_x1253_y983.zarr"
cube = Cube(urlStore)
#g = zopen(urlStore, consolidated=true)

outputs the error:

ERROR: MethodError: no method matching Union{Missing, Float32}(::Float64)
Stacktrace:
 [1] DiskArrayTools.CFDiskArray(a::ZArray{Union{Missing, Float32}, 3, Zarr.BloscCompressor, Zarr.ConsolidatedStore{Zarr.HTTPStore}}, attr::Dict{String, Any})
   @ DiskArrayTools ~/.julia/packages/DiskArrayTools/rEAgw/src/DiskArrayTools.jl:173
 [2] open_dataset(g::String; driver::Symbol)
   @ YAXArrays.Datasets ~/.julia/packages/YAXArrays/Ly8sc/src/DatasetAPI/Datasets.jl:211
 [3] open_dataset
   @ ~/.julia/packages/YAXArrays/Ly8sc/src/DatasetAPI/Datasets.jl:181 [inlined]
 [4] #Cube#75
   @ ~/.julia/packages/YAXArrays/Ly8sc/src/DatasetAPI/Datasets.jl:432 [inlined]
 [5] Cube(s::String)
   @ YAXArrays.Datasets ~/.julia/packages/YAXArrays/Ly8sc/src/DatasetAPI/Datasets.jl:432
 [6] top-level scope

doing

g = zopen(urlStore, consolidated=true)

works.

felixcremer commented 1 year ago

This seems to be a problem in the handling of missing values in DiskArrayTools. I added a pull request to DiskArrayTools.jl with which your example cube is opened.

lazarusA commented 1 year ago

wow! yes. This seems to work. I can open and download the data successfully with that PR.

lazarusA commented 1 year ago

I'm still getting this issue on the latest release. The issue on DiskArraysTools is still open. https://github.com/meggart/DiskArrayTools.jl/pull/10

lazarusA commented 1 year ago

I just tested again these examples. I'm still getting the same error as before:

ArgumentError: invalid index: nothing of type Nothing
(tmp) pkg> st
Status `~/Documents/tmp/Project.toml`
  [fcd2136c] DiskArrayTools v0.1.6 `https://github.com/meggart/DiskArrayTools.jl.git#master`
  [c21b50f5] YAXArrays v0.4.3 `https://github.com/JuliaDataCubes/YAXArrays.jl.git#master`
  [0a941bbe] Zarr v0.8.0