Skip to content

Commit d3b4f42

Browse files
committed
eci: warn if using low accuracy non-AstroPy
1 parent e41a01f commit d3b4f42

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/pymap3d/eci.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ def eci2ecef(x, y, z, time: datetime, force_non_astropy: bool = False) -> tuple:
4949
"""
5050

5151
if force_non_astropy or "astropy" not in sys.modules:
52-
logging.debug(f"{__name__}: Numpy implementation")
52+
logging.warning(f"{__name__}: Numpy implementation has considerably less accuracy than Astropy")
5353
xe, ye, ze = eci2ecef_numpy(x, y, z, time)
5454
else:
55-
logging.debug(f"{__name__}: Astropy implementation")
5655
xe, ye, ze = eci2ecef_astropy(x, y, z, time)
5756

5857
return xe.squeeze()[()], ye.squeeze()[()], ze.squeeze()[()]
@@ -138,10 +137,9 @@ def ecef2eci(x, y, z, time: datetime, force_non_astropy: bool = False) -> tuple:
138137

139138
# if astropy is imported
140139
if force_non_astropy or "astropy" not in sys.modules:
141-
logging.debug(f"{__name__}: Numpy implementation")
140+
logging.warning(f"{__name__}: Numpy implementation has considerably less accuracy than Astropy")
142141
xe, ye, ze = ecef2eci_numpy(x, y, z, time)
143142
else:
144-
logging.debug(f"{__name__}: Astropy implementation")
145143
xe, ye, ze = ecef2eci_astropy(x, y, z, time)
146144

147145
return xe, ye, ze

src/pymap3d/haversine.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ def anglesep(
111111
lat1 = radians(lat1)
112112

113113
if force_non_astropy or "astropy" not in sys.modules:
114-
logging.debug(f"{__name__}: Meeus implementation")
114+
logging.warning(f"{__name__}: Numpy implementation has considerably less accuracy than Astropy")
115115
sep_rad = anglesep_meeus(lon0, lat0, lon1, lat1, deg=False)
116116
else:
117-
logging.debug(f"{__name__}: Astropy implementation")
118117
sep_rad = angular_separation(lon0, lat0, lon1, lat1)
119118

120119
return degrees(sep_rad) if deg else sep_rad

0 commit comments

Comments
 (0)