diff --git a/Leap_Second.dat b/Leap_Second.dat new file mode 100644 index 0000000..0bb8f6a --- /dev/null +++ b/Leap_Second.dat @@ -0,0 +1,41 @@ +# Value of TAI-UTC in second valid beetween the initial value until +# the epoch given on the next line. The last line reads that NO +# leap second was introduced since the corresponding date +# Updated through IERS Bulletin 57 issued in January 2019 +# +# +# File expires on 28 December 2019 +# +# +# MJD Date TAI-UTC (s) +# day month year +# --- -------------- ------ +# + 41317.0 1 1 1972 10 + 41499.0 1 7 1972 11 + 41683.0 1 1 1973 12 + 42048.0 1 1 1974 13 + 42413.0 1 1 1975 14 + 42778.0 1 1 1976 15 + 43144.0 1 1 1977 16 + 43509.0 1 1 1978 17 + 43874.0 1 1 1979 18 + 44239.0 1 1 1980 19 + 44786.0 1 7 1981 20 + 45151.0 1 7 1982 21 + 45516.0 1 7 1983 22 + 46247.0 1 7 1985 23 + 47161.0 1 1 1988 24 + 47892.0 1 1 1990 25 + 48257.0 1 1 1991 26 + 48804.0 1 7 1992 27 + 49169.0 1 7 1993 28 + 49534.0 1 7 1994 29 + 50083.0 1 1 1996 30 + 50630.0 1 7 1997 31 + 51179.0 1 1 1999 32 + 53736.0 1 1 2006 33 + 54832.0 1 1 2009 34 + 56109.0 1 7 2012 35 + 57204.0 1 7 2015 36 + 57754.0 1 1 2017 37 diff --git a/deltat.data b/deltat.data new file mode 100644 index 0000000..4600cec --- /dev/null +++ b/deltat.data @@ -0,0 +1,555 @@ + 1973 2 1 43.4724 + 1973 3 1 43.5648 + 1973 4 1 43.6737 + 1973 5 1 43.7782 + 1973 6 1 43.8763 + 1973 7 1 43.9562 + 1973 8 1 44.0315 + 1973 9 1 44.1132 + 1973 10 1 44.1982 + 1973 11 1 44.2952 + 1973 12 1 44.3936 + 1974 1 1 44.4841 + 1974 2 1 44.5646 + 1974 3 1 44.6425 + 1974 4 1 44.7386 + 1974 5 1 44.8370 + 1974 6 1 44.9302 + 1974 7 1 44.9986 + 1974 8 1 45.0584 + 1974 9 1 45.1284 + 1974 10 1 45.2064 + 1974 11 1 45.2980 + 1974 12 1 45.3897 + 1975 1 1 45.4761 + 1975 2 1 45.5632 + 1975 3 1 45.6450 + 1975 4 1 45.7375 + 1975 5 1 45.8284 + 1975 6 1 45.9133 + 1975 7 1 45.9820 + 1975 8 1 46.0407 + 1975 9 1 46.1067 + 1975 10 1 46.1825 + 1975 11 1 46.2789 + 1975 12 1 46.3713 + 1976 1 1 46.4567 + 1976 2 1 46.5445 + 1976 3 1 46.6311 + 1976 4 1 46.7302 + 1976 5 1 46.8284 + 1976 6 1 46.9247 + 1976 7 1 46.9970 + 1976 8 1 47.0709 + 1976 9 1 47.1450 + 1976 10 1 47.2362 + 1976 11 1 47.3413 + 1976 12 1 47.4319 + 1977 1 1 47.5214 + 1977 2 1 47.6049 + 1977 3 1 47.6837 + 1977 4 1 47.7781 + 1977 5 1 47.8771 + 1977 6 1 47.9687 + 1977 7 1 48.0348 + 1977 8 1 48.0942 + 1977 9 1 48.1608 + 1977 10 1 48.2460 + 1977 11 1 48.3439 + 1977 12 1 48.4355 + 1978 1 1 48.5344 + 1978 2 1 48.6324 + 1978 3 1 48.7294 + 1978 4 1 48.8365 + 1978 5 1 48.9353 + 1978 6 1 49.0319 + 1978 7 1 49.1013 + 1978 8 1 49.1591 + 1978 9 1 49.2286 + 1978 10 1 49.3070 + 1978 11 1 49.4018 + 1978 12 1 49.4945 + 1979 1 1 49.5861 + 1979 2 1 49.6805 + 1979 3 1 49.7602 + 1979 4 1 49.8556 + 1979 5 1 49.9489 + 1979 6 1 50.0347 + 1979 7 1 50.1019 + 1979 8 1 50.1622 + 1979 9 1 50.2260 + 1979 10 1 50.2968 + 1979 11 1 50.3831 + 1979 12 1 50.4599 + 1980 1 1 50.5387 + 1980 2 1 50.6160 + 1980 3 1 50.6866 + 1980 4 1 50.7658 + 1980 5 1 50.8454 + 1980 6 1 50.9187 + 1980 7 1 50.9761 + 1980 8 1 51.0278 + 1980 9 1 51.0843 + 1980 10 1 51.1538 + 1980 11 1 51.2319 + 1980 12 1 51.3063 + 1981 1 1 51.3808 + 1981 2 1 51.4526 + 1981 3 1 51.5160 + 1981 4 1 51.5985 + 1981 5 1 51.6809 + 1981 6 1 51.7573 + 1981 7 1 51.8133 + 1981 8 1 51.8532 + 1981 9 1 51.9014 + 1981 10 1 51.9603 + 1981 11 1 52.0328 + 1981 12 1 52.0985 + 1982 1 1 52.1668 + 1982 2 1 52.2316 + 1982 3 1 52.2938 + 1982 4 1 52.3680 + 1982 5 1 52.4465 + 1982 6 1 52.5180 + 1982 7 1 52.5751 + 1982 8 1 52.6178 + 1982 9 1 52.6668 + 1982 10 1 52.7340 + 1982 11 1 52.8056 + 1982 12 1 52.8792 + 1983 1 1 52.9565 + 1983 2 1 53.0445 + 1983 3 1 53.1268 + 1983 4 1 53.2197 + 1983 5 1 53.3024 + 1983 6 1 53.3747 + 1983 7 1 53.4335 + 1983 8 1 53.4778 + 1983 9 1 53.5300 + 1983 10 1 53.5845 + 1983 11 1 53.6523 + 1983 12 1 53.7256 + 1984 1 1 53.7882 + 1984 2 1 53.8367 + 1984 3 1 53.8830 + 1984 4 1 53.9443 + 1984 5 1 54.0042 + 1984 6 1 54.0536 + 1984 7 1 54.0856 + 1984 8 1 54.1084 + 1984 9 1 54.1463 + 1984 10 1 54.1914 + 1984 11 1 54.2452 + 1984 12 1 54.2958 + 1985 1 1 54.3427 + 1985 2 1 54.3911 + 1985 3 1 54.4320 + 1985 4 1 54.4898 + 1985 5 1 54.5456 + 1985 6 1 54.5977 + 1985 7 1 54.6355 + 1985 8 1 54.6532 + 1985 9 1 54.6776 + 1985 10 1 54.7174 + 1985 11 1 54.7741 + 1985 12 1 54.8253 + 1986 1 1 54.8712 + 1986 2 1 54.9161 + 1986 3 1 54.9581 + 1986 4 1 54.9997 + 1986 5 1 55.0476 + 1986 6 1 55.0912 + 1986 7 1 55.1132 + 1986 8 1 55.1328 + 1986 9 1 55.1532 + 1986 10 1 55.1898 + 1986 11 1 55.2416 + 1986 12 1 55.2838 + 1987 1 1 55.3222 + 1987 2 1 55.3613 + 1987 3 1 55.4063 + 1987 4 1 55.4629 + 1987 5 1 55.5111 + 1987 6 1 55.5524 + 1987 7 1 55.5812 + 1987 8 1 55.6004 + 1987 9 1 55.6262 + 1987 10 1 55.6656 + 1987 11 1 55.7168 + 1987 12 1 55.7698 + 1988 1 1 55.8197 + 1988 2 1 55.8615 + 1988 3 1 55.9130 + 1988 4 1 55.9663 + 1988 5 1 56.0220 + 1988 6 1 56.0700 + 1988 7 1 56.0939 + 1988 8 1 56.1105 + 1988 9 1 56.1314 + 1988 10 1 56.1611 + 1988 11 1 56.2068 + 1988 12 1 56.2582 + 1989 1 1 56.3000 + 1989 2 1 56.3399 + 1989 3 1 56.3790 + 1989 4 1 56.4283 + 1989 5 1 56.4804 + 1989 6 1 56.5352 + 1989 7 1 56.5697 + 1989 8 1 56.5983 + 1989 9 1 56.6328 + 1989 10 1 56.6739 + 1989 11 1 56.7332 + 1989 12 1 56.7972 + 1990 1 1 56.8553 + 1990 2 1 56.9111 + 1990 3 1 56.9755 + 1990 4 1 57.0471 + 1990 5 1 57.1136 + 1990 6 1 57.1738 + 1990 7 1 57.2226 + 1990 8 1 57.2597 + 1990 9 1 57.3073 + 1990 10 1 57.3643 + 1990 11 1 57.4334 + 1990 12 1 57.5016 + 1991 1 1 57.5653 + 1991 2 1 57.6333 + 1991 3 1 57.6973 + 1991 4 1 57.7711 + 1991 5 1 57.8407 + 1991 6 1 57.9058 + 1991 7 1 57.9576 + 1991 8 1 57.9975 + 1991 9 1 58.0425 + 1991 10 1 58.1043 + 1991 11 1 58.1679 + 1991 12 1 58.2389 + 1992 1 1 58.3092 + 1992 2 1 58.3833 + 1992 3 1 58.4537 + 1992 4 1 58.5401 + 1992 5 1 58.6228 + 1992 6 1 58.6917 + 1992 7 1 58.7410 + 1992 8 1 58.7836 + 1992 9 1 58.8406 + 1992 10 1 58.8986 + 1992 11 1 58.9714 + 1992 12 1 59.0438 + 1993 1 1 59.1218 + 1993 2 1 59.2003 + 1993 3 1 59.2747 + 1993 4 1 59.3574 + 1993 5 1 59.4434 + 1993 6 1 59.5242 + 1993 7 1 59.5850 + 1993 8 1 59.6343 + 1993 9 1 59.6928 + 1993 10 1 59.7588 + 1993 11 1 59.8386 + 1993 12 1 59.9111 + 1994 1 1 59.9845 + 1994 2 1 60.0564 + 1994 3 1 60.1231 + 1994 4 1 60.2042 + 1994 5 1 60.2804 + 1994 6 1 60.3530 + 1994 7 1 60.4012 + 1994 8 1 60.4440 + 1994 9 1 60.4900 + 1994 10 1 60.5578 + 1994 11 1 60.6324 + 1994 12 1 60.7059 + 1995 1 1 60.7853 + 1995 2 1 60.8663 + 1995 3 1 60.9387 + 1995 4 1 61.0277 + 1995 5 1 61.1103 + 1995 6 1 61.1870 + 1995 7 1 61.2454 + 1995 8 1 61.2881 + 1995 9 1 61.3378 + 1995 10 1 61.4036 + 1995 11 1 61.4760 + 1995 12 1 61.5525 + 1996 1 1 61.6287 + 1996 2 1 61.6846 + 1996 3 1 61.7433 + 1996 4 1 61.8132 + 1996 5 1 61.8823 + 1996 6 1 61.9497 + 1996 7 1 61.9969 + 1996 8 1 62.0343 + 1996 9 1 62.0714 + 1996 10 1 62.1202 + 1996 11 1 62.1809 + 1996 12 1 62.2382 + 1997 1 1 62.2950 + 1997 2 1 62.3506 + 1997 3 1 62.3995 + 1997 4 1 62.4754 + 1997 5 1 62.5463 + 1997 6 1 62.6136 + 1997 7 1 62.6571 + 1997 8 1 62.6942 + 1997 9 1 62.7383 + 1997 10 1 62.7926 + 1997 11 1 62.8567 + 1997 12 1 62.9146 + 1998 1 1 62.9659 + 1998 2 1 63.0217 + 1998 3 1 63.0807 + 1998 4 1 63.1462 + 1998 5 1 63.2053 + 1998 6 1 63.2599 + 1998 7 1 63.2844 + 1998 8 1 63.2961 + 1998 9 1 63.3126 + 1998 10 1 63.3422 + 1998 11 1 63.3871 + 1998 12 1 63.4339 + 1999 1 1 63.4673 + 1999 2 1 63.4979 + 1999 3 1 63.5319 + 1999 4 1 63.5679 + 1999 5 1 63.6104 + 1999 6 1 63.6444 + 1999 7 1 63.6642 + 1999 8 1 63.6739 + 1999 9 1 63.6926 + 1999 10 1 63.7147 + 1999 11 1 63.7518 + 1999 12 1 63.7927 + 2000 1 1 63.8285 + 2000 2 1 63.8557 + 2000 3 1 63.8804 + 2000 4 1 63.9075 + 2000 5 1 63.9393 + 2000 6 1 63.9691 + 2000 7 1 63.9799 + 2000 8 1 63.9833 + 2000 9 1 63.9938 + 2000 10 1 64.0093 + 2000 11 1 64.0400 + 2000 12 1 64.0670 + 2001 1 1 64.0908 + 2001 2 1 64.1068 + 2001 3 1 64.1282 + 2001 4 1 64.1584 + 2001 5 1 64.1833 + 2001 6 1 64.2094 + 2001 7 1 64.2117 + 2001 8 1 64.2073 + 2001 9 1 64.2116 + 2001 10 1 64.2223 + 2001 11 1 64.2500 + 2001 12 1 64.2761 + 2002 1 1 64.2998 + 2002 2 1 64.3192 + 2002 3 1 64.3450 + 2002 4 1 64.3735 + 2002 5 1 64.3943 + 2002 6 1 64.4151 + 2002 7 1 64.4132 + 2002 8 1 64.4118 + 2002 9 1 64.4097 + 2002 10 1 64.4168 + 2002 11 1 64.4329 + 2002 12 1 64.4511 + 2003 1 1 64.4734 + 2003 2 1 64.4893 + 2003 3 1 64.5053 + 2003 4 1 64.5269 + 2003 5 1 64.5471 + 2003 6 1 64.5597 + 2003 7 1 64.5512 + 2003 8 1 64.5371 + 2003 9 1 64.5359 + 2003 10 1 64.5415 + 2003 11 1 64.5544 + 2003 12 1 64.5654 + 2004 1 1 64.5736 + 2004 2 1 64.5891 + 2004 3 1 64.6015 + 2004 4 1 64.6176 + 2004 5 1 64.6374 + 2004 6 1 64.6549 + 2004 7 1 64.6530 + 2004 8 1 64.6379 + 2004 9 1 64.6372 + 2004 10 1 64.6400 + 2004 11 1 64.6543 + 2004 12 1 64.6723 + 2005 1 1 64.6876 + 2005 2 1 64.7052 + 2005 3 1 64.7313 + 2005 4 1 64.7575 + 2005 5 1 64.7811 + 2005 6 1 64.8001 + 2005 7 1 64.7995 + 2005 8 1 64.7876 + 2005 9 1 64.7831 + 2005 10 1 64.7921 + 2005 11 1 64.8096 + 2005 12 1 64.8311 + 2006 1 1 64.8452 + 2006 2 1 64.8597 + 2006 3 1 64.8850 + 2006 4 1 64.9175 + 2006 5 1 64.9480 + 2006 6 1 64.9794 + 2006 7 1 64.9895 + 2006 8 1 65.0028 + 2006 9 1 65.0138 + 2006 10 1 65.0371 + 2006 11 1 65.0773 + 2006 12 1 65.1122 + 2007 1 1 65.1464 + 2007 2 1 65.1833 + 2007 3 1 65.2145 + 2007 4 1 65.2494 + 2007 5 1 65.2921 + 2007 6 1 65.3279 + 2007 7 1 65.3413 + 2007 8 1 65.3452 + 2007 9 1 65.3496 + 2007 10 1 65.3711 + 2007 11 1 65.3972 + 2007 12 1 65.4296 + 2008 1 1 65.4573 + 2008 2 1 65.4868 + 2008 3 1 65.5152 + 2008 4 1 65.5450 + 2008 5 1 65.5781 + 2008 6 1 65.6127 + 2008 7 1 65.6287 + 2008 8 1 65.6370 + 2008 9 1 65.6493 + 2008 10 1 65.6760 + 2008 11 1 65.7097 + 2008 12 1 65.7461 + 2009 1 1 65.7768 + 2009 2 1 65.8025 + 2009 3 1 65.8237 + 2009 4 1 65.8595 + 2009 5 1 65.8973 + 2009 6 1 65.9323 + 2009 7 1 65.9509 + 2009 8 1 65.9534 + 2009 9 1 65.9628 + 2009 10 1 65.9839 + 2009 11 1 66.0147 + 2009 12 1 66.0420 + 2010 1 1 66.0699 + 2010 2 1 66.0961 + 2010 3 1 66.1310 + 2010 4 1 66.1683 + 2010 5 1 66.2072 + 2010 6 1 66.2356 + 2010 7 1 66.2409 + 2010 8 1 66.2335 + 2010 9 1 66.2349 + 2010 10 1 66.2441 + 2010 11 1 66.2751 + 2010 12 1 66.3054 + 2011 1 1 66.3246 + 2011 2 1 66.3406 + 2011 3 1 66.3624 + 2011 4 1 66.3957 + 2011 5 1 66.4289 + 2011 6 1 66.4619 + 2011 7 1 66.4749 + 2011 8 1 66.4751 + 2011 9 1 66.4829 + 2011 10 1 66.5056 + 2011 11 1 66.5383 + 2011 12 1 66.5706 + 2012 1 1 66.6030 + 2012 2 1 66.6340 + 2012 3 1 66.6569 + 2012 4 1 66.6925 + 2012 5 1 66.7289 + 2012 6 1 66.7579 + 2012 7 1 66.7708 + 2012 8 1 66.7740 + 2012 9 1 66.7846 + 2012 10 1 66.8103 + 2012 11 1 66.8400 + 2012 12 1 66.8779 + 2013 1 1 66.9069 + 2013 2 1 66.9443 + 2013 3 1 66.9762 + 2013 4 1 67.0258 + 2013 5 1 67.0716 + 2013 6 1 67.1100 + 2013 7 1 67.1266 + 2013 8 1 67.1331 + 2013 9 1 67.1458 + 2013 10 1 67.1717 + 2013 11 1 67.2091 + 2013 12 1 67.2460 + 2014 1 1 67.2810 + 2014 2 1 67.3136 + 2014 3 1 67.3457 + 2014 4 1 67.3890 + 2014 5 1 67.4318 + 2014 6 1 67.4666 + 2014 7 1 67.4858 + 2014 8 1 67.4989 + 2014 9 1 67.5111 + 2014 10 1 67.5353 + 2014 11 1 67.5711 + 2014 12 1 67.6070 + 2015 1 1 67.6439 + 2015 2 1 67.6765 + 2015 3 1 67.7117 + 2015 4 1 67.7591 + 2015 5 1 67.8012 + 2015 6 1 67.8402 + 2015 7 1 67.8606 + 2015 8 1 67.8822 + 2015 9 1 67.9120 + 2015 10 1 67.9546 + 2015 11 1 68.0055 + 2015 12 1 68.0514 + 2016 1 1 68.1024 + 2016 2 1 68.1577 + 2016 3 1 68.2044 + 2016 4 1 68.2664 + 2016 5 1 68.3188 + 2016 6 1 68.3704 + 2016 7 1 68.3964 + 2016 8 1 68.4094 + 2016 9 1 68.4305 + 2016 10 1 68.4630 + 2016 11 1 68.5078 + 2016 12 1 68.5537 + 2017 1 1 68.5927 + 2017 2 1 68.6298 + 2017 3 1 68.6671 + 2017 4 1 68.7135 + 2017 5 1 68.7623 + 2017 6 1 68.8033 + 2017 7 1 68.8245 + 2017 8 1 68.8373 + 2017 9 1 68.8477 + 2017 10 1 68.8689 + 2017 11 1 68.9006 + 2017 12 1 68.9355 + 2018 1 1 68.9676 + 2018 2 1 68.9875 + 2018 3 1 69.0176 + 2018 4 1 69.0499 + 2018 5 1 69.0823 + 2018 6 1 69.1070 + 2018 7 1 69.1134 + 2018 8 1 69.1142 + 2018 9 1 69.1207 + 2018 10 1 69.1356 + 2018 11 1 69.1646 + 2018 12 1 69.1964 + 2019 1 1 69.2202 + 2019 2 1 69.2452 + 2019 3 1 69.2733 + 2019 4 1 69.3032 diff --git a/deltat.preds b/deltat.preds new file mode 100644 index 0000000..7a65c88 --- /dev/null +++ b/deltat.preds @@ -0,0 +1,37 @@ + MJD YEAR TT-UT Pred UT1-UTC Pred ERROR + 58484.000 2019.00 69.34 -0.152 0.117 + 58575.000 2019.25 69.48 -0.295 0.162 + 58666.000 2019.50 69.62 -0.440 0.215 + 58758.000 2019.75 69.71 -0.527 0.273 + 58849.000 2020.00 69.87 0.335 + 58940.000 2020.25 70.03 0.399 + 59032.000 2020.50 70.16 0.465 + 59123.000 2020.75 70.24 0.532 + 59214.000 2021.00 70.39 0.600 + 59306.000 2021.25 70.55 0.668 + 59397.000 2021.50 70.68 0.736 + 59488.000 2021.75 70.76 0.803 + 59580.000 2022.00 70.91 0.870 + 59671.000 2022.25 71.06 0.936 + 59762.000 2022.50 71.18 1.000 + 59853.000 2022.75 71.25 1.064 + 59945.000 2023.00 71.40 1.126 + 60036.000 2023.25 71.54 1.186 + 60127.000 2023.50 71.67 1.245 + 60219.000 2023.75 71.74 1.302 + 60310.000 2024.00 71.88 1.358 + 60401.000 2024.25 72.03 1.411 + 60493.000 2024.50 72.15 1.463 + 60584.000 2024.75 72.22 1.514 + 60675.000 2025.00 72.36 1.562 + 60767.000 2025.25 72.50 1.609 + 60858.000 2025.50 72.62 1.654 + 60949.000 2025.75 72.69 1.697 + 61041.000 2026.00 72.83 1.738 + 61132.000 2026.25 72.98 1.778 + 61223.000 2026.50 73.10 1.816 + 61314.000 2026.75 73.17 1.853 + 61406.000 2027.00 73.32 1.887 + 61497.000 2027.25 73.46 1.921 + 61588.000 2027.50 73.58 1.953 + 61680.000 2027.75 73.66 1.983 diff --git a/satnogs.py b/satnogs.py index 1b54726..070dfd5 100644 --- a/satnogs.py +++ b/satnogs.py @@ -7,7 +7,7 @@ from collections import defaultdict import random from apscheduler.schedulers.background import BackgroundScheduler from satnogs_api_client import fetch_satellites -from satnogs_api_client import DB_BASE_URL, get_paginated_endpoint +from satnogs_api_client.satnogs_api_client import DB_BASE_URL, get_paginated_endpoint from satellite_tle import fetch_tles from skyfield.api import EarthSatellite, utc, load import numpy @@ -37,27 +37,30 @@ def getFuture(): global Observations global TLEs observations = defaultdict(dict) - start = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z') - end = (datetime.utcnow() + timedelta(hours=1)) - end = end.strftime('%Y-%m-%dT%H:%M:%S%z') + Start = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z') + End = (datetime.utcnow() + timedelta(minutes=30)) + End = End.strftime('%Y-%m-%dT%H:%M:%S%z') passes = get_paginated_endpoint("https://network.satnogs.org/api/jobs/") - obs = get_paginated_endpoint("https://network.satnogs.org/api/observations/?end="+end+"&format=json&start="+start) - for x in tqdm(obs): - observations[x["id"]] = x + #obs = get_paginated_endpoint("https://network.satnogs.org/api/observations/?end="+end+"&format=json&start="+start) + #for x in tqdm(obs): + # observations[x["id"]] = x Observations = defaultdict(list) for x in tqdm(passes): - if x["id"] in observations: - try: - start = datetime.strptime(x["start"], '%Y-%m-%dT%H:%M:%Sz') - start = start.replace(tzinfo=utc) - end = datetime.strptime(x["end"], '%Y-%m-%dT%H:%M:%Sz') - end = end.replace(tzinfo=utc) + #if x["id"] in observations: + norad = int(x["tle1"].split(" ")[1].replace("U","")) + try: + start = datetime.strptime(x["start"], '%Y-%m-%dT%H:%M:%Sz') + start = start.replace(tzinfo=utc) + + end = datetime.strptime(x["end"], '%Y-%m-%dT%H:%M:%Sz') + end = end.replace(tzinfo=utc) # "transmitter":Transmitters[observations[x["id"]]["norad_cat_id"]][x["transmitter"]] - Observations[observations[x["id"]]["norad_cat_id"]].append({"station": x["ground_station"], "transmitter": Transmitters[observations[x["id"]]["norad_cat_id"]][x["transmitter"]], "start": start, "end": end, "id": x["id"]}) - TLEs[observations[x["id"]]["norad_cat_id"]] = [x["tle0"], x["tle1"], x["tle2"]] - StationsPasses[x["ground_station"]].append({"norad": observations[x["id"]]["norad_cat_id"], "transmitter": Transmitters[observations[x["id"]]["norad_cat_id"]][x["transmitter"]], "start": start, "end": end, "id": x["id"]}) - except Exception as e: - print("Error on observation number: " + str(x["id"]) + " " + str(e)) + if start < end: + Observations[norad].append({"station": x["ground_station"], "transmitter": Transmitters[norad][x["transmitter"]], "start": start, "end": end, "id": x["id"]}) + TLEs[norad] = EarthSatellite(x["tle1"], x["tle2"],x["tle0"]) + StationsPasses[x["ground_station"]].append({"norad": norad, "transmitter": Transmitters[norad][x["transmitter"]], "start": start, "end": end, "id": x["id"]}) + except Exception as e: + print("Error on observation number: " + str(x["id"]) + " "+str(norad)+" " + str(e)) print(str(len(Observations))+" Future passes found.") @@ -102,18 +105,20 @@ def updateTLE(): tles = fetch_tles(satnogs_db_norad_ids) TLEs = {} for norad_id, (source, tle) in tqdm(tles.items()): - TLEs[norad_id] = [str(tle[0]), str(tle[1]), str(tle[2])] + TLEs[norad_id] = EarthSatellite(tle[1], Ttle[2], tle[0]) print('\nTLEs for {} of {} requested satellites found ({} satellites with temporary norad ids skipped).'.format(len(tles), len(satnogs_db_norad_ids), len(temporary_norad_ids))) @scheduler.scheduled_job('interval', days=1) def updateTransmitters(): global Transmitters + global SatDescrip + SatDescrip = {} print("Updating Transmitters") temp = requests.get("https://db.satnogs.org/api/transmitters/").json() for x in tqdm(temp): Transmitters[x["norad_cat_id"]][x["uuid"]] = [x["description"], [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255), 255]] - + SatDescrip[x["norad_cat_id"]] = "" for x in Transmitters.keys(): for y in Transmitters[x].keys(): SatDescrip[x] += '
'+Transmitters[x][y][0]+'
' @@ -182,14 +187,13 @@ def updateCZML(): for y in Observations[x]: sat = {} sat["id"] = str(y["id"]) - sat["name"] = TLEs[x][0] + sat["name"] = TLEs[x].name sat["show"] = True sat["billboard"] = {"image": "static/sat.png", "scale": 0.50} sat["position"] = {} sat["position"]["cartographicDegrees"] = [] sat["description"] = SatDescrip[x] temp = y["start"] - satObj = EarthSatellite(TLEs[x][1], TLEs[x][2], TLEs[x][0]) time = 0 sat["position"]["interpolationAlgorithm"] = "LAGRANGE" sat["position"]["interpolationDegree"] = 5 @@ -197,7 +201,7 @@ def updateCZML(): sat["path"] = {"show": {"interval": (y["start"].isoformat()+"Z").replace("+00:00", "") + "/" + ((y["end"]).isoformat()+"Z").replace("+00:00", ""), "boolean": True}, "width": 2, "material": {"solidColor": {"color": {"rgba": [0, 255, 0, 255]}}}, "leadTime": 100000, "trailTime": 100000} while temp <= y["end"] + timedelta(seconds=1): - subpoint = satObj.at(ts.utc(temp)).subpoint() + subpoint = TLEs[x].at(ts.utc(temp)).subpoint() lat = subpoint.latitude.degrees lng = subpoint.longitude.degrees if numpy.isnan(lat): diff --git a/src/pip-delete-this-directory.txt b/src/pip-delete-this-directory.txt new file mode 100644 index 0000000..c8883ea --- /dev/null +++ b/src/pip-delete-this-directory.txt @@ -0,0 +1,5 @@ +This file is placed here by pip to indicate the source was put +here by pip. + +Once this package is successfully installed this source code will be +deleted (unless you remove this file). diff --git a/src/satnogs-api-client b/src/satnogs-api-client new file mode 160000 index 0000000..e20a7d3 --- /dev/null +++ b/src/satnogs-api-client @@ -0,0 +1 @@ +Subproject commit e20a7d3c98526edb55f0dd20f58a4295f09a7bff diff --git a/templates/index.html b/templates/index.html index b184872..77c8bcf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -39,7 +39,10 @@ Testing = Cesium.CzmlDataSource.load("/czmltest") document.getElementById("online").checked = true; Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwYmEwOTc5YS01N2I3LTRhYmQtOGE0MS1lNTkyMWU2ZmM3YWUiLCJpZCI6Njg1OCwic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU0NzU5ODkxOX0.p4alNyuyt_Eufuo8xX_SB6HKHuSixBTxgiVpD6UGI3Y'; - var viewer = new Cesium.Viewer('cesiumContainer',{shadows:true,timeline:false,vrButton:false,homeButton:false,animation:true,baseLayerPicker:false,navigationInstructionsInitiallyVisible:false,navigationHelpButton:false}); + var viewer = new Cesium.Viewer('cesiumContainer',{shadows:true,timeline:false,vrButton:false,homeButton:false,animation:true,baseLayerPicker:false,navigationInstructionsInitiallyVisible:false,navigationHelpButton:false,imageryProvider :new Cesium.MapboxImageryProvider({ + mapId: 'mapbox.streets', + accessToken: 'pk.eyJ1IjoiY2hpYmlsbCIsImEiOiJjanZ6bmZjenEwMjdzM3luMXMxd3FzenMwIn0.RF4gf01lBWmUiXZFZwUcbA' +})}); viewer.terrainProvider = Cesium.createWorldTerrain(); viewer.scene.globe.shadows=Cesium.ShadowMode.CAST_ONLY viewer.scene.globe.enableLighting = true @@ -61,7 +64,7 @@ download() update() -}, 1000*60*30); +}, 1000*60*15); function update(){ @@ -88,4 +91,4 @@ -Creative Commons License
This visual work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License Source Code is licensed under the AGPL license. Produced by William Gaylord KD9KCK +Creative Commons License
This visual work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License Source Code is licensed under the AGPL license. Produced by William Gaylord KD9KCK diff --git a/templates/rotating.html b/templates/rotating.html index aede9bd..78dff9a 100644 --- a/templates/rotating.html +++ b/templates/rotating.html @@ -21,9 +21,9 @@
- Online Stations?
- Offline Stations?
- Testing Stations?
+ Online Stations?
+ Offline Stations?
+ Testing Stations?