Caltech-IPAC / kete

Kete Solar System Survey tools
https://Caltech-IPAC.github.io/kete
BSD 3-Clause "New" or "Revised" License
12 stars 1 forks source link

Mean Anomaly calculation fails for eccentricity very near 1 #117

Closed dahlend closed 1 month ago

dahlend commented 1 month ago
import kete
import numpy as np
import matplotlib.pyplot as plt
obj = kete.HorizonsProperties.fetch("C/2010 J4")
# eccentricity=0.9999988445770738

state = obj.state

vals = []
times = np.linspace(0, 365, 1000)
for jd in times + kete.Time.from_ymd(2010, 1, 1).jd:

    state = kete.propagate_n_body([state], jd)[0]
    vals.append(state.elements.true_anomaly)
plt.plot(times, vals)

image