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

Bug when plotting State with non canonical units #110

Closed
astrojuanlu opened this issue Jan 24, 2016 · 1 comment
Closed

Bug when plotting State with non canonical units #110

astrojuanlu opened this issue Jan 24, 2016 · 1 comment
Labels
bug
Milestone

Comments

@astrojuanlu
Copy link
Member

@astrojuanlu astrojuanlu commented Jan 24, 2016

Steps to reproduce:

r, v = ephem.planet_ephem(ephem.EARTH, epoch)
earth_as_is = State.from_vectors(Sun, r, v, epoch)
earth_canonical = State.from_vectors(Sun, r.to(u.km), v.to(u.km / u.s), epoch)
op = OrbitPlotter()
op.plot(earth_canonical)
#op.plot(earth_as_is)  # Very bad!

I still have to figure out what's going on.

@astrojuanlu astrojuanlu added the bug label Jan 24, 2016
@astrojuanlu astrojuanlu added this to the 0.5 milestone Jan 24, 2016
@astrojuanlu
Copy link
Member Author

@astrojuanlu astrojuanlu commented Jan 24, 2016

The failure is in the pqw() method:

>>> earth_as_is.pqw()
(<Quantity [ -2.09121696e+09,  6.57522207e+09,  2.84936733e+09] s2 / d2>,
 <Quantity [ -7.16606162e+09, -1.91854837e+09, -8.32082237e+08]>,
 <Quantity [ -8.03299173e-05, -3.97641214e-01,  9.17540984e-01]>)
>>> earth_canonical.pqw()
(<Quantity [-0.28013773, 0.88081143, 0.38169894]>,
 <Quantity [-0.95995981,-0.25700719,-0.11146506]>,
 <Quantity [ -8.03299173e-05, -3.97641214e-01,  9.17540984e-01]>)

I am almost sure the problem is in https://github.com/poliastro/poliastro/blob/520c32d/src/poliastro/twobody/core.py#L329.

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

Successfully merging a pull request may close this issue.

None yet
1 participant