Plan13 code nearing alpha test…

My Python port of the Plan13 algorithm is pretty much working now. I wrote a simple script to find the next pass of NOAA-17, and here is the result for finding the next pass. It outputs the time and date (in UTC), the elevation, azimuth, latitude and longitude of the point directly under the satellite, the range to the satellite, and the Doppler corrected downlink frequency.

It seems to work pretty well.

==============================================================
================ UPCOMING PASSES FOR NOAA-17 =================
==============================================================
2008/01/20 03:55:00  +1.9 102.8 28.4N  93.3W 3141km 137.622Mhz
2008/01/20 03:56:00  +4.4  96.1 31.9N  94.3W 2890km 137.622Mhz
2008/01/20 03:57:00  +6.8  88.2 35.4N  95.3W 2679km 137.621Mhz
2008/01/20 03:58:00  +8.7  79.0 38.8N  96.4W 2520km 137.621Mhz
2008/01/20 03:59:00 +10.0  68.7 42.3N  97.6W 2422km 137.620Mhz
2008/01/20 04:00:00 +10.4  57.8 45.8N  98.8W 2396km 137.620Mhz
2008/01/20 04:01:00  +9.8  47.0 49.3N 100.2W 2442km 137.619Mhz
2008/01/20 04:02:00  +8.4  37.0 52.7N 101.8W 2556km 137.619Mhz
2008/01/20 04:03:00  +6.3  28.1 56.2N 103.6W 2731km 137.618Mhz
2008/01/20 04:04:00  +3.9  20.5 59.6N 105.8W 2955km 137.618Mhz
2008/01/20 04:05:00  +1.3  14.2 62.9N 108.3W 3216km 137.618Mhz
--------------------------------------------------------------

Addendum: I ran my script to find the next pass for AO-27, and wow, it turns out that it passes almost directly over my position. I changed the pass predictor to produce lines every 15 seconds.

==============================================================
================ UPCOMING PASSES FOR OSCAR-27 ================
==============================================================
2008/01/19 22:43:15  +0.8 165.2 12.2N 115.6W 3173km 436.807Mhz
2008/01/19 22:43:30  +1.8 165.2 13.1N 115.8W 3073km 436.807Mhz
2008/01/19 22:43:45  +2.8 165.2 14.0N 116.0W 2972km 436.807Mhz
2008/01/19 22:44:00  +3.8 165.2 14.8N 116.2W 2872km 436.807Mhz
2008/01/19 22:44:15  +4.9 165.3 15.7N 116.4W 2771km 436.807Mhz
2008/01/19 22:44:30  +6.0 165.3 16.6N 116.6W 2671km 436.807Mhz
2008/01/19 22:44:45  +7.1 165.3 17.5N 116.8W 2571km 436.807Mhz
2008/01/19 22:45:00  +8.4 165.3 18.4N 117.0W 2472km 436.807Mhz
2008/01/19 22:45:15  +9.7 165.3 19.3N 117.2W 2372km 436.807Mhz
2008/01/19 22:45:30 +11.0 165.3 20.1N 117.4W 2273km 436.807Mhz
2008/01/19 22:45:45 +12.5 165.4 21.0N 117.6W 2175km 436.807Mhz
2008/01/19 22:46:00 +14.0 165.4 21.9N 117.9W 2077km 436.806Mhz
2008/01/19 22:46:15 +15.6 165.4 22.8N 118.1W 1980km 436.806Mhz
2008/01/19 22:46:30 +17.4 165.4 23.7N 118.3W 1884km 436.806Mhz
2008/01/19 22:46:45 +19.3 165.4 24.6N 118.5W 1788km 436.806Mhz
2008/01/19 22:47:00 +21.4 165.4 25.4N 118.7W 1694km 436.806Mhz
2008/01/19 22:47:15 +23.6 165.4 26.3N 119.0W 1601km 436.806Mhz
2008/01/19 22:47:30 +26.1 165.4 27.2N 119.2W 1510km 436.806Mhz
2008/01/19 22:47:45 +28.8 165.4 28.1N 119.4W 1421km 436.806Mhz
2008/01/19 22:48:00 +31.8 165.4 29.0N 119.6W 1335km 436.805Mhz
2008/01/19 22:48:15 +35.2 165.4 29.8N 119.9W 1251km 436.805Mhz
2008/01/19 22:48:30 +39.0 165.3 30.7N 120.1W 1171km 436.805Mhz
2008/01/19 22:48:45 +43.3 165.3 31.6N 120.3W 1095km 436.804Mhz
2008/01/19 22:49:00 +48.1 165.2 32.5N 120.6W 1025km 436.804Mhz
2008/01/19 22:49:15 +53.5 165.1 33.4N 120.8W  962km 436.803Mhz
2008/01/19 22:49:30 +59.5 164.9 34.2N 121.1W  907km 436.802Mhz
2008/01/19 22:49:45 +66.3 164.5 35.1N 121.3W  861km 436.801Mhz
2008/01/19 22:50:00 +73.6 163.7 36.0N 121.6W  827km 436.800Mhz
2008/01/19 22:50:15 +81.4 161.5 36.9N 121.9W  806km 436.798Mhz
2008/01/19 22:50:30 +89.1 113.7 37.8N 122.1W  798km 436.797Mhz
2008/01/19 22:50:45 +82.4 351.7 38.6N 122.4W  805km 436.796Mhz
2008/01/19 22:51:00 +74.6 348.9 39.5N 122.7W  825km 436.794Mhz
2008/01/19 22:51:15 +67.3 348.1 40.4N 123.0W  858km 436.793Mhz
2008/01/19 22:51:30 +60.5 347.7 41.3N 123.3W  903km 436.792Mhz
2008/01/19 22:51:45 +54.4 347.5 42.1N 123.6W  957km 436.791Mhz
2008/01/19 22:52:00 +48.9 347.3 43.0N 123.9W 1020km 436.791Mhz
2008/01/19 22:52:15 +44.1 347.3 43.9N 124.2W 1089km 436.790Mhz
2008/01/19 22:52:30 +39.8 347.2 44.8N 124.5W 1164km 436.789Mhz
2008/01/19 22:52:45 +36.0 347.2 45.6N 124.8W 1244km 436.789Mhz
2008/01/19 22:53:00 +32.6 347.2 46.5N 125.1W 1327km 436.789Mhz
2008/01/19 22:53:15 +29.5 347.2 47.4N 125.5W 1414km 436.788Mhz
2008/01/19 22:53:30 +26.8 347.2 48.3N 125.8W 1502km 436.788Mhz
2008/01/19 22:53:45 +24.3 347.2 49.1N 126.2W 1593km 436.788Mhz
2008/01/19 22:54:00 +22.0 347.2 50.0N 126.6W 1686km 436.788Mhz
2008/01/19 22:54:15 +19.9 347.2 50.9N 126.9W 1780km 436.788Mhz
2008/01/19 22:54:30 +18.0 347.2 51.7N 127.3W 1875km 436.788Mhz
2008/01/19 22:54:45 +16.2 347.3 52.6N 127.8W 1971km 436.788Mhz
2008/01/19 22:55:00 +14.6 347.3 53.5N 128.2W 2068km 436.788Mhz
2008/01/19 22:55:15 +13.0 347.3 54.3N 128.6W 2166km 436.787Mhz
2008/01/19 22:55:30 +11.6 347.4 55.2N 129.1W 2264km 436.787Mhz
2008/01/19 22:55:45 +10.2 347.4 56.1N 129.5W 2362km 436.787Mhz
2008/01/19 22:56:00  +8.9 347.4 56.9N 130.0W 2461km 436.787Mhz
2008/01/19 22:56:15  +7.7 347.5 57.8N 130.5W 2561km 436.787Mhz
2008/01/19 22:56:30  +6.5 347.5 58.7N 131.1W 2661km 436.787Mhz
2008/01/19 22:56:45  +5.4 347.6 59.5N 131.6W 2760km 436.787Mhz
2008/01/19 22:57:00  +4.4 347.6 60.4N 132.2W 2860km 436.787Mhz
2008/01/19 22:57:15  +3.3 347.6 61.2N 132.8W 2961km 436.787Mhz
2008/01/19 22:57:30  +2.3 347.7 62.1N 133.4W 3061km 436.787Mhz
2008/01/19 22:57:45  +1.4 347.7 62.9N 134.1W 3161km 436.787Mhz
2008/01/19 22:58:00  +0.5 347.8 63.8N 134.8W 3262km 436.787Mhz
--------------------------------------------------------------