You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
馃悶 Problem
Hello.
I'm trying to run some examples and always got an error in Orbit.from_ephem instruction.
For example in "Going to Mars" example code.
I'm trying to develop a code just for getting asteroids ephemeris, next years oppositions, Phase Angle, Phase Angle bisector longitude, etc. propagating a perturbed orbit with the gravitational forces from main planets and main asteroids (n-body).
I think it can be achieved with poliastro, but firstly I need to understand the sintaxis.
Thank you for your help.
Fernando
from astropy import units as u
from astropy import time
import numpy as np
from poliastro import iod
from poliastro.bodies import Earth, Mars, Sun
from poliastro.ephem import Ephem
from poliastro.maneuver import Maneuver
from poliastro.twobody import Orbit
from poliastro.util import time_range
from astropy.coordinates import solar_system_ephemeris
solar_system_ephemeris.set("jpl")
# Initial data
date_launch = time.Time("2011-11-26 15:02", scale="utc").tdb
date_arrival = time.Time("2012-08-06 05:17", scale="utc").tdb
earth = Ephem.from_body(Earth, time_range(date_launch, end=date_arrival))
mars = Ephem.from_body(Mars, time_range(date_launch, end=date_arrival))
# Solve for departure and target orbits
orb_earth = Orbit.from_ephem(Sun, earth, date_launch)
orb_mars = Orbit.from_ephem(Sun, mars, date_arrival)
TypeError Traceback (most recent call last)
Cell In[5], line 2
1 # Solve for departure and target orbits
----> 2 orb_earth = Orbit.from_ephem(Sun, earth, date_launch)
3 orb_mars = Orbit.from_ephem(Sun, mars, date_arrival)
File [~/anaconda3/envs/New/lib/python3.11/site-packages/poliastro/twobody/orbit/creation.py:240](https://file+.vscode-resource.vscode-cdn.net/Users/fhuet/Library/CloudStorage/OneDrive-Personal/Python/poliastro-main/~/anaconda3/envs/New/lib/python3.11/site-packages/poliastro/twobody/orbit/creation.py:240), in OrbitCreationMixin.from_ephem(cls, attractor, ephem, epoch)
222 @classmethod
223 def from_ephem(cls, attractor, ephem, epoch):
224 """Create osculating orbit from ephemerides at a given epoch.
225
226 This will assume that the `Ephem` coordinates
(...)
237
238 """
239 return cls.from_vectors(
--> 240 attractor, *ephem.rv(epoch), epoch, ephem.plane
241 )
File [~/anaconda3/envs/New/lib/python3.11/site-packages/poliastro/ephem.py:354](https://file+.vscode-resource.vscode-cdn.net/Users/fhuet/Library/CloudStorage/OneDrive-Personal/Python/poliastro-main/~/anaconda3/envs/New/lib/python3.11/site-packages/poliastro/ephem.py:354), in Ephem.rv(self, epochs, **kwargs)
343 def rv(self, epochs=None, **kwargs):
344 """Position and velocity vectors at given epochs.
345
346 Parameters
...
-> 1688 args, kwargs, unit, out = function_helper(*args, **kwargs)
1689 except NotImplementedError:
1690 return self._not_implemented_or_raise(function, types)
TypeError: concatenate() got an unexpected keyword argument 'dtype'
-->
馃枼 Please paste the output of following commands
conda info -a (only if you have conda)
conda list (only if you have conda)
pip freeze
# Paste your output here:
(New) fhuet@Fernandos-MacBook-Air poliastro-main % conda info -a
active environment : New
active env location : /Users/fhuet/anaconda3/envs/New
shell level : 2
user config file : /Users/fhuet/.condarc
populated config files : /Users/fhuet/.condarc
conda version : 23.5.0
conda-build version : 3.25.0
python version : 3.10.9.final.0
virtual packages : __archspec=1=arm64
__osx=13.4.1=0
__unix=0=0
base environment : /Users/fhuet/anaconda3 (writable)
conda av data dir : /Users/fhuet/anaconda3/etc/conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-arm64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/fhuet/anaconda3/pkgs
/Users/fhuet/.conda/pkgs
envs directories : /Users/fhuet/anaconda3/envs
/Users/fhuet/.conda/envs
platform : osx-arm64
user-agent : conda/23.5.0 requests/2.29.0 CPython/3.10.9 Darwin/22.5.0 OSX/13.4.1
UID:GID : 501:20
netrc file : None
offline mode : False
# conda environments:#
base /Users/fhuet/anaconda3
New * /Users/fhuet/anaconda3/envs/New
sys.version: 3.10.9 (main, Mar 1 2023, 12:20:14) [Cl...
sys.prefix: /Users/fhuet/anaconda3
sys.executable: /Users/fhuet/anaconda3/bin/python
conda location: /Users/fhuet/anaconda3/lib/python3.10/site-packages/conda
conda-build: /Users/fhuet/anaconda3/bin/conda-build
conda-content-trust: /Users/fhuet/anaconda3/bin/conda-content-trust
conda-convert: /Users/fhuet/anaconda3/bin/conda-convert
conda-debug: /Users/fhuet/anaconda3/bin/conda-debug
conda-develop: /Users/fhuet/anaconda3/bin/conda-develop
conda-env: /Users/fhuet/anaconda3/bin/conda-env
conda-index: /Users/fhuet/anaconda3/bin/conda-index
conda-inspect: /Users/fhuet/anaconda3/bin/conda-inspect
conda-metapackage: /Users/fhuet/anaconda3/bin/conda-metapackage
conda-pack: /Users/fhuet/anaconda3/bin/conda-pack
conda-render: /Users/fhuet/anaconda3/bin/conda-render
conda-repo: /Users/fhuet/anaconda3/bin/conda-repo
conda-server: /Users/fhuet/anaconda3/bin/conda-server
conda-skeleton: /Users/fhuet/anaconda3/bin/conda-skeleton
conda-token: /Users/fhuet/anaconda3/bin/conda-token
conda-verify: /Users/fhuet/anaconda3/bin/conda-verify
user site dirs:
CIO_TEST: <not set>
CONDA_DEFAULT_ENV: New
CONDA_EXE: /Users/fhuet/anaconda3/bin/conda
CONDA_PREFIX: /Users/fhuet/anaconda3/envs/New
CONDA_PREFIX_1: /Users/fhuet/anaconda3
CONDA_PROMPT_MODIFIER: (New)
CONDA_PYTHON_EXE: /Users/fhuet/anaconda3/bin/python
CONDA_ROOT: /Users/fhuet/anaconda3
CONDA_SHLVL: 2
CURL_CA_BUNDLE: <not set>
LD_PRELOAD: <not set>
PATH: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/fhuet/anaconda3/envs/New/bin:/Users/fhuet/anaconda3/condabin
REQUESTS_CA_BUNDLE: <not set>
SSL_CERT_FILE: <not set>
馃悶 Problem
Hello.
I'm trying to run some examples and always got an error in Orbit.from_ephem instruction.
For example in "Going to Mars" example code.
I'm trying to develop a code just for getting asteroids ephemeris, next years oppositions, Phase Angle, Phase Angle bisector longitude, etc. propagating a perturbed orbit with the gravitational forces from main planets and main asteroids (n-body).
I think it can be achieved with poliastro, but firstly I need to understand the sintaxis.
Thank you for your help.
Fernando
馃枼 Please paste the output of following commands
conda info -a
(only if you have conda)conda list
(only if you have conda)pip freeze
馃挕 Possible solutions
馃搵 Steps to solve the problem
Addresses #<put issue number here>
The text was updated successfully, but these errors were encountered: