From a2f1012b84875ece373fb923e0ebed85d6f39b04 Mon Sep 17 00:00:00 2001 From: Jean Connelly Date: Wed, 2 Oct 2024 10:27:43 -0400 Subject: [PATCH] Exclude COLOR1=0.7 stars from guide selection --- proseco/guide.py | 1 + proseco/tests/test_guide.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/proseco/guide.py b/proseco/guide.py index 65782318..6460bb07 100644 --- a/proseco/guide.py +++ b/proseco/guide.py @@ -148,6 +148,7 @@ def get_guide_candidates_mask( & (mag > 5.2) & (mag < faint_mag_limit) & (mag_err < 1.0) + & (stars["COLOR1"] != 0.7) & (stars["ASPQ1"] < 20) # Less than 1 arcsec offset from nearby spoiler & (stars["ASPQ2"] == 0) # Unknown proper motion, or PM < 500 milli-arcsec/year & (stars["POS_ERR"] < 1250) # Position error < 1.25 arcsec diff --git a/proseco/tests/test_guide.py b/proseco/tests/test_guide.py index e3317727..dc0bd2df 100644 --- a/proseco/tests/test_guide.py +++ b/proseco/tests/test_guide.py @@ -179,6 +179,22 @@ def test_bad_star_list(): assert guides.bad_stars_mask[idx] +def test_color1_0p7(): + """Test that a star with COLOR1=0.7 is not selected""" + dark = DARK40.copy() + stars = StarsTable.empty() + stars.add_fake_constellation(mag=np.linspace(9, 10.3, 4), n_stars=4) + # Bright star that would normally be selected but with color=0.7 + bad_id = 11111111 + stars.add_fake_star(yang=100, zang=100, mag=6.5, id=bad_id, COLOR1=0.7) + kwargs = mod_std_info(stars=stars, dark=dark, n_guide=5) + guides = get_guide_catalog(**kwargs) + assert bad_id not in guides["id"] + + idx = guides.stars.get_id_idx(bad_id) + assert guides.bad_stars_mask[idx] + + def test_avoid_trap(): """ Set up a scenario where a star is selected fine at one roll, and then