From e117f8c67e9de9360717cc9eaee1a4cd62784526 Mon Sep 17 00:00:00 2001 From: Eric Bruning Date: Mon, 21 Sep 2015 21:04:27 -0500 Subject: [PATCH] Add convenience radar to lon/lat/alt method --- coordinateSystems.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/coordinateSystems.py b/coordinateSystems.py index 30aa564..65c74de 100644 --- a/coordinateSystems.py +++ b/coordinateSystems.py @@ -94,7 +94,7 @@ def ctrPosition(self): cx, cy, cz = self.fromECEF(ex, ey, ez) else: cx, cy, cz = 0, 0, 0 - return cx, cy, cz + return cx, cy, cz def toECEF(self, x, y, z): x += self.cx @@ -202,8 +202,8 @@ def getSlantRangeElevation(self, groundRange, z): el *= 180.0 / pi return r, el - - def toECEF(self, r, az, el): + + def toLonLatAlt(self, r, az, el): """Convert slant range r, azimuth az, and elevation el to ECEF system""" geoSys = GeographicSystem() geodetic = proj4.Geod(ellps='WGS84') @@ -215,6 +215,10 @@ def toECEF(self, r, az, el): dist, z = self.getGroundRangeHeight(r,el) lon, lat, backAz = geodetic.fwd([self.ctrLon]*n, [self.ctrLat]*n, az, dist) + return lon, lat, z + + def toECEF(self, r, az, el): + lon, lat, z = self.toLonLatAlt(r, az, el) return geoSys.toECEF(lon, lat, z.ravel()) def fromECEF(self, x, y, z):