I am trying to create a geostationary orbit in pyephem (_n = 1.0
revolutions per day). I would like to verify that it is geostationary by placing an observer directly below the satellite and verifying that alt='90.0' and az=0. For my test I am placing the observer on the equator at 100 deg W longitude. Here is my code:
import ephem
sat = ephem.EarthSatellite()
sat._n = 1.0
sat._e = 0.0
sat._inc = 0.0
sat._raan = '-100.0'
sat._ap = 0.0
sat._M = 0.0
obs = ephem.Observer()
obs.lat = 0.0
obs.lon = '-100.0'
obs.date = '2014/10/16 00:00:00'
sat.compute(obs)
print "obs position: lat=%s lon=%s date=%s" % \
(obs.lat, obs.lon, obs.date)
print "sat orbit: n=%s e=%s inc=%s raan=%s ap=%s M=%s" % \
(sat._n, sat._e, sat._inc, sat._raan, sat._ap, sat._M)
print "sat position: alt=%s az=%s ra=%s dec=%s sublat=%s sublong=%s" % \
(sat.alt, sat.az, sat.ra, sat.dec, sat.sublat.norm, sat.sublong.norm)
and the output:
> obs position: lat=0:00:00.0 lon=-100:00:00.0 date=2014/10/16 00:00:00
> sat orbit: n=1.0 e=0.0 inc=0:00:00.0 raan=-1:44:43.2 ap=0:00:00.0 M=0:00:00.0
> sat position: alt=-90:00:00.0 az=0:00:00.0 ra=6:57:44.67 dec=0:00:00.0 sublat=1389660529:33:00.8 sublong=335:33:55.8
I find that changing the observer longitude does not change the output. I expect that sat._raan
sets the overhead position (sat.sublong
) of the satellite, but this also has no affect on the output. I consistently get alt=-90:00:00.0 az=0:00:00.0. (Towards center of Earth) and sublat, sublong don't make any sense.
Update
The reason for the strange, unchanging output of sublat=1389660529:33:00.8
is due to the sat._epoch
being '1899/12/31 12:00:00' by default, along with this issue. Setting sat._epoch = obs.date
works around this, but I am still not sure how to achieve the goal of defining a geostationary orbit whose sky position is fixed above a chosen Earth coordinate.