Skip to content

Commit

Permalink
Add convenience radar to lon/lat/alt method
Browse files Browse the repository at this point in the history
  • Loading branch information
deeplycloudy committed Sep 22, 2015
1 parent b58f0f1 commit e117f8c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions coordinateSystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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):
Expand Down

0 comments on commit e117f8c

Please sign in to comment.