Skip to content

Commit d00675a

Browse files
committed
space docstrings for readability
1 parent 5d7d2ac commit d00675a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/io/netcdf_read.jl

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#########################################################################
55
"""
66
ncread(file, var [, selection]; kwargs...) → A
7+
78
Load the variable `var` from the `file` and convert it into a [`ClimArray`](@ref)
89
with proper dimension mapping and also containing the variable attributes as a dictionary.
910
Dimension attributes are also given to the dimensions of `A`, if any exist.
@@ -39,6 +40,7 @@ The function [`ncsize`](@ref) can be useful for `selection`.
3940
See also [`ncdetails`](@ref), [`nckeys`](@ref) and [`ncwrite`](@ref).
4041
4142
## Smart loading
43+
4244
The following things make loading data with `ncread` smarter than directly trying to use
4345
NCDatasets.jl and then convert to some kind of dimensional container.
4446
1. Data are directly transformed into `ClimArray`, conserving metadata and dimension names.
@@ -51,6 +53,7 @@ NCDatasets.jl and then convert to some kind of dimensional container.
5153
grid or not, and creating a single `Coord` dimension if not.
5254
5355
## Keywords
56+
5457
* `name` optionally rename loaded array.
5558
* `grid = nothing` optionally specify whether the underlying grid is `grid = OrthogonalSpace()`
5659
or `grid = CoordinateSpace()`, see [Types of spatial information](@ref).

src/physical_dimensions/spatial.jl

+5-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,16 @@ end
5050
export lon_distance, wrap_lon, longitude_circshift
5151
"""
5252
wrap_lon(x)
53+
5354
Wrap given longitude to -180 to 180 degrees.
5455
"""
5556
wrap_lon(x) = @. -180 + (360 + ((x+180) % 360)) % 360
5657

5758
"""
5859
lon_distance(λ1, λ2, Δλ = 360) → δ
60+
5961
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`ᵒ.
6163
"""
6264
function lon_distance(x, y, p = eltype(x)(360))
6365
moddis = mod(abs(x - y), p)
@@ -66,6 +68,7 @@ end
6668

6769
"""
6870
longitude_circshift(X::ClimArray [, l]; wrap = true) → Y::ClimArray
71+
6972
Perform the same action as `Base.circshift`, but only for the longitudinal dimension
7073
of `X` with shift `l`. If `wrap = true` the longitudes are wrapped to (-180, 180) degrees
7174
using the modulo operation.
@@ -247,7 +250,7 @@ export tropics_extratropics
247250
Separate the given array into two arrays: one having latitudes ℓ ∈ [-lower_lat, +lower_lat], and one
248251
having [-higher_lat:-lower_lat, lower_lat:higher_lat].
249252
"""
250-
tropics_extratropics(A, args...; kwargs...) =
253+
tropics_extratropics(A, args...; kwargs...) =
251254
tropics_extratropics(spacestructure(A), A, args...; kwargs...)
252255

253256
function tropics_extratropics(::OrthogonalSpace, A; lower_lat=30, higher_lat=90)

0 commit comments

Comments
 (0)