From 990ef8e7eb50274c15bdeded13f415051fbcd88e Mon Sep 17 00:00:00 2001 From: Datseris Date: Mon, 10 Jan 2022 10:49:20 +0100 Subject: [PATCH] fix shifted lon --- Project.toml | 2 +- src/core/coredefs.jl | 2 ++ src/physical_dimensions/spatial.jl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index c81d94ff..b9a7bb33 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ClimateBase" uuid = "35604d93-0fb8-4872-9436-495b01d137e2" authors = ["Datseris ", "Philippe Roy "] -version = "0.14.0" +version = "0.14.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/core/coredefs.jl b/src/core/coredefs.jl index 82613fff..dc127e6b 100644 --- a/src/core/coredefs.jl +++ b/src/core/coredefs.jl @@ -4,6 +4,7 @@ using DimensionalData using DimensionalData.Dimensions, DimensionalData.LookupArrays using DimensionalData: basetypeof, broadcast_dims +using DimensionalData.Dimensions: setdims using Dates Time = DimensionalData.Ti @@ -32,6 +33,7 @@ export hasdim, dims, dimindex export Time, Lon, Lat, dims, Coord, Hei, Pre, Ti export CoordinateSpace, OrthogonalSpace, spacestructure export DimensionalData # for accessing its functions +export setdims export gnv @dim Lon IndependentDim "Longitude" diff --git a/src/physical_dimensions/spatial.jl b/src/physical_dimensions/spatial.jl index 28e9753b..690b7137 100644 --- a/src/physical_dimensions/spatial.jl +++ b/src/physical_dimensions/spatial.jl @@ -81,7 +81,7 @@ function longitude_circshift(X::ClimArray, l = nothing; wrap = true) shifted_lon = circshift(dims(X, Lon).val, l) if wrap; shifted_lon = wrap_lon.(shifted_lon); end shifted_lon = vector2range(shifted_lon) - shifted_dim = Lon(shifted_lon; metadata = dims(X, Lon).metadata) + shifted_dim = Lon(shifted_lon; metadata = DimensionalData.metadata(dims(X, Lon))) new_dims = map(d -> d isa Lon ? shifted_dim : d, dims(X)) return ClimArray(shifted_data, new_dims; name = X.name, attrib = X.attrib) end