sites for gnss, beidou, galileo, gps, glonass
parent
c5d8c2c699
commit
e1daf87c66
20
README.md
20
README.md
|
@ -20,6 +20,26 @@ pip3 install --user --upgrade -r requirements.txt
|
|||
Need to get `cesium.key` from Cesium ION.
|
||||
|
||||
|
||||
# Scripts
|
||||
The following scripts are available for websites:
|
||||
|
||||
* `gnss-earth.py` --- All satellites
|
||||
* `beidou-earth.py` --- Beidou (China) satellites
|
||||
* `galileo-earth.py` --- Galileo (Europe) satellites
|
||||
* `glonass-earth.py` --- GLONASS (Russia) satellites
|
||||
* `gps-earth.py` --- GPS (USA) satellites
|
||||
|
||||
|
||||
# Websites
|
||||
Websites available for viewing.
|
||||
|
||||
* https://gnss.spacecruft.org/
|
||||
* https://beidou.spacecruft.org/
|
||||
* https://galileo.spacecruft.org/
|
||||
* https://gps.spacecruft.org/
|
||||
* https://glonass.spacecruft.org/
|
||||
|
||||
|
||||
# Upstream Dependencies
|
||||
Uses:
|
||||
|
||||
|
|
|
@ -10,14 +10,6 @@ from datetime import datetime, timedelta
|
|||
from satellite_czml import satellite_czml
|
||||
from satellite_czml import satellite
|
||||
|
||||
# GNSS
|
||||
#url = 'https://celestrak.com/NORAD/elements/gnss.txt'
|
||||
# GPS Operational
|
||||
#url = 'https://celestrak.com/NORAD/elements/gps-ops.txt'
|
||||
# Galileo
|
||||
#url = 'https://celestrak.com/NORAD/elements/galileo.txt'
|
||||
# GLONASS Operational
|
||||
#url = 'https://celestrak.com/NORAD/elements/glo-ops.txt'
|
||||
# Beidou
|
||||
url = 'https://celestrak.com/NORAD/elements/beidou.txt'
|
||||
|
||||
|
@ -25,24 +17,21 @@ apikey = open('cesium.key').read().strip()
|
|||
|
||||
tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()]
|
||||
tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0]
|
||||
small_tle_list = tle_list[:4]
|
||||
small_tle_list
|
||||
|
||||
single_tle = [tle_list[0]]
|
||||
single_czml = satellite_czml(tle_list=single_tle).get_czml()
|
||||
multiple_czml = satellite_czml(tle_list=tle_list).get_czml()
|
||||
|
||||
# DASH
|
||||
external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css']
|
||||
external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}]
|
||||
|
||||
app = dash.Dash(__name__,
|
||||
title='Spacecruft GNSS Earth',
|
||||
title='Spacecruft Beidou Earth',
|
||||
external_scripts=external_scripts,
|
||||
external_stylesheets=external_css)
|
||||
|
||||
app.layout = html.Div(children=[
|
||||
html.Div(id='cesiumContainer'),
|
||||
html.Div(id='czml', style={'display': 'none'}, children=single_czml),
|
||||
html.Div(id='czml', style={'display': 'none'}, children=multiple_czml),
|
||||
html.Div(id='apikey', style={'display': 'none'}, children=apikey),
|
||||
])
|
||||
|
||||
|
@ -76,5 +65,5 @@ function(id, czml, apikey) {
|
|||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run_server(debug=True, use_reloader=False)
|
||||
app.run_server(debug=False, port=8051, use_reloader=False)
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -10,16 +10,8 @@ from datetime import datetime, timedelta
|
|||
from satellite_czml import satellite_czml
|
||||
from satellite_czml import satellite
|
||||
|
||||
# GNSS
|
||||
url = 'https://celestrak.com/NORAD/elements/gnss.txt'
|
||||
# GPS Operational
|
||||
#url = 'https://celestrak.com/NORAD/elements/gps-ops.txt'
|
||||
# Galileo
|
||||
#url = 'https://celestrak.com/NORAD/elements/galileo.txt'
|
||||
# GLONASS Operational
|
||||
#url = 'https://celestrak.com/NORAD/elements/glo-ops.txt'
|
||||
# Beidou
|
||||
#url = 'https://celestrak.com/NORAD/elements/beidou.txt'
|
||||
url = 'https://celestrak.com/NORAD/elements/galileo.txt'
|
||||
|
||||
apikey = open('cesium.key').read().strip()
|
||||
|
||||
|
@ -33,13 +25,12 @@ external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesiu
|
|||
external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}]
|
||||
|
||||
app = dash.Dash(__name__,
|
||||
title='Spacecruft GNSS Earth',
|
||||
title='Spacecruft Galileo Earth',
|
||||
external_scripts=external_scripts,
|
||||
external_stylesheets=external_css)
|
||||
|
||||
app.layout = html.Div(children=[
|
||||
html.Div(id='cesiumContainer'),
|
||||
#html.Div(id='czml', style={'display': 'none'}, children=single_czml),
|
||||
html.Div(id='czml', style={'display': 'none'}, children=multiple_czml),
|
||||
html.Div(id='apikey', style={'display': 'none'}, children=apikey),
|
||||
])
|
||||
|
@ -74,5 +65,5 @@ function(id, czml, apikey) {
|
|||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run_server(debug=False, use_reloader=False)
|
||||
app.run_server(debug=False, port=8052, use_reloader=False)
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import random
|
||||
import urllib.request
|
||||
import dash
|
||||
from dash import html
|
||||
from dash import dcc
|
||||
from dash.dependencies import Input, Output
|
||||
from datetime import datetime, timedelta
|
||||
from satellite_czml import satellite_czml
|
||||
from satellite_czml import satellite
|
||||
|
||||
# GLONASS
|
||||
url = 'https://celestrak.com/NORAD/elements/glo-ops.txt'
|
||||
|
||||
apikey = open('cesium.key').read().strip()
|
||||
|
||||
tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()]
|
||||
tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0]
|
||||
|
||||
multiple_czml = satellite_czml(tle_list=tle_list).get_czml()
|
||||
|
||||
# DASH
|
||||
external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css']
|
||||
external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}]
|
||||
|
||||
app = dash.Dash(__name__,
|
||||
title='Spacecruft GLONASS Earth',
|
||||
external_scripts=external_scripts,
|
||||
external_stylesheets=external_css)
|
||||
|
||||
app.layout = html.Div(children=[
|
||||
html.Div(id='cesiumContainer'),
|
||||
html.Div(id='czml', style={'display': 'none'}, children=multiple_czml),
|
||||
html.Div(id='apikey', style={'display': 'none'}, children=apikey),
|
||||
])
|
||||
|
||||
app.clientside_callback(
|
||||
'''
|
||||
function(id, czml, apikey) {
|
||||
// Create the Cesium Viewer
|
||||
if (!window.viewer) {
|
||||
Cesium.Ion.defaultAccessToken = apikey;
|
||||
window.viewer = new Cesium.Viewer(id,{
|
||||
shouldAnimate: false,
|
||||
});
|
||||
window.viewer.scene.globe.enableLighting = true;
|
||||
}
|
||||
|
||||
// Update the Cesium Viewer
|
||||
if (czml) {
|
||||
window.viewer.dataSources.removeAll();
|
||||
czmlJson = JSON.parse(czml);
|
||||
window.viewer.dataSources.add(
|
||||
Cesium.CzmlDataSource.load(czmlJson)
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
''',
|
||||
Output('cesiumContainer', 'data-done'),
|
||||
Input('cesiumContainer', 'id'),
|
||||
Input('czml', 'children'),
|
||||
Input('apikey', 'children')
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run_server(debug=False, port=8054, use_reloader=False)
|
||||
|
|
@ -10,68 +10,25 @@ from datetime import datetime, timedelta
|
|||
from satellite_czml import satellite_czml
|
||||
from satellite_czml import satellite
|
||||
|
||||
# GNSS
|
||||
url = 'https://celestrak.com/NORAD/elements/gnss.txt'
|
||||
# GPS Operational
|
||||
#url = 'https://celestrak.com/NORAD/elements/gps-ops.txt'
|
||||
# Galileo
|
||||
#url = 'https://celestrak.com/NORAD/elements/galileo.txt'
|
||||
# GLONASS Operational
|
||||
#url = 'https://celestrak.com/NORAD/elements/glo-ops.txt'
|
||||
# Beidou
|
||||
#url = 'https://celestrak.com/NORAD/elements/beidou.txt'
|
||||
|
||||
apikey = open('cesium.key').read().strip()
|
||||
|
||||
tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()]
|
||||
tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0]
|
||||
|
||||
multiple_czml = satellite_czml(tle_list=tle_list).get_czml()
|
||||
|
||||
name_list = [t[0] for t in tle_list]
|
||||
description_list = ['Station: ' + t[0] for t in tle_list]
|
||||
color_list = [[random.randrange(256) for x in range(3)] for x in range(len(tle_list))]
|
||||
size_list = [7] * len(tle_list)
|
||||
|
||||
czml_obj = satellite_czml(tle_list=tle_list, name_list=name_list, description_list=description_list,
|
||||
color_list=color_list, speed_multiplier=1, use_default_image=False,
|
||||
marker_scale_list=size_list, show_label=False, show_path=False,
|
||||
ignore_bad_tles=True)
|
||||
multiple_czml_p = czml_obj.get_czml()
|
||||
|
||||
multiple_sats=[]
|
||||
for tle in tle_list:
|
||||
sat = satellite(tle,
|
||||
description='Station: ' + tle[0],
|
||||
color = [random.randrange(256) for x in range(3)],
|
||||
marker_scale=12,
|
||||
use_default_image=False,
|
||||
start_time=datetime.strptime('2020-01-01 00:00:00','%Y-%m-%d %H:%M:%S'),
|
||||
end_time=datetime.strptime('2020-01-01 01:00:00','%Y-%m-%d %H:%M:%S'),
|
||||
show_label=True,
|
||||
show_path=True,
|
||||
)
|
||||
multiple_sats.append(sat)
|
||||
|
||||
czml_obj = satellite_czml(satellite_list=multiple_sats)
|
||||
multiple_czml_c = czml_obj.get_czml()
|
||||
|
||||
last_sat_key = list(czml_obj.satellites.keys())[-1]
|
||||
last_sat = czml_obj.satellites[last_sat_key]
|
||||
|
||||
# Change the path to display the orbit path
|
||||
last_sat.build_path(rebuild=True,
|
||||
show=True,
|
||||
color=[255, 255, 0, 127],
|
||||
width=3
|
||||
)
|
||||
|
||||
# Change the label look
|
||||
last_sat.build_label(rebuild=True,
|
||||
show=True,
|
||||
font='12pt Arial',
|
||||
color=[255, 255, 0, 200],
|
||||
outlineColor=[0, 0, 0, 127],
|
||||
outlineWidth=3,
|
||||
)
|
||||
|
||||
# Change the marker (billboard)
|
||||
last_sat.build_marker(rebuild=True,
|
||||
size=18,
|
||||
outlineColor=[0, 0, 0, 128],
|
||||
)
|
||||
|
||||
modified_czml = czml_obj.get_czml()
|
||||
|
||||
# DASH
|
||||
external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css']
|
||||
external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}]
|
||||
|
||||
|
@ -81,26 +38,14 @@ app = dash.Dash(__name__,
|
|||
external_stylesheets=external_css)
|
||||
|
||||
app.layout = html.Div(children=[
|
||||
dcc.Dropdown(id='choose_czml_dd',
|
||||
options=[
|
||||
{'label': 'Multiple CZML', 'value': 'multiple_czml'}
|
||||
],
|
||||
value='multiple_czml'
|
||||
),
|
||||
html.Div(id='cesiumContainer'),
|
||||
html.Div(id='czml', style={'display': 'none'}),
|
||||
html.Div(id='apikey', style={'display': 'none'}, children=apikey)
|
||||
#html.Div(id='czml', style={'display': 'none'}, children=single_czml),
|
||||
html.Div(id='czml', style={'display': 'none'}, children=multiple_czml),
|
||||
html.Div(id='apikey', style={'display': 'none'}, children=apikey),
|
||||
])
|
||||
|
||||
@app.callback(
|
||||
Output('czml', 'children'),
|
||||
Input('choose_czml_dd', 'value'))
|
||||
def update_satellite_filter(v):
|
||||
d = {'multiple_czml':multiple_czml
|
||||
}
|
||||
return d[v]
|
||||
|
||||
app.clientside_callback('''
|
||||
app.clientside_callback(
|
||||
'''
|
||||
function(id, czml, apikey) {
|
||||
// Create the Cesium Viewer
|
||||
if (!window.viewer) {
|
||||
|
@ -119,9 +64,9 @@ function(id, czml, apikey) {
|
|||
Cesium.CzmlDataSource.load(czmlJson)
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}''',
|
||||
}
|
||||
''',
|
||||
Output('cesiumContainer', 'data-done'),
|
||||
Input('cesiumContainer', 'id'),
|
||||
Input('czml', 'children'),
|
||||
|
@ -129,5 +74,5 @@ function(id, czml, apikey) {
|
|||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run_server(debug=True, use_reloader=False)
|
||||
app.run_server(debug=False, use_reloader=False)
|
||||
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import random
|
||||
import urllib.request
|
||||
import dash
|
||||
from dash import html
|
||||
from dash import dcc
|
||||
from dash.dependencies import Input, Output
|
||||
from datetime import datetime, timedelta
|
||||
from satellite_czml import satellite_czml
|
||||
from satellite_czml import satellite
|
||||
|
||||
# GPS
|
||||
url = 'https://celestrak.com/NORAD/elements/gps-ops.txt'
|
||||
|
||||
apikey = open('cesium.key').read().strip()
|
||||
|
||||
tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()]
|
||||
tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0]
|
||||
|
||||
multiple_czml = satellite_czml(tle_list=tle_list).get_czml()
|
||||
|
||||
# DASH
|
||||
external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css']
|
||||
external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}]
|
||||
|
||||
app = dash.Dash(__name__,
|
||||
title='Spacecruft GPS Earth',
|
||||
external_scripts=external_scripts,
|
||||
external_stylesheets=external_css)
|
||||
|
||||
app.layout = html.Div(children=[
|
||||
html.Div(id='cesiumContainer'),
|
||||
html.Div(id='czml', style={'display': 'none'}, children=multiple_czml),
|
||||
html.Div(id='apikey', style={'display': 'none'}, children=apikey),
|
||||
])
|
||||
|
||||
app.clientside_callback(
|
||||
'''
|
||||
function(id, czml, apikey) {
|
||||
// Create the Cesium Viewer
|
||||
if (!window.viewer) {
|
||||
Cesium.Ion.defaultAccessToken = apikey;
|
||||
window.viewer = new Cesium.Viewer(id,{
|
||||
shouldAnimate: false,
|
||||
});
|
||||
window.viewer.scene.globe.enableLighting = true;
|
||||
}
|
||||
|
||||
// Update the Cesium Viewer
|
||||
if (czml) {
|
||||
window.viewer.dataSources.removeAll();
|
||||
czmlJson = JSON.parse(czml);
|
||||
window.viewer.dataSources.add(
|
||||
Cesium.CzmlDataSource.load(czmlJson)
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
''',
|
||||
Output('cesiumContainer', 'data-done'),
|
||||
Input('cesiumContainer', 'id'),
|
||||
Input('czml', 'children'),
|
||||
Input('apikey', 'children')
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run_server(debug=False, port=8053, use_reloader=False)
|
||||
|
Loading…
Reference in New Issue