3

When trying to compute the following TLE, the compute results are incomplete:

FENGYUN 1C DEB
1 31034U 99025BEC 12293.69998868  .02147743  29582-2  52063-2 0  1666
2 31034 099.0270 256.6567 0044344 106.5074 254.5558 15.95183245303888

This TLE is read using

obj = readtle(line0, line1, line2) #where line0 is the 0th line, line1 is the 1st line etc.

I set up an observer as follows:

#Observatory Data
obs = ephem.Observer()
obs.lat = '32.345010'
obs.lon = '-111.011647'
obs.elevation = 400
obs.name = 'myObs'
obs.date = '2012/11/9 01:52:48'

When I use

obj.compute(obs)

The function fails to fill in appropriate values in obj.ra, obj.elevation etc., but does not crash or hang (it also does this sometimes) This is probably owed to the fact that the object has recently decayed into the atmosphere, however, the incomplete results crash the rest of my program; I simply want to figure out a way to catch this exception, but have failed to do so.

I tried

try:
    obj.compute(obs) # no exception is thrown by compute
except:
    print 'bad computation'
    continue

also tried

if ~obj.elevation: continue

This gave a different error indicating that the ~ operator is cannot be used on the obj.elevation datatype (or something like that).

Is there a way to catch these exceptions resulting from Body.compute()?

Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147
AlphaPony
  • 31
  • 5

0 Answers0