/ makevalidlon.jl
makevalidlon.jl
 1  """
 2  # makevalidlon(degrees)
 3  
 4  Convert a longitude that is either [1] *less than -180 degrees* or
 5  [2] *greater than 180 degrees* into a conventional, valid longitude
 6  between -180 and 180 degrees.
 7  
 8  ## Inputs
 9  
10  - `degrees`: A real number representing the degrees to be converted.
11  
12  ## Examples
13  
14  ```julia-repl
15  julia> makevalidlon(-225)
16  135
17  
18  ```
19  """
20  function makevalidlon(degrees::Real)
21      if degrees < -180
22          return degrees + 360
23      elseif degrees > 180
24          return degrees - 360
25      else
26          return degrees
27      end
28  end