Skip to content

Instantly share code, notes, and snippets.

@zonca
Created January 22, 2012 14:49
Show Gist options
  • Save zonca/1657277 to your computer and use it in GitHub Desktop.
Save zonca/1657277 to your computer and use it in GitHub Desktop.
PyTPM performance issue
import datetime
import time
import numpy as np
from pytpm import convert, tpm
az = 3.30084818
el = 0.94610742
lat = 34.64
lon = -103.7
alt = 35800.26
ut = 2455822.20000367
for i in range(0, 15):
v6 = convert.cat2v6(alpha = az, delta = el)
start_clock = time.clock()
v6c = convert.convertv6(v6=v6,
utc=ut,
s1=tpm.TPM_S19, s2=tpm.TPM_S07,
epoch=tpm.J2000, equinox=tpm.J2000,
lon=lon, lat=lat, alt=alt,
xpole=0.0, ypole=0.0,
T=273.15, P=1013.25, H=0.0, wavelength=19986.16386)
print("TIME[%d]:%.2g s" % (i, time.clock() - start_clock))
cat = convert.v62cat(v6c)
print(np.degrees([cat['alpha'], cat['delta']]))
python testazel.py
TIME[0]:1.6 s
[ 138.3027046 -6.8823031]
TIME[1]:0.01 s
[ 139.11112245 -0.73624182]
TIME[2]:0 s
[ 139.10879366 -0.75403965]
TIME[3]:0 s
[ 139.10874356 -0.75442249]
TIME[4]:0 s
[ 139.1087425 -0.75443064]
TIME[5]:0 s
[ 139.10874248 -0.75443081]
TIME[6]:0 s
[ 139.10874248 -0.75443082]
TIME[7]:0 s
[ 139.10874248 -0.75443082]
TIME[8]:0.01 s
[ 139.10874248 -0.75443082]
TIME[9]:6.2 s
[ 139.10874248 -0.75443082]
TIME[10]:12 s
[ 139.10874248 -0.75443082]
TIME[11]:12 s
[ 139.10874248 -0.75443082]
TIME[12]:12 s
[ 139.10874248 -0.75443082]
TIME[13]:12 s
[ 139.10874248 -0.75443082]
TIME[14]:12 s
[ 139.10874248 -0.75443082]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment