-
Notifications
You must be signed in to change notification settings - Fork 18
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_mfdataset leads to UndefVarError:
diskstack not defined
#476
Comments
ohh... |
Thanks for the report. I was indeed a bit quick in merging this. There was a missing import and also another small bug for the case where the arrays were concatenated along a new dimension not yet present in the existing datasets. Should be fixed by #477 |
Yes, It works on my end with #477 newds = Cube(open_mfdataset(DD.DimArray(files[end-1:end],DD.Dim{:Year}(dates))))
╭──────────────────────────────────────────────────╮
│ 251×199×2×2 YAXArray{Union{Missing, Float64}, 4} │
├──────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────── dims ┐
↓ longitude Sampled{Float32} -80.0f0:0.1f0:-55.0f0 ForwardOrdered Regular Points,
→ latitude Sampled{Float32} 42.2f0:0.1f0:62.0f0 ForwardOrdered Regular Points,
↗ Year Sampled{Int64} 1:2 ForwardOrdered Regular Points,
⬔ Variable Categorical{String} ["tp", "tmean"] ReverseOrdered
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── metadata ┤
Dict{String, Any} with 1 entry:
"missing_value" => 1.0e32
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── loaded lazily ┤
data size: 1.52 MB However, the new dimension seems to fallback to integer values? dates
2-element Vector{DateTime}:
2020-11-01T00:00:00
2020-12-01T00:00:00
(tmp) > newds.Year
Year Sampled{Int64} ForwardOrdered Regular DimensionalData.Dimensions.Lookups.Points
wrapping: 1:2
(tmp) > collect(newds.Year)
╭──────────────────────────────╮
│ 2-element DimArray{Int64, 1} │
├──────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────── dims ┐
↓ Year Sampled{Int64} 1:2 ForwardOrdered Regular Points
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
1 1
2 2
Trying with a list of string also gives integer values: newds = Cube(open_mfdataset(DD.DimArray(files[end-1:end],DD.Dim{:Year}(["a", "b"]))))
╭──────────────────────────────────────────────────╮
│ 251×199×2×2 YAXArray{Union{Missing, Float64}, 4} │
├──────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────── dims ┐
↓ longitude Sampled{Float32} -80.0f0:0.1f0:-55.0f0 ForwardOrdered Regular Points,
→ latitude Sampled{Float32} 42.2f0:0.1f0:62.0f0 ForwardOrdered Regular Points,
↗ Year Sampled{Int64} 1:2 ForwardOrdered Regular Points,
⬔ Variable Categorical{String} ["tp", "tmean"] ReverseOrdered
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── metadata ┤
Dict{String, Any} with 1 entry:
"missing_value" => 1.0e32
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── loaded lazily ┤
data size: 1.52 MB |
I have tried the new exported
open_mfdataset
function with a new dimension and I get the following error:Here's the dimensions of the underlying data in the netcdf files:
The text was updated successfully, but these errors were encountered: