3

Tried using PyEphem sample codes below:

import ephem
import datetime
import math

name = "SPOT 6";
line1 = "1 38755U 12047A   15104.74620640  .00000406  00000-0  96954-4 0  9999";
line2 = "2 38755  98.1581 172.5167 0001084  90.6537 269.4779 14.58589040138138";
spot6 = ephem.readtle(name, line1, line2)
spot6.compute('2015/4/15')
print('\nLat:%s, Long:%s' % (spot6.sublat, spot6.sublong))

Lat:-70:19:25.5, Long:126:16:41.2

How to interpret the above lat/long coordinates? If converted to lat/long in degree decimal, what will it be?

tanlccc
  • 363
  • 1
  • 5
  • 13

1 Answers1

3

You can convert an angle, whose float value is in radians, to degrees by using the degree symbol in PyEphem:

from ephem import degree
print(spot6.sublat / degree)
print(spot6.sublong / degree)

This will print the decimal equivalents to the degree measurements that PyEphem was printing in arcminutes and arcseconds:

-70.3237369775
126.278121979
Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147
  • Thanks! Would like to confirm if these sublat and sublong are the cartesians coordinates of the satellite? – tanlccc Apr 23 '15 at 03:33
  • No. Latitude and longitude are spherical coordinates, measuring angles, not cartesian coordinates, which instead would measure distances along the x, y, and z axes. – Brandon Rhodes Apr 27 '15 at 12:09