Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot never generates #12

Open
a-imhof-1 opened this issue Oct 8, 2024 · 0 comments
Open

Plot never generates #12

a-imhof-1 opened this issue Oct 8, 2024 · 0 comments

Comments

@a-imhof-1
Copy link

I have the exact Drawing Earth satellite groundtracks example written in Spyder but when I run the script the graphic never generates.

Useful for defining quantities

from astropy import units as u

Earth focused modules, ISS example orbit and time span generator

from hapsira.earth import EarthSatellite
from hapsira.earth.plotting import GroundtrackPlotter
from hapsira.examples import iss
from hapsira.util import time_range

Build spacecraft instance

iss_spacecraft = EarthSatellite(iss, None)
t_span = time_range(
iss.epoch - 1.5 * u.h, num_values=150, end=iss.epoch + 1.5 * u.h
)

Generate an instance of the plotter, add title and show latlon grid

gp = GroundtrackPlotter()
gp.update_layout(title="International Space Station groundtrack")

Plot previously defined EarthSatellite object

gp.plot(
iss_spacecraft,
t_span,
label="ISS",
color="red",
marker={
"size": 10,
"symbol": "triangle-right",
"line": {"width": 1, "color": "black"},
},
)

For building geo traces

import plotly.graph_objects as go

Position in [LAT LON]

STATION = [40.416729, -3.703339] * u.deg

Let us add a new trace in original figure

gp.add_trace(
go.Scattergeo(
lat=STATION[0],
lon=STATION[-1],
name="Madrid",
marker={"color": "blue"},
)
)
gp.fig.show()

I have tested other examples like the Quickstart and was able to reproduce the same graphic, but I'm not sure why the ground tracks example does not produce anything. The console does not print any errors or messages after the script has run.

Any advice would be greatly appreciated and I do apologize of there is a simple mistake I am making.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant