Discontinuity in Satellite Orbit
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyEphem |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hello,
I am trying to simulate the orbit of a CubeSat satellite with the following TLE File (stored as TLE_File):
CXBN
1 99999U 11158.66666667 .00001767 00000-0 83150-4 0 00005
2 99999 060.0472 001.9175 0286684 357.7762 001.3936 14.89594857000013
I use the following code to start and propagate the orbit:
DateTime = '2012/01/01 20:20:00'
#Format the time appropriately
Year = int(DateTime[0:4])
Month = int(DateTime[5:7])
Day = int(DateTime[8:10])
Hours = int(DateTime[
Mins = int(DateTime[
Secs = int(DateTime[
DateTime = datetime(Year, Month, Day, Hours, Mins, Secs)
#Convert this into a PyEphem Date (# days since noon on 1899 December 31)
EpDate_0 = ephem.date(
EpDate = float(EpDate)
#Call getsat to return an ephemeris satellite object based on the TLE
CXBN = getsat(TLE_File, EpDate)
#Set the time increment for the propogation
dt = double(0.01) #Time difference in seconds
t_final = 1*1. #Final time in seconds
NumTimes = t_final/dt
Times = arange(NumTimes)
#Do the progagation
for i in Times:
#Inrement the time
EpDate = double(EpDate) + ephem.second*dt
Time += dt
#Recompute the solution with the SGP4
CXBN.
#Get the position of the satellite in Earth-Centered Inertial Coordinates
r_eci = getSatECI(CXBN, c)
------
Here are the functions used above
def getSatECI(sat, c):
#First get the RA and DEC from satellite object
RA_rad = float(sat.ra)
DEC_rad = float(sat.dec)
Radius = float(sat.
#Now convert to ECI
x_eci = Radius*
y_eci = Radius*
z_eci = Radius*sin(DEC_rad)
#Form a three vector and return it
r_eci = vec3(x_eci, y_eci, z_eci)
def getsat(
"Get the a pyephem object representing a earth satellite at a particular date, given a TLE file describing the orbit"
f = open(tlefile,'r')
tle = f.readlines()
f.close()
sat = ephem.readtle(
sat.
return sat
------
The problem is that there are large jumps in the CXBN.elevation, and this causes jumps in the components of r_eci. I am starting to look into the SGP4 code you are using, but this I don't yet understand why this is happening. Is this a problem with the code's treatment of the orbit around the point of perigee?
Lance
As an additional note of information, it seems that the discontinuity is actually in the RA and DEC of the satellite object. Here you can see a plot of the difference in cosine of the declination between the current and precious time step