Skip to content
New issue

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

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

Already on GitHub? # to your account

Add trajectories of bodies #9

Open
jgieseler opened this issue Jun 1, 2022 · 3 comments
Open

Add trajectories of bodies #9

jgieseler opened this issue Jun 1, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@jgieseler
Copy link
Owner

Provide the option to provide (plot) trajectories of bodies. For example, over 24 hours plot the hourly positions of Parker Solar Probe, connecting them with a line. This line could also have some color/saturation coding to allow for time-dependency.

@jgieseler jgieseler added the enhancement New feature or request label Jun 1, 2022
@jgieseler
Copy link
Owner Author

An example of this would be the following figure from @cmoestl:

Twitter image

@jgieseler
Copy link
Owner Author

jgieseler commented Sep 16, 2022

Example code from sunpy that is going into this direction (source):

import numpy as np
from sunpy.coordinates import frames, get_body_heliographic_stonyhurst, get_horizons_coord, transform_with_sun_center
from sunpy.time import parse_time
from astropy import units as u

perihelion_time = parse_time("2022-03-26")
perihelion_seq = perihelion_time + np.arange(-30, 30)*u.day

solo_coord = get_horizons_coord("solar orbiter", perihelion_seq)
psp_coord = get_horizons_coord("psp", perihelion_seq)
sdo_coord = get_horizons_coord("sdo", perihelion_seq)

fig = plt.figure(dpi=120)
ax = fig.add_subplot(projection='polar')

# Transform to HGS
psp_coord_hgs = psp_coord.heliocentricinertial
solo_coord_hgs = solo_coord.heliocentricinertial
sdo_coord_hgs = sdo_coord.heliocentricinertial

ax.plot(psp_coord_hgs.lon.to('rad'), psp_coord_hgs.distance, '.-', markersize=5, label='PSP')
ax.plot(solo_coord_hgs.lon.to('rad'), solo_coord_hgs.distance, '.', markersize=5, label='SolO')
ax.plot(sdo_coord_hgs.lon.to('rad'), sdo_coord_hgs.distance, '.', markersize=5, label='SDO')

ax.legend(loc='lower right')
ax.set_theta_zero_location("S")
ax.set_title('Positions in Heliographic Stonyhurst (HGS)')
plt.show()

Figure_1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant