Skip to content

Instantly share code, notes, and snippets.

@SpheMakh
Last active January 18, 2016 10:05
Show Gist options
  • Save SpheMakh/bf1e5b76a2562fc43003 to your computer and use it in GitHub Desktop.
Save SpheMakh/bf1e5b76a2562fc43003 to your computer and use it in GitHub Desktop.
itrf 2 enu
import numpy as np
from pyrap.tables import table
import pyrap.measures
def enu2itrf(xyz=None,casa_table=None,**kw):
if casa_table:
xyz = table(anttab).getcol("POSITION")
import pyrap.measures
dm = pyrap.measures.measures()
dq = pyrap.measures.dq
DEG = 180./np.pi
deg2m = 111.32
p1 = dm.position('itrf',*[dq.quantity(xyz[:,i],'m') for i in range(3)])
lon = p1['m0']['value']
lat = p1['m1']['value']
dx = (lon-lon[0])*np.cos(lat[0])*DEG*deg2m
dy = (lat-lat[0])*DEG*deg2m
return dx, dy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment