Coverage for pyguymer3/geo/clipLatitude.py: 50%

2 statements  

« prev     ^ index     » next       coverage.py v7.9.2, created at 2025-07-08 18:47 +0000

1#!/usr/bin/env python3 

2 

3# Define function ... 

4def clipLatitude( 

5 lat, 

6 /, 

7): 

8 """Clip latitude to be between -90° (inclusive) and +90° (inclusive) 

9 

10 Parameters 

11 ---------- 

12 lat : float 

13 the latitude 

14 

15 Returns 

16 ------- 

17 ans : float 

18 the clipped latitude 

19 

20 Notes 

21 ----- 

22 Copyright 2017 Thomas Guymer [1]_ 

23 

24 References 

25 ---------- 

26 .. [1] PyGuymer3, https://github.com/Guymer/PyGuymer3 

27 """ 

28 

29 # Return answer ... 

30 return max(-90.0, min(+90.0, lat))