Skip to content

Commit 5a548f8

Browse files
committed
los imports
1 parent d5e1c72 commit 5a548f8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

pymap3d/los.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
""" Line of sight intersection of space observer to ellipsoid """
22
from typing import Tuple
3-
from math import pi, nan, sqrt
3+
try:
4+
from numpy import pi, nan, sqrt, vectorize
5+
except ImportError:
6+
from math import pi, nan, sqrt
7+
vectorize = None
48

59
from .aer import aer2enu
610
from .ecef import enu2uvw, geodetic2ecef, ecef2geodetic
711
from .ellipsoid import Ellipsoid
812

9-
try:
10-
import numpy
11-
except ImportError:
12-
numpy = None
13-
1413
__all__ = ["lookAtSpheroid"]
1514

1615

1716
def lookAtSpheroid(
1817
lat0: float, lon0: float, h0: float, az: float, tilt: float, ell: Ellipsoid = None, deg: bool = True
1918
) -> Tuple[float, float, float]:
20-
if numpy is not None:
21-
fun = numpy.vectorize(lookAtSpheroid_point)
19+
if vectorize is not None:
20+
fun = vectorize(lookAtSpheroid_point)
2221
return fun(lat0, lon0, h0, az, tilt, ell, deg)
2322
else:
2423
return lookAtSpheroid_point(lat0, lon0, h0, az, tilt, ell, deg)

0 commit comments

Comments
 (0)