Skip to content

Commit

Permalink
fix shifted lon
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Jan 10, 2022
1 parent 74b8b0f commit 990ef8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimateBase"
uuid = "35604d93-0fb8-4872-9436-495b01d137e2"
authors = ["Datseris <[email protected]>", "Philippe Roy <[email protected]>"]
version = "0.14.0"
version = "0.14.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
2 changes: 2 additions & 0 deletions src/core/coredefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/physical_dimensions/spatial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 990ef8e

Please sign in to comment.