We develop app which should display earth map with satellite and satellite track. That's how plot looks like
We are using python and PySide6.QT for UI manipulation, for earth map plot with satellite we are using GroundTrackPotter. That library makes plot in browser.
I need put plot in central widget**(check image)
Class for app
class Window(QWidget, QQmlApplicationEngine):
def __init__(self):
super().__init__()
border_layout = BorderLayout()
plot_3d = self.get_3d_lpot()
border_layout.addWidget(plot_3d, Position.Center)
satellite_dropdown = self.create_dropdown_satellite()
border_layout.addWidget(satellite_dropdown, Position.West)
satellite_info = self.get_satellite_info()
border_layout.addWidget(satellite_info, Position.South)
self.setLayout(border_layout)
self.setWindowTitle("Satellite tracker")
@staticmethod
def create_label(text: str):
label = QLabel(text)
label.setFrameStyle(QFrame.Box | QFrame.Raised)
return label
@staticmethod
def create_dropdown_satellite():
widget = QComboBox()
widget.addItems(["KITSUNE", "BEESAT", "ITUPSAT"])
return widget
@staticmethod
def get_satellite_info():
satellite_info = satellite_state.get_satellite_param_string()
widget = QLabel(satellite_info)
return widget
@staticmethod
def get_3d_lpot():
*Here I need create widget for earth plot
return widget
Earth plotting:
gp = GroundtrackPlotter()
def get_orbit_plot(orbit: Orbit):
# Build spacecraft instance
satellite_spacecraft = EarthSatellite(orbit, None)
t_span = time_range(start=orbit.epoch - 1.5 * u.h, periods=150, end=orbit.epoch + 1.5 * u.h)
# Generate an instance of the plotter, add title and show latlon grid
gp.update_layout(title="International Space Station groundtrack")
# Plot previously defined EarthSatellite object
gp.plot(
satellite_spacecraft,
t_span,
label="Satellite",
color="red",
marker={"size": 10, "symbol": "triangle-right", "line": {"width": 1, "color": "black"}},
)
# For building geo traces
import plotly.graph_objects as go
# Faculty of Radiophysics and Computer Technologies coordinates
STATION = [53.83821551524637, 27.476136409973797] * u.deg
# Let us add a new trace in original figure
gp.add_trace(
go.Scattergeo(
lat=STATION[0],
lon=STATION[-1],
name="Faculty of Radiophysics and Computer Technologies",
marker={"color": "blue"},
)
)
gp.fig.show()
# Switch to three dimensional representation
gp.update_geos(projection_type="orthographic")
gp.fig.show()
def get_gp_value():
return gp
You can generate html using Figure from plotly and embed it in a QWebEngineView: