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
fromastropy.timeimportTimefromsbpy.dataimportOrbitorbit=Orbit.from_mpc('2P')
orbit['targetname'] ='2P'orbit['orbtype'] ='COM'# cometary style orbit with q, Tp (otherwise use KEP with a, M)orbit['H'] =15*u.magorbit['G'] =0.15print(orbit['orbtype'])
# propagate the orbit forward to 2026 with openorbfuture_orbit=orbit.oo_propagate(Time('2026-06-06'))
print(future_orbit['orbtype'])
Output
orbtype
-------
COM
orbtype
-------
2.0
Instead of 2.0, it should have been COM.
The text was updated successfully, but these errors were encountered:
I noticed this recently too because I was trying to propagate an orbit to multiple Time objects and it would just hang mysteriously:
from astropy.time import Time
from sbpy.data import Orbit
orbit = Orbit.from_horizons('Ceres')
orbit["orbtype"] = "KEP"
print(orbit['orbtype'])
# propagate the orbit forward to 2026 with openorb
times = Time(['2024-06-06','2025-06-06','2026-06-06'])
future_orbit = orbit.oo_propagate(times)
print(future_orbit['orbtype'])
Silly hack is to do one timestep at a time and drop (or overwrite) the orbtype:
# propagate the orbit forward to 2026 with openorb
times = Time(['2024-06-06','2025-06-06','2026-06-06'])
for i in range(len(times)):
print(i)
future_orbit = orbit.oo_propagate(times[i]) # propagate the orbit one time step
del future_orbit.table["orbtype"] # orbtype is added as int, sbpy freaks out so delete the orbtype and then _to_oo works it out
statevec = future_orbit.oo_transform('CART') # transform from orbital elements to cartesian
print(statevec.table[["epoch","x","y","z"]])
Output
Instead of 2.0, it should have been COM.
The text was updated successfully, but these errors were encountered: