Nutze Skyfield fuer praezisere Daemmerungsberechnung

This commit is contained in:
2026-07-13 19:35:39 +02:00
parent dc5292735f
commit 97357a88e0
1092 changed files with 370248 additions and 61 deletions
+22
View File
@@ -0,0 +1,22 @@
"""Alpha 5 encoding of satellite numbers to fit in 5 characters."""
def to_alpha5(n):
if n < 100000:
return '%05d' % n
if n > 339999:
raise ValueError('satellite number cannot exceed 339999,'
" whose Alpha 5 encoding is 'Z9999'")
i, n = divmod(n, 10000)
i += ord('A') - 10
if i >= ord('I'): i += 1
if i >= ord('O'): i += 1
return '%c%04d' % (i, n)
def from_alpha5(s):
if not s[0].isalpha():
return int(s)
c, s = s[0], s[1:]
n = ord(c) - ord('A') + 10
n -= c > 'I'
n -= c > 'O'
return n * 10000 + int(s)