Skip to content

Commit

Permalink
Merge pull request #401 from sot/no-color-bad-guide
Browse files Browse the repository at this point in the history
Exclude COLOR1=0.7 stars from guide selection
  • Loading branch information
jeanconn authored Oct 8, 2024
2 parents 4a5c42f + a2f1012 commit 9072c82
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions proseco/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions proseco/tests/test_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9072c82

Please sign in to comment.