Skip to content

Commit

Permalink
fix merged new dim
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarusA committed Dec 16, 2024
1 parent 18ff0df commit ada0f7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DatasetAPI/Datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ open_mfdataset(g::Vector{<:AbstractString}; kwargs...) =
merge_datasets(map(i -> open_dataset(i; kwargs...), g))

function merge_new_axis(alldatasets, firstcube,var,mergedim)
newdim = DD.rebuild(mergedim,1:length(alldatasets))
newdim = if !(typeof(DD.lookup(mergedim)) <: DD.NoLookup)
DD.rebuild(mergedim, DD.val(mergedim))
else
DD.rebuild(mergedim, 1:length(alldatasets))
end
alldiskarrays = map(ds->ds.cubes[var].data,alldatasets).data
newda = diskstack(alldiskarrays)
newdims = (DD.dims(firstcube)...,newdim)
Expand Down

0 comments on commit ada0f7b

Please sign in to comment.