From 2a96ec2c9d248f81cb06ebe425caeae95804723f Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Tue, 13 Feb 2024 08:45:10 -0500 Subject: [PATCH] Update find_er_attitude test for yaw sign change in get/apply sun_pitch_yaw --- sparkles/tests/test_find_er_catalog.py | 80 +++++++++++++------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/sparkles/tests/test_find_er_catalog.py b/sparkles/tests/test_find_er_catalog.py index 711d102..cf94499 100644 --- a/sparkles/tests/test_find_er_catalog.py +++ b/sparkles/tests/test_find_er_catalog.py @@ -3,7 +3,7 @@ import numpy as np import pytest -import Ska.Sun +import ska_sun from proseco import get_aca_catalog from proseco.tests.test_common import mod_std_info from Quaternion import Quat @@ -56,9 +56,9 @@ def ACA(KWARGS): @pytest.fixture def ATTS(ACA): - DPITCHES, DYAWS = np.ogrid[-0.01:-3.5:4j, -3.1:3:3j] - SUN_RA, SUN_DEC = Ska.Sun.position(ACA.date) - return Ska.Sun.apply_sun_pitch_yaw( + DPITCHES, DYAWS = np.ogrid[-0.01:-3.5:4j, 3.1:-3.0:3j] + SUN_RA, SUN_DEC = ska_sun.position(ACA.date) + return ska_sun.apply_sun_pitch_yaw( ACA.att, pitch=DPITCHES, yaw=DYAWS, sun_ra=SUN_RA, sun_dec=SUN_DEC ) @@ -95,18 +95,18 @@ def test_find_er_catalog_minus_2_pitch_bins(proseco_agasc_1p7, ACA, ATTS): assert att_opts[TEST_COLS].pformat_all() == [ "dpitch dyaw count_9th count_10th count_all count_ok n_critical att ", "------ ----- --------- ---------- --------- -------- ---------- -----------------", - " -0.01 -3.10 4.18 6.00 5.65 True 2 7.66 -25.21 29.3", - " -0.01 -0.05 2.00 2.67 2.25 False -- 6.47 -26.05 26.1", - " -0.01 3.00 2.62 7.92 5.26 False -- 5.21 -26.84 22.8", - " -1.17 -3.10 2.00 9.33 5.92 False -- 8.49 -26.10 29.7", - " -1.17 -0.05 0.00 1.23 0.78 False -- 7.25 -26.99 26.4", - " -1.17 3.00 0.75 6.87 4.03 False -- 5.94 -27.81 23.1", - " -2.34 -3.10 1.89 7.77 5.21 False -- 9.33 -26.99 30.1", - " -2.34 -0.05 2.87 8.52 5.97 False -- 8.04 -27.92 26.8", - " -2.34 3.00 8.53 13.90 12.67 True 0 6.67 -28.78 23.5", - " -3.50 -3.10 2.12 10.01 6.66 False -- 10.19 -27.87 30.5", - " -3.50 -0.05 5.60 10.63 8.39 True -- 8.84 -28.84 27.2", - " -3.50 3.00 2.83 8.93 5.47 False -- 7.42 -29.74 23.8", + " -0.01 3.10 4.18 6.00 5.65 True 2 7.66 -25.21 29.3", + " -0.01 0.05 2.00 2.67 2.25 False -- 6.47 -26.05 26.1", + " -0.01 -3.00 2.62 7.92 5.26 False -- 5.21 -26.84 22.8", + " -1.17 3.10 2.00 9.33 5.92 False -- 8.49 -26.10 29.7", + " -1.17 0.05 0.00 1.23 0.78 False -- 7.25 -26.99 26.4", + " -1.17 -3.00 0.75 6.87 4.03 False -- 5.94 -27.81 23.1", + " -2.34 3.10 1.89 7.77 5.21 False -- 9.33 -26.99 30.1", + " -2.34 0.05 2.87 8.52 5.97 False -- 8.04 -27.92 26.8", + " -2.34 -3.00 8.53 13.90 12.67 True 0 6.67 -28.78 23.5", + " -3.50 3.10 2.12 10.01 6.66 False -- 10.19 -27.87 30.5", + " -3.50 0.05 5.60 10.63 8.39 True -- 8.84 -28.84 27.2", + " -3.50 -3.00 2.83 8.93 5.47 False -- 7.42 -29.74 23.8", ] @@ -117,18 +117,18 @@ def test_find_er_catalog_minus_2_count_all(proseco_agasc_1p7, ACA, ATTS): assert att_opts[TEST_COLS].pformat_all() == [ "dpitch dyaw count_9th count_10th count_all count_ok n_critical att ", "------ ----- --------- ---------- --------- -------- ---------- -----------------", - " -0.01 -3.10 4.18 6.00 5.65 True -- 7.66 -25.21 29.3", - " -0.01 -0.05 2.00 2.67 2.25 False -- 6.47 -26.05 26.1", - " -0.01 3.00 2.62 7.92 5.26 False -- 5.21 -26.84 22.8", - " -1.17 -3.10 2.00 9.33 5.92 False -- 8.49 -26.10 29.7", - " -1.17 -0.05 0.00 1.23 0.78 False -- 7.25 -26.99 26.4", - " -1.17 3.00 0.75 6.87 4.03 False -- 5.94 -27.81 23.1", - " -2.34 -3.10 1.89 7.77 5.21 False -- 9.33 -26.99 30.1", - " -2.34 -0.05 2.87 8.52 5.97 False -- 8.04 -27.92 26.8", - " -2.34 3.00 8.53 13.90 12.67 True 0 6.67 -28.78 23.5", - " -3.50 -3.10 2.12 10.01 6.66 False -- 10.19 -27.87 30.5", - " -3.50 -0.05 5.60 10.63 8.39 True -- 8.84 -28.84 27.2", - " -3.50 3.00 2.83 8.93 5.47 False -- 7.42 -29.74 23.8", + " -0.01 3.10 4.18 6.00 5.65 True -- 7.66 -25.21 29.3", + " -0.01 0.05 2.00 2.67 2.25 False -- 6.47 -26.05 26.1", + " -0.01 -3.00 2.62 7.92 5.26 False -- 5.21 -26.84 22.8", + " -1.17 3.10 2.00 9.33 5.92 False -- 8.49 -26.10 29.7", + " -1.17 0.05 0.00 1.23 0.78 False -- 7.25 -26.99 26.4", + " -1.17 -3.00 0.75 6.87 4.03 False -- 5.94 -27.81 23.1", + " -2.34 3.10 1.89 7.77 5.21 False -- 9.33 -26.99 30.1", + " -2.34 0.05 2.87 8.52 5.97 False -- 8.04 -27.92 26.8", + " -2.34 -3.00 8.53 13.90 12.67 True 0 6.67 -28.78 23.5", + " -3.50 3.10 2.12 10.01 6.66 False -- 10.19 -27.87 30.5", + " -3.50 0.05 5.60 10.63 8.39 True -- 8.84 -28.84 27.2", + " -3.50 -3.00 2.83 8.93 5.47 False -- 7.42 -29.74 23.8", ] @@ -139,18 +139,18 @@ def test_find_er_catalog_minus_2_input_order(proseco_agasc_1p7, ACA, ATTS): assert att_opts[TEST_COLS].pformat_all() == [ "dpitch dyaw count_9th count_10th count_all count_ok n_critical att ", "------ ----- --------- ---------- --------- -------- ---------- -----------------", - " -0.01 -3.10 4.18 6.00 5.65 True 2 7.66 -25.21 29.3", - " -0.01 -0.05 2.00 2.67 2.25 False -- 6.47 -26.05 26.1", - " -0.01 3.00 2.62 7.92 5.26 False -- 5.21 -26.84 22.8", - " -1.17 -3.10 2.00 9.33 5.92 False -- 8.49 -26.10 29.7", - " -1.17 -0.05 0.00 1.23 0.78 False -- 7.25 -26.99 26.4", - " -1.17 3.00 0.75 6.87 4.03 False -- 5.94 -27.81 23.1", - " -2.34 -3.10 1.89 7.77 5.21 False -- 9.33 -26.99 30.1", - " -2.34 -0.05 2.87 8.52 5.97 False -- 8.04 -27.92 26.8", - " -2.34 3.00 8.53 13.90 12.67 True 0 6.67 -28.78 23.5", - " -3.50 -3.10 2.12 10.01 6.66 False -- 10.19 -27.87 30.5", - " -3.50 -0.05 5.60 10.63 8.39 True -- 8.84 -28.84 27.2", - " -3.50 3.00 2.83 8.93 5.47 False -- 7.42 -29.74 23.8", + " -0.01 3.10 4.18 6.00 5.65 True 2 7.66 -25.21 29.3", + " -0.01 0.05 2.00 2.67 2.25 False -- 6.47 -26.05 26.1", + " -0.01 -3.00 2.62 7.92 5.26 False -- 5.21 -26.84 22.8", + " -1.17 3.10 2.00 9.33 5.92 False -- 8.49 -26.10 29.7", + " -1.17 0.05 0.00 1.23 0.78 False -- 7.25 -26.99 26.4", + " -1.17 -3.00 0.75 6.87 4.03 False -- 5.94 -27.81 23.1", + " -2.34 3.10 1.89 7.77 5.21 False -- 9.33 -26.99 30.1", + " -2.34 0.05 2.87 8.52 5.97 False -- 8.04 -27.92 26.8", + " -2.34 -3.00 8.53 13.90 12.67 True 0 6.67 -28.78 23.5", + " -3.50 3.10 2.12 10.01 6.66 False -- 10.19 -27.87 30.5", + " -3.50 0.05 5.60 10.63 8.39 True -- 8.84 -28.84 27.2", + " -3.50 -3.00 2.83 8.93 5.47 False -- 7.42 -29.74 23.8", ]