Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

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
Milestone

Comments

@astrojuanlu
Copy link
Member

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 this to the 0.5 milestone Jan 24, 2016
@astrojuanlu
Copy link
Member Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant