diff --git a/Project.toml b/Project.toml index c6b0090..8153b1d 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6" ClimateBaseVisualizations = "GeoMakie" [compat] -DimensionalData = "0.24, 0.25, 0.26, 0.27" +DimensionalData = "0.27" GeoMakie = "0.6" Interpolations = "0.13.2, 0.14, 0.15" NCDatasets = "0.11, 0.12" diff --git a/src/core/coredefs.jl b/src/core/coredefs.jl index f19e9d3..1544d5b 100644 --- a/src/core/coredefs.jl +++ b/src/core/coredefs.jl @@ -187,12 +187,6 @@ DimensionalData.rebuild( data=gnv(A), dims=dims(A), refdims=refdims(A), name=name(A), metadata=metadata(A) ) = ClimArray(data, format(dims, data), refdims, name, metadata) - -# The following basic methods allow indexing with tuples, (Time(5), Lon(3)) -Base.getindex(A::ClimArray, i::Tuple) = A[i...] -Base.setindex!(A::ClimArray, x, i::Tuple) = setindex!(A, x, i...) -Base.view(A::ClimArray, i::Tuple) = view(A, i...) - # Convenience Base.ones(A::AbDimArray) = basetypeof(A)(ones(eltype(A), size(A)), dims(A)) Base.zeros(A::AbDimArray) = basetypeof(A)(zeros(eltype(A), size(A)), dims(A)) diff --git a/src/interpolations/height_interpolation.jl b/src/interpolations/height_interpolation.jl index 1632567..bebb1b3 100644 --- a/src/interpolations/height_interpolation.jl +++ b/src/interpolations/height_interpolation.jl @@ -39,7 +39,7 @@ function interpolation2pressure(A::ClimArray, pressure::ClimArray, pressure_leve # construct output Array: pre = Pre(pressure_levels; metadata = Dict()) dims_no_height = otherdims(A, vertical_dim) - out_dims = (dims_no_height...,pre) + out_dims = (dims_no_height..., pre) dimension_lengths = length.(out_dims) B = ClimArray( @@ -47,8 +47,8 @@ function interpolation2pressure(A::ClimArray, pressure::ClimArray, pressure_leve name = A.name, attrib = A.attrib ) for i in otheridxs(A, vertical_dim) - itp = LinearInterpolation(pressure[i],A[i],extrapolation_bc=extrapolation_bc) - B[i] = itp(pressure_levels) + itp = LinearInterpolation(pressure[i], A[i...]; extrapolation_bc) + B[i...] = itp(pressure_levels) end return B end @@ -105,8 +105,8 @@ function interpolate_height2pressure(A::ClimArray,pressure_levels::Vector; extra int_array = ClimArray(zeros(eltype(A), Tuple(dimension_lengths)), out_dims; name = A.name, attrib = A.attrib) for i in otheridxs(A, Hei()) - itp = LinearInterpolation(pressure,A[i],extrapolation_bc=extrapolation_bc) - int_array[i] = itp(pressure_levels) + itp = LinearInterpolation(pressure, A[i...]; extrapolation_bc) + int_array[i...] = itp(pressure_levels) end return int_array end @@ -136,8 +136,8 @@ function interpolate_pressure2height(A::ClimArray,heights::Vector; extrapolation for i in otheridxs(A, Pre()) - itp = LinearInterpolation(height,A[i],extrapolation_bc=extrapolation_bc) - int_array[i] = itp(heights) + itp = LinearInterpolation(height,A[i...]; extrapolation_bc) + int_array[i...] = itp(heights) end return int_array