This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Intended to convert a typical radar lla and az el to a cesium quaternion orientation for CZML | |
# Uses numpy, transformations.py (http://www.lfd.uci.edu/~gohlke/code/transformations.py.html), | |
# and ecef.py (https://code.google.com/p/pysatel/source/browse/trunk/coord.py?r=22) | |
def azEl2Quaternion(lat, lon, alt, az, el): | |
rotZ = rotation_matrix(math.radians(180+az), [0,0,1]) | |
rotY = rotation_matrix(math.radians(-(90+el)), [0,1,0]) | |
rotM = np.dot(rotZ, rotY) | |
origin = geodetic2ecef(lat, lon, alt) | |
origin = np.multiply(origin, 1000) |