From a41d5dced4b54a3263d95aa739eb98fe28692556 Mon Sep 17 00:00:00 2001 From: Peter Yoachim Date: Sat, 17 Jun 2023 16:55:56 -0700 Subject: [PATCH] where are nans coming from --- tests/moving_objects/test_chebyvalues.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/moving_objects/test_chebyvalues.py b/tests/moving_objects/test_chebyvalues.py index f6c64bcd4..5127716c2 100644 --- a/tests/moving_objects/test_chebyvalues.py +++ b/tests/moving_objects/test_chebyvalues.py @@ -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) @@ -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 @@ -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"):