Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bright limit check to use 5.2 mag #162

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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