|
50 | 50 | export lon_distance, wrap_lon, longitude_circshift |
51 | 51 | """ |
52 | 52 | wrap_lon(x) |
| 53 | +
|
53 | 54 | Wrap given longitude to -180 to 180 degrees. |
54 | 55 | """ |
55 | 56 | wrap_lon(x) = @. -180 + (360 + ((x+180) % 360)) % 360 |
56 | 57 |
|
57 | 58 | """ |
58 | 59 | lon_distance(λ1, λ2, Δλ = 360) → δ |
| 60 | +
|
59 | 61 | Calculate distance `δ` (also in degrees) between longitudes `λ1, λ2`, but taking into |
60 | | -account the periodic nature of longitude, which has period `Δλ = 360ᵒ`. |
| 62 | +account the periodic nature of longitude, which has period `Δλ = 360`ᵒ. |
61 | 63 | """ |
62 | 64 | function lon_distance(x, y, p = eltype(x)(360)) |
63 | 65 | moddis = mod(abs(x - y), p) |
|
66 | 68 |
|
67 | 69 | """ |
68 | 70 | longitude_circshift(X::ClimArray [, l]; wrap = true) → Y::ClimArray |
| 71 | +
|
69 | 72 | Perform the same action as `Base.circshift`, but only for the longitudinal dimension |
70 | 73 | of `X` with shift `l`. If `wrap = true` the longitudes are wrapped to (-180, 180) degrees |
71 | 74 | using the modulo operation. |
@@ -247,7 +250,7 @@ export tropics_extratropics |
247 | 250 | Separate the given array into two arrays: one having latitudes ℓ ∈ [-lower_lat, +lower_lat], and one |
248 | 251 | having [-higher_lat:-lower_lat, lower_lat:higher_lat]. |
249 | 252 | """ |
250 | | -tropics_extratropics(A, args...; kwargs...) = |
| 253 | +tropics_extratropics(A, args...; kwargs...) = |
251 | 254 | tropics_extratropics(spacestructure(A), A, args...; kwargs...) |
252 | 255 |
|
253 | 256 | function tropics_extratropics(::OrthogonalSpace, A; lower_lat=30, higher_lat=90) |
|
0 commit comments