-
-
Notifications
You must be signed in to change notification settings - Fork 282
Ground Track Plotter #497
Comments
Hi @IngenieroDeAviones, thanks a lot for the suggestion! I recommend you to check out this notebook of mine: In particular, Cartopy will help you a lot projecting lat/lon data in the right way, avoiding all sorts of singularities. Also, avoid basemap because it's abandoned: https://matplotlib.org/basemap/users/intro.html#cartopy-new-management-and-eol-announcement And finally, to create a really cool 3D version: https://plot.ly/python/lines-on-maps/#contour-lines-on-globe |
Wow! That was exactly the idea I had on my mind! Hope to finish this night the #491 API Docs 📓 and start reading in detail all the information in previous links to complete this plotting enhancement 😄 |
Finally I was able to get a beautiful plot based on However, it should be shifting towards West due to Earth's rotation. May this be a good starting point for trying to improve the |
That's right @IngenieroDeAviones, we will need proper frame support for this. To clarify, there is already an Earth-rotating frame: ITRF. However, what we need in poliastro is two things (which can be done separately):
With 1) we should be able to leverage ITRF already and produce correct groundtrack plots, but it has to be general enough to allow for 2). Are you up to the challenge? 😉 |
See also #429. |
To transform a from astropy.coordinates import ITRS
r = [-6045, -3490, 2500] * u.km
v = [-3.457, 6.618, 2.533] * u.km / u.s
ss_gcrs = Orbit.from_vectors(Earth, r, v) #Orbit in GCRS
t_span = np.linspace(0, 24, 24*60) * u.h #Time span for each minute within 24 hours
pos_gcrs = ss_gcrs.sample(t_span) #astropy.coordinates.builtin_frames.gcrs.GCRS
pos_itrs = pos_gcrs.transform_to(ITRS) #astropy.coordinates.builtin_frames.itrs.ITRS
coord_itrs = pos_itrs.spherical #Convert to spherical
lon, lat = coord_itrs.lon, coord_itrs.lat #Just calling atributes However, I got this plot: A closer look: Not sure what is going on here, because propagation is done with |
That orbit is a bit low, isn't it? The position vector suggests that you
didn't take the Earth radius into account 😉
…On Fri, 23 Nov 2018, 20:53 Jorge Martinez ***@***.*** wrote:
Are you up to the challenge? I am up for it, Sir! 😄 I will try to work
on #434 <#434> from now on,
but before, I did the following:
To transform a GCRS frame orbit (after being propagated) into ITRF frame
orbit:
from astropy.coordinates import ITRS
r = [-6045, -3490, 2500] * u.km
v = [-3.457, 6.618, 2.533] * u.km / u.s
ss_gcrs = Orbit.from_vectors(Earth, r, v) #Orbit in GCRS
t_span = np.linspace(0, 24, 24*60) * u.h #Time span for each minute within 24 hours
pos_gcrs = ss_gcrs.sample(t_span) #astropy.coordinates.builtin_frames.gcrs.GCRS
pos_itrs = pos_gcrs.transform_to(ITRS) #astropy.coordinates.builtin_frames.itrs.ITRS
coord_itrs = pos_itrs.spherical #Convert to spherical
lon, lat = coord_itrs.lon, coord_itrs.lat #Just calling atributes
However, I got this plot:
[image: plot_1]
<https://user-images.githubusercontent.com/28702884/48958694-2667c080-ef61-11e8-932b-194c4ff1796a.png>
A closer look:
[image: plot_2]
<https://user-images.githubusercontent.com/28702884/48958701-2ebffb80-ef61-11e8-8741-ad03e83534df.png>
Not sure what is going on here, because propagation is done with GCRS. I
am missing something.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#497 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATUZSShEHCjdR2YCIkyMJFJk4qwZ4E0ks5uyFJQgaJpZM4YsAuC>
.
|
I updated the status of this issue because a past comment of mine contained a mistake. In particular, the two blockers are #109 and #451, which are kind of the same problem. At the moment, we could of course perform groundtrack plotting using ITRF as defined in Astropy, but in poliastro we try not to include features that apply only to the Earth, so we should take the planetary frames and properly define them using the astropy.coordinates machinery. Also, @jorgepiloto already tried to build a prototype but something was not quite working, as can be seen in the plots above. For anyone willing to work on this issue, showing a proper groundtrack would be a good starting point. |
@Juanlu001 As discussed in the email, I'm willing to work on this issue. Will update the comment upon reception of a positive result. |
I adjusted @jorgepiloto code and I seem to get a proper groundtrack: Perhaps the key is using the right projection: https://scitools.org.uk/cartopy/docs/latest/matplotlib/intro.html#adding-data-to-the-map While working with Cartopy, please note that it can be challenging to install. |
True! I got it in #497 (comment), can you share a https://gist.github.com? |
Sure! There it goes: https://gist.github.com/jorgepiloto/acb36f0b995bf7f9619ca605bef1581d |
I can reproduce this plot, but not exactly sure what changed. Investigating. |
Aha! You are missing the # Transform GCRS to ITRS
ss_gcrs = ss.sample()
ss_itrs = ss_gcrs.transform_to(coord.ITRS(obstime=ss_gcrs.obstime)) |
Oh! I thought the conversion between GCRS and ITRS did not need any extra parameters, that everything has done by itself 🤔 Thank you so much! Still working on this... 🚀 |
I would call it Some questions:
|
Sure, Related with different attractors, it is something I still have to deal with. I thought about imposing for the moment that the only valid attractor was Earth till I found a better solution. When talking about plot only coordinates, you mean that user should do the propagation for sampling the orbit positions and then pass them to the |
Regarding the attractors: sounds fair! Regarding the API: yes, that was my thinking! |
@Sedictious is working on a complementary approach using Cesium in #739 |
Going back to this, I think Plotly would be a compelling alternative to Cartopy in terms of ease of installation: https://plotly.com/python/lines-on-maps/ |
Hi @astrojuanlu , I am done with my exams now i can start working again on #953. Also this is based on plotly only ;). |
As discussed in official poliastro-earth chat, this feature might be placed under |
After two years, this feature has been implemented. I think this was one of my first issues at poliastro. Please, if you find any king of bug or would like to extend its functionalities, open an issue or contact developers through official channels 🚀 |
I am soo glad this has been implemented. 😃 |
Hi everyone, I have an idea to generalize the reference attractor: |
Hi @FrancescoColombi, glad you like this new feature! Using the orientation of the prime meridian and the rotation rate of the attractor sounds like a good idea for generalizing this, I'll open a new issue. |
🎯 Objective
Hi everyone,
I thought it would be interesting to include a "Ground Track Plotter" in the module of
poliastro.plotting
. It works in the same way as the other functions of this module: you just have to call a function calledgroundTrack
that takes as arguments anorbit
,label
with the possibility of using thedark
mode.🖥 Previous figure tries to plot the following orbit:
Till here everything works as it should. However, once I pass the function an
Orbit
object, I obtain really strange ground tracks:Notice that horizontal dashed lines are just for plotting Cancer and Capricorn Tropics.
💡 Possible solutions
If the idea is interesting for
poliastro
community, I will make a pull request but probably will need some help with the conversions between reference systems. I think the problem may be here, since if you try to plot just a latitude and longitude it works perfectly, showing that exact point on map.Cape Canaveral Coordinates
lat = 28.396837
lon = -80.605659
The text was updated successfully, but these errors were encountered: