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

Orbit.from_body error #17

Open
alphaDeng opened this issue Dec 20, 2024 · 0 comments
Open

Orbit.from_body error #17

alphaDeng opened this issue Dec 20, 2024 · 0 comments

Comments

@alphaDeng
Copy link

The problem is similar to https://github.com/poliastro/poliastro/issues/1632

the code:
`
from astropy import units as u
from astropy.time import Time

from hapsira.bodies import Earth, Mars, Sun
from hapsira.twobody import Orbit
from hapsira.ephem import Ephem
orb_earth = Ephem.from_body(Earth,Time("2018-09-28"))
r_2, v_2 = orb_earth.rv()
print(r_2,v_2)
and the error message:
Traceback (most recent call last):
File "d:\Allcode\python\python\1.py", line 41, in
File "d:\Allcode\python\python\1.py", line 41, in
r_2, v_2 = orb_earth.rv()
File "D:\software\programming\python\lib\site-packages\hapsira\ephem.py", line 348, in rv
r = coordinates.get_xyz(xyz_axis=1)
r_2, v_2 = orb_earth.rv()
File "D:\software\programming\python\lib\site-packages\hapsira\ephem.py", line 348, in rv
r = coordinates.get_xyz(xyz_axis=1)
File "D:\software\programming\python\lib\site-packages\astropy\coordinates\representation.py", line 1351, in get_xyz
r = coordinates.get_xyz(xyz_axis=1)
File "D:\software\programming\python\lib\site-packages\astropy\coordinates\representation.py", line 1351, in get_xyz
File "D:\software\programming\python\lib\site-packages\astropy\coordinates\representation.py", line 1351, in get_xyz
return np.stack([self._x, self._y, self._z], axis=xyz_axis)
File "<array_function internals>", line 200, in stack
File "D:\software\programming\python\lib\site-packages\astropy\units\quantity.py", line 1683, in array_function
return super().array_function(function, types, args, kwargs)
File "C:\Users\qazsedc\AppData\Roaming\Python\Python39\site-packages\numpy\core\shape_base.py", line 471, in stack
return _nx.concatenate(expanded_arrays, axis=axis, out=out,
File "<array_function internals>", line 200, in concatenate
File "D:\software\programming\python\lib\site-packages\astropy\units\quantity.py", line 1688, in array_function
args, kwargs, unit, out = function_helper(*args, **kwargs)
TypeError: concatenate() got an unexpected keyword argument 'dtype'Traceback (most recent call last):
File "d:\Allcode\python\1.py", line 41, in
File "d:\Allcode\python\1.py", line 41, in
r_2, v_2 = orb_earth.rv()
File "D:\software\programming\python\lib\site-packages\hapsira\ephem.py", line 348, in rv
r = coordinates.get_xyz(xyz_axis=1)
r_2, v_2 = orb_earth.rv()
File "D:\software\programming\python\lib\site-packages\hapsira\ephem.py", line 348, in rv
r = coordinates.get_xyz(xyz_axis=1)
File "D:\software\programming\python\lib\site-packages\astropy\coordinates\representation.py", line 1351, in get_xyz
r = coordinates.get_xyz(xyz_axis=1)
File "D:\software\programming\python\lib\site-packages\astropy\coordinates\representation.py", line 1351, in get_xyz
File "D:\software\programming\python\lib\site-packages\astropy\coordinates\representation.py", line 1351, in get_xyz
return np.stack([self._x, self._y, self._z], axis=xyz_axis)
File "<array_function internals>", line 200, in stack
File "D:\software\programming\python\lib\site-packages\astropy\units\quantity.py", line 1683, in array_function
return super().array_function(function, types, args, kwargs)
File "C:\Users\qazsedc\AppData\Roaming\Python\Python39\site-packages\numpy\core\shape_base.py", line 471, in stack
return _nx.concatenate(expanded_arrays, axis=axis, out=out,
File "<array_function internals>", line 200, in concatenate
File "D:\software\programming\python\lib\site-packages\astropy\units\quantity.py", line 1688, in array_function
args, kwargs, unit, out = function_helper(*args, **kwargs)
TypeError: concatenate() got an unexpected keyword argument 'dtype'
`

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

No branches or pull requests

1 participant