Skip to content

Commit

Permalink
Merge pull request #162 from sot/bright-5p2
Browse files Browse the repository at this point in the history
Update bright limit check to use 5.2 mag
  • Loading branch information
jeanconn authored Sep 22, 2021
2 parents 09a6238 + 38a1216 commit f1c31dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions sparkles/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,18 +1133,18 @@ def check_guide_is_candidate(self, star):
def check_too_bright_guide(self, star):
"""Warn on guide stars that may be too bright.
- Critical if within 2 * mag_err of the hard 5.8 limit, caution within 3 * mag_err
- Critical if within 2 * mag_err of the hard 5.2 limit, caution within 3 * mag_err
"""
agasc_id = star['id']
idx = self.get_id(agasc_id)['idx']
mag_err = star['mag_err']
for mult, category in ((2, 'critical'),
(3, 'caution')):
if star['mag'] - (mult * mag_err) < 5.8:
if star['mag'] - (mult * mag_err) < 5.2:
self.add_message(
category,
f'Guide star {agasc_id} within {mult}*mag_err of 5.8 '
f'Guide star {agasc_id} within {mult}*mag_err of 5.2 '
f'(mag_err={mag_err:.2f})', idx=idx)
break

Expand Down
6 changes: 3 additions & 3 deletions sparkles/tests/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,17 @@ def test_bad_star_set():


def test_too_bright_guide_magerr():
"""Test the check for too-bright guide stars within mult*mag_err of 5.8"""
"""Test the check for too-bright guide stars within mult*mag_err of 5.2"""
stars = StarsTable.empty()
# Add two stars because separate P2 tests seem to break with just one star
stars.add_fake_star(id=100, yang=100, zang=-200, mag=6.0, mag_err=0.11, MAG_ACA_ERR=10)
stars.add_fake_star(id=100, yang=100, zang=-200, mag=5.4, mag_err=0.11, MAG_ACA_ERR=10)
stars.add_fake_star(id=101, yang=0, zang=500, mag=8.0)
aca = get_aca_catalog(**mod_std_info(n_fid=0), stars=stars, dark=DARK40, raise_exc=True)
aca = ACAReviewTable(aca)
aca.check_too_bright_guide(aca.guides.get_id(100))
msg = aca.messages[0]
assert msg['category'] == 'critical'
assert '2*mag_err of 5.8' in msg['text']
assert '2*mag_err of 5.2' in msg['text']


def test_check_fid_spoiler_score():
Expand Down

0 comments on commit f1c31dc

Please sign in to comment.