This question is perhaps related to this one: Wrong Range Rate with Pyephem
I've just started experimenting with pyephem for the purpose of making satellite pass predictions and doppler shift calculations for radio links. I'm so new at this that I haven't written any code as such yet, I've just dabbled in the python interactive interpreter.
My question is is about the correction for atmospheric refraction, that may be disabled by setting the observer altitude to 0mb. When I compared a pass prediction using next_pass() in pyephem with that from gnu predict, I noticed differences in the order of 30 seconds between the AOS and LOS times, which improved to 1 second difference in AOS and 8 seconds difference in LOS when the correction for atmospheric refraction was disabled. This is with identical TLEs used by predict and pyephem.
Q1) Is it likely that the initially larger difference of about 30 seconds is perhaps due to predict not compensating for atmospheric refraction in its pass predictions? This seems like a plausible explanation.
Q2) It is my (perhaps weak) understanding that most terrestrial radio propagation models use a 4/3 earth radius fudge factor to compensate for atmospheric refraction, effectively straightening out curved paths and thus affecting the calculated range and therefore range-rate. Is the atmospheric refraction correction in pyephem equivalent to this approach?
Q3) I notice that range and range_rate values are seemingly unaffected by changing the observer pressure from 1010.0mb to 0.0mb (therefore disabling the atmospheric refraction correction) whilst the results from calling next_pass() are affected. Should this be the case? I would have thought that the range and range_rate values would change, or should we in fact consider "apparent range" and "apparent range rate" as additional values that could be calculated when atmospheric refraction compensation is applied?
This is my first question on stack overflow. I apologise if my query is not well formed. Thanks.
Update - some code and some results as requested
Here's some code ...
import ephem
g0hww = ephem.Observer()
g0hww.lat='52:14:15.70'
g0hww.lon='0:43:24.49'
g0hww.elevation=40.0
g0hww.pressure = 0.0
g0hww.date = "2014/5/9 08:48:53"
stations = open("/home/darren/cronjobs/stations.txt","r")
line1=stations.readline()
line2=stations.readline()
line3=stations.readline()
print "Using keps for:" + line1.strip()
print line2.strip()
print line3.strip()
print "\n"
iss = ephem.readtle(line1,line2,line3)
iss.compute(g0hww)
print g0hww
print "iss azimuth: " + str(iss.az)
print "iss elevation: " + str(iss.alt)
print "iss range: " + str(iss.range)
print "iss range rate: " + str(iss.range_velocity)
print g0hww.next_pass(iss)
print "\n"
g0hww.pressure = 1010.0
iss.compute(g0hww)
print g0hww
print "iss azimuth: " + str(iss.az)
print "iss elevation: " + str(iss.alt)
print "iss range: " + str(iss.range)
print "iss range rate: " + str(iss.range_velocity)
print g0hww.next_pass(iss)
Here's some results:
Using keps for:ISS (ZARYA)
1 25544U 98067A 14126.92299264 .00007994 00000-0 14853-3 0 2319
2 25544 51.6500 304.1061 0002752 337.8472 139.1065 15.49877967884923
<ephem.Observer date='2014/5/9 08:48:52' epoch='2000/1/1 12:00:00' lon=0:43:24.5 lat=52:14:15.7 elevation=40.0m horizon=0:00:00.0 temp=15.0C pressure=0.0mBar>
iss azimuth: 90:47:19.1
iss elevation: 21:02:43.0
iss range: 999640.75
iss range rate: 5735.83300781
(2014/5/9 10:18:09, 269:24:46.2, 2014/5/9 08:48:44, 22:40:03.7, 2014/5/9 08:52:14, 79:47:08.3)
<ephem.Observer date='2014/5/9 08:48:52' epoch='2000/1/1 12:00:00' lon=0:43:24.5 lat=52:14:15.7 elevation=40.0m horizon=0:00:00.0 temp=15.0C pressure=1010.0mBar>
iss azimuth: 90:47:19.1
iss elevation: 21:05:11.0
iss range: 999640.75
iss range rate: 5735.83300781
(2014/5/9 10:18:04, 269:25:01.5, 2014/5/9 08:48:49, 21:49:15.9, 2014/5/9 08:52:29, 79:31:12.8)