Skip to content

Commit

Permalink
where are nans coming from
Browse files Browse the repository at this point in the history
  • Loading branch information
yoachim committed Jun 17, 2023
1 parent 49a8d34 commit a41d5dc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/moving_objects/test_chebyvalues.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def test_get_ephemerides(self):
# Test that get_ephemerides works and is accurate.
cheby_values = ChebyValues()
cheby_values.set_coefficients(self.cheby_fits)
print("cheby_values", cheby_values.coeffs)

assert np.all(np.isfinite(cheby_values.coeffs["ra"]))
assert np.all(np.isfinite(cheby_values.coeffs["dec"]))
assert np.all(np.isfinite(cheby_values.coeffs["vmag"]))
# Multiple times, all objects, all within interval.
tstep = self.interval / 10.0
time = np.arange(self.t_start, self.t_start + self.interval, tstep)
Expand All @@ -120,7 +123,11 @@ def test_get_ephemerides(self):
time, obscode=807, time_scale="TAI", by_object=True
)
print("ephemerides", ephemerides)
print("pyephemerides", "pyephemerides")
print("pyephemerides", pyephemerides)

assert np.all(np.isfinite(ephemerides["ra"]))
assert np.all(np.isfinite(pyephemerides["ra"]))

# RA and Dec should agree to 2.5mas (sky_tolerance above)
pos_residuals = np.sqrt(
(ephemerides["ra"] - pyephemerides["ra"]) ** 2
Expand All @@ -130,7 +137,9 @@ def test_get_ephemerides(self):
)
** 2
)
print("pos_residuals", pos_residuals)

assert np.all(np.isfinite(pos_residuals))

pos_residuals *= 3600.0 * 1000.0
# Let's just look at the max residuals in all quantities.
for k in ("ra", "dec", "dradt", "ddecdt", "geo_dist"):
Expand Down

0 comments on commit a41d5dc

Please sign in to comment.