# In[3]:

roadster = Ephem.from_horizons(
    "SpaceX Roadster",
    epochs=time_range(EPOCH, end=EPOCH + 360 * u.day),
    attractor=Sun,
    plane=Planes.EARTH_ECLIPTIC,
    id_type="majorbody",
)
roadster

# In[4]:

from poliastro.plotting.misc import plot_solar_system

# In[5]:

frame = plot_solar_system(outer=False, epoch=EPOCH)
frame.plot_ephem(roadster, EPOCH, label="SpaceX Roadster", color="black")

# In[6]:

frame = OrbitPlotter3D(plane=Planes.EARTH_ECLIPTIC)

frame.plot_body_orbit(Earth, EPOCH)
frame.plot_body_orbit(Mars, EPOCH)

frame.plot_ephem(roadster, EPOCH, label="SpaceX Roadster", color="black")

frame.set_view(45 * u.deg, -120 * u.deg, 4 * u.km)
예제 #2
0
def test_plot_outer_solar_system_static():
    plot_solar_system(outer=True,
                      epoch=Time("2020-03-29 12:00:00", scale="tdb"))

    return plt.gcf()
예제 #3
0
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
    assert len(plot_solar_system(outer).trajectories) == expected
예제 #4
0
def test_plot_solar_system_uses_expected_orbitplotter(use_3d, plotter_class):
    assert isinstance(plot_solar_system(use_3d=use_3d, interactive=True),
                      plotter_class)
예제 #5
0
def test_plot_solar_system_has_expected_number_of_orbits(outer, expected):
    assert len(plot_solar_system(outer).trajectories) == expected
예제 #6
0
def test_plot_solar_system_uses_expected_orbitplotter(use_3d, plotter_class):
    assert isinstance(plot_solar_system(use_3d=use_3d), plotter_class)
예제 #7
0
def test_plot_outer_solar_system_static(earth_perihelion):
    plot_solar_system(outer=True, epoch=earth_perihelion)

    return plt.gcf()
예제 #8
0
def test_plot_solar_system_raises_error_if_use_3d_and_non_interactive():
    with pytest.raises(ValueError) as excinfo:
        plot_solar_system(use_3d=True)
    assert "The static plotter does not support 3D" in excinfo.exconly()