summaryrefslogtreecommitdiff
path: root/tools/mmd/MmdSatellite.py
diff options
context:
space:
mode:
authorJogi Hofmüller <jogi@mur.at>2011-08-08 15:46:51 +0000
committerJogi Hofmüller <jogi@mur.at>2011-08-08 15:46:51 +0000
commitbbd00fe53be8e55e6ce7b2e1e87216e9776efb38 (patch)
tree23e0b1e4e66fd0430dfe275746ff3ac950e63194 /tools/mmd/MmdSatellite.py
parent- testing svn commit (diff)
- began writing a Satellite component
- using http://rhodesmill.org/pyephem/index.html - testing positioning of satellite on map using ARISSAT-1 data git-svn-id: https://svn.spreadspace.org/mur.sat@104 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'tools/mmd/MmdSatellite.py')
-rw-r--r--tools/mmd/MmdSatellite.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/tools/mmd/MmdSatellite.py b/tools/mmd/MmdSatellite.py
new file mode 100644
index 0000000..adb5fd8
--- /dev/null
+++ b/tools/mmd/MmdSatellite.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+
+import ephem
+import time
+
+def dms2degdec (lonlat):
+ parts = lonlat.split (':')
+ if len (parts) != 3:
+ return 0.0
+ degrees = float (parts[0])
+ fraction = (float (parts[1]) * 60.0 + float (parts[2])) / 3600
+ # print "debug"
+ # print parts
+ # print degrees
+ # print float (parts[1]) * 60.0
+ # print float (parts[2])
+ # print fraction
+ # print "debug end"
+ if degrees < 0:
+ return degrees - fraction
+ return degrees + fraction
+
+line0 = "ARISSAT-1/RADIOSCAF-B"
+line1 = "1 37772U 98067CK 11220.22334818 .00031592 00000-0 37647-3 0 118"
+line2 = "2 37772 51.6391 258.8215 0013530 58.1430 19.7106 15.60689826 619"
+
+
+# line0 = "ARISSat-1"
+# line1 = "1 37772U 98067CK 11219.88827546 .00035107 00000-0 41770-3 0 100"
+# line2 = "2 37772 51.6395 260.5080 0013376 55.7500 298.2807 15.60679045 559"
+#
+# line0 = "ISS (ZARYA)"
+# line1 = "1 25544U 98067A 11220.37158565 .00004586 00000-0 61164-4 0 8541"
+# line2 = "2 25544 51.6393 258.0860 0012828 54.3148 131.8091 15.60282006729050"
+
+if __name__ == "__main__":
+ sat = ephem.readtle (line0, line1, line2)
+ graz = ephem.Observer ()
+ graz.long, graz.lat, graz.elevation = '15.44226', '47.06576', 376
+ # graz.date = time.strftime ('%Y/%m/%d %H:%M:S')
+ sat.compute (graz)
+ print sat.name, graz.next_pass (sat), graz.date, sat.sublong, sat.sublat, float (sat.range/1000)
+ print sat.name, graz.next_pass (sat), graz.date, dms2degdec (sat.sublong.__str__ ()), dms2degdec (sat.sublat.__str__ ()), float (sat.range/1000)
+ graz.date += ephem.hour
+ sat.compute (graz)
+ print sat.name, graz.next_pass (sat), graz.date, sat.sublong, sat.sublat, float (sat.range/1000)
+ print sat.name, graz.next_pass (sat), graz.date, dms2degdec (sat.sublong.__str__ ()), dms2degdec (sat.sublat.__str__ ()), float (sat.range/1000)
+
+# vim: tw=0 ts=2
+# EOF