question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'CartesianRepresentation' object has no attribute 'to' (get_body_ephem issue)

See original GitHub issue

🐞 Problem Removal of get_body_ephem leads to issues re: data types (from “Going to Mars” which i was attempting to run as a test)

Because astropy.coordinates.get_body_barycentric_posvel outputs type “CartesianRepresentation” whereas poliastro.ephem.get_body_ephem outputs type “Quantity” (I think…)

Any advice on how to swap the data types? or is there a known fix for this already?

Thank you!

SYSTEM INFO ############################################################################ conda info -a active environment : None user config file : /Users/Jonny/.condarc populated config files : /Users/Jonny/.condarc conda version : 4.4.10 conda-build version : 3.0.27 python version : 3.6.3.final.0 base environment : /anaconda3 (writable) channel URLs : https://repo.continuum.io/pkgs/main/osx-64 https://repo.continuum.io/pkgs/main/noarch https://repo.continuum.io/pkgs/free/osx-64 https://repo.continuum.io/pkgs/free/noarch https://repo.continuum.io/pkgs/r/osx-64 https://repo.continuum.io/pkgs/r/noarch https://repo.continuum.io/pkgs/pro/osx-64 https://repo.continuum.io/pkgs/pro/noarch package cache : /anaconda3/pkgs /Users/Jonny/.conda/pkgs envs directories : /anaconda3/envs /Users/Jonny/.conda/envs platform : osx-64 user-agent : conda/4.4.10 requests/2.18.4 CPython/3.6.3 Darwin/17.5.0 OSX/10.13.4 UID:GID : 501:20 netrc file : None offline mode : False

conda environments:

base * /anaconda3

sys.version: 3.6.3 |Anaconda custom (64-bit)| (defaul… sys.prefix: /anaconda3 sys.executable: /anaconda3/bin/python conda location: /anaconda3/lib/python3.6/site-packages/conda conda-build: /anaconda3/bin/conda-build conda-convert: /anaconda3/bin/conda-convert conda-develop: /anaconda3/bin/conda-develop conda-env: /anaconda3/bin/conda-env conda-index: /anaconda3/bin/conda-index conda-inspect: /anaconda3/bin/conda-inspect conda-metapackage: /anaconda3/bin/conda-metapackage conda-render: /anaconda3/bin/conda-render conda-server: /anaconda3/bin/conda-server conda-skeleton: /anaconda3/bin/conda-skeleton conda-verify: /anaconda3/bin/conda-verify user site dirs:

CIO_TEST: <not set> CONDA_ROOT: /anaconda3 PATH: /anaconda3/bin:/anaconda3/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin://anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin REQUESTS_CA_BUNDLE: <not set> SSL_CERT_FILE: <not set>

License directories: /Users/Jonny/.continuum /Users/Jonny/Library/Application Support/Anaconda /anaconda3/licenses License files (license*.txt): Package/feature end dates: ############################################################################

TESTS - Didnt pass them all… ah well ############################################################################

python -c "import poliastro.testing; poliastro.testing.test()" ============================= test session starts ============================== platform darwin – Python 3.6.3, pytest-3.2.1, py-1.4.34, pluggy-0.4.0 rootdir: /anaconda3/lib/python3.6/site-packages/poliastro, inifile: collected 173 items

…/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_bodies.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_coordinates.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_hyper.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_iod.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_jit.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_maneuver.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_patched_conics.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_plotting.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_plotting2d.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_plotting3d.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_stumpff.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_twobody.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/test_util.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_neos/test_dastcom5.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_neos/test_neos_neows.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_twobody/test_angles.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_twobody/test_decorators.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_twobody/test_orbit.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_twobody/test_perturbations.py … …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_twobody/test_propagation.py …xx …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_twobody/test_sample.py …X …/…/anaconda3/lib/python3.6/site-packages/poliastro/tests/tests_twobody/test_states.py …

============== 170 passed, 2 xfailed, 1 xpassed in 73.89 seconds =============== ############################################################################

💡 Possible solutions Reconfigure either poliastro or astropy w.r.t. this issue

Thanks for your help!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jmerskine1commented, Apr 24, 2018

Our team have a university (TU Delft) assignment to develop the navigation methods for the LUMIO microsat mission.

https://www.tudelft.nl/en/2018/lr/lumio-the-cubesat-that-will-watch-meteoroid-impacts-on-the-far-side-of-the-moon/

I want to plot the mission using poliastro and show how and where the navigation strategy will operate over the injection, transfer and operational orbit phases (based on the FOV of the onboard camera). Probably a very basic use for poliastro but I’m sure i will find it challenging enough.

0reactions
astrojuanlucommented, Apr 24, 2018

Awesome! Greetings to Prof. Topputo 😃 Please ping me if I can ever help you in any way, and also feel free to join our chat: https://riot.im/app/#/room/#poliastro:matrix.org

Read more comments on GitHub >

github_iconTop Results From Across the Web

CartesianRepresentationAttribute — Astropy v5.1.1
A frame attribute that is a CartesianRepresentation with specified units. Parameters. default object. Default value for the attribute if not provided.
Read more >
python - SkyCoord Bug: 'list' (or 'Series) object has no attribute ...
The problem was I named the list with the coordinates as: coord = [C[0],C[1]]. And it was bugging the import part of the...
Read more >
Using the SkyCoord High-level Class - Astropy Documentation
The SkyCoord object can maintain the union of frame attributes for all built-in and user-defined ... AttributeError: 'SkyCoord' object has no attribute 'x' ......
Read more >
Using the SkyCoord High-level Class — Astropy v1.0.4
The SkyCoord object can maintain the union of frame attributes for all built-in and user-defined ... AttributeError: 'SkyCoord' object has no attribute 'x' ......
Read more >
Why am I getting AttributeError: Object has no attribute?
PYTHON : Why am I getting AttributeError: Object has no attribute? [ Gift : Animated Search Engine ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found