Coverage for pyguymer3/geo/wrapLongitude.py: 100%
2 statements
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-08 18:47 +0000
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-08 18:47 +0000
1#!/usr/bin/env python3
3# Define function ...
4def wrapLongitude(
5 lon,
6 /,
7):
8 """Wrap longitude to be between -180° (inclusive) and +180° (exclusive)
10 Parameters
11 ----------
12 lon : float
13 the longitude
15 Returns
16 -------
17 ans : float
18 the wrapped longitude
20 Notes
21 -----
22 Copyright 2017 Thomas Guymer [1]_
24 References
25 ----------
26 .. [1] PyGuymer3, https://github.com/Guymer/PyGuymer3
27 """
29 # Return answer ...
30 return ((lon + 180.0) % 360.0) - 180.0