From 8b85cb77a96ea404bd63527cf481a30ba1cb035a Mon Sep 17 00:00:00 2001 From: Jeff Moe Date: Sun, 12 Jun 2022 21:54:47 -0600 Subject: [PATCH] Add GNSS Leaflet script --- galmon-gnss2leaflet | 95 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 galmon-gnss2leaflet diff --git a/galmon-gnss2leaflet b/galmon-gnss2leaflet new file mode 100755 index 0000000..308b64f --- /dev/null +++ b/galmon-gnss2leaflet @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 +""" + galmon-gnss2leaflet + Retrieve Galmon GNSS satellites, output HTML map with leaflet. + + Copyright (C) 2022, Jeff Moe + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +""" + +# Usage: +# galmon-gnss2leaflet +# Example: +# ./galmon-gnss2leaflet > ./html/gnss.html +# firefox ./html/gnss.html + +import pandas as pd + +# Grab live file: +#almanac_url='https://galmon.eu/almanac.json' +# Or use cached file: +almanac_url='data/almanac.json' + +almanac = pd.read_json(almanac_url, orient='index') + +def print_header(): + print('') + print('') + print(' ') + print(' ') + print(' ') + print(' ') + print(' ') + print(' ') + print(' ') + print(' ') + print('
') + print(' ') + print(' ') + print('') + +def main(): + print_header() + print_body() + print_footer() + +if __name__ == "__main__": + main();