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 a few tests to use old dyn_bgd_n_faint=0 default #214

Merged
merged 1 commit into from
Nov 26, 2024
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
15 changes: 9 additions & 6 deletions sparkles/tests/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,12 @@ def test_guide_count_er5(aca_review_table):

@pytest.mark.parametrize("aca_review_table", (ACAReviewTable, ACACheckTable))
def test_guide_count_or(aca_review_table):
"""Test the check that an OR has enough fractional guide stars by guide_count"""
"""Test the check that an OR has enough fractional guide stars by guide_count.
This test uses dyn_bgd_n_faint=0."""
stars = StarsTable.empty()
stars.add_fake_constellation(n_stars=5, mag=[7.0, 7.0, 10.3, 10.3, 10.3])
aca = get_aca_catalog(
**mod_std_info(n_fid=3, n_guide=5, obsid=1),
**mod_std_info(n_fid=3, n_guide=5, obsid=1, dyn_bgd_n_faint=0),
stars=stars,
dark=DARK40,
raise_exc=True,
Expand Down Expand Up @@ -426,13 +427,13 @@ def test_too_many_bright_stars(aca_review_table):
@pytest.mark.parametrize("aca_review_table", (ACAReviewTable, ACACheckTable))
def test_low_guide_count(aca_review_table):
"""Test that a 3.5 to 4.0 guide_count observation gets a critical warning
on guide_count if man_angle_next > 5 (no creep-away)."""
on guide_count if man_angle_next > 5 (no creep-away). This test uses dyn_bgd_n_faint=0."""
# Set a scenario with guide_count in the 3.5 to 4.0 range and confirm a
# critical warning.
stars = StarsTable.empty()
stars.add_fake_constellation(n_stars=5, mag=[7.0, 7.0, 7.0, 10.2, 10.3])
aca = get_aca_catalog(
**mod_std_info(n_fid=3, n_guide=5, obsid=1),
**mod_std_info(n_fid=3, n_guide=5, obsid=1, dyn_bgd_n_faint=0),
stars=stars,
dark=DARK40,
raise_exc=True,
Expand All @@ -451,14 +452,16 @@ def test_low_guide_count(aca_review_table):
@pytest.mark.parametrize("aca_review_table", (ACAReviewTable, ACACheckTable))
def test_low_guide_count_creep_away(aca_review_table):
"""Test that a 3.5 to 4.0 guide_count observation does not get a critical warning
on guide_count if man_angle_next <= 5 (creep-away)."""
on guide_count if man_angle_next <= 5 (creep-away). This test uses dyn_bgd_n_faint=0."""
# Set a scenario with guide_count in the 3.5 to 4.0 range but with
# a creep away (maneuver angle <= 5), and confirm that is just a warning
# (not critical).
stars = StarsTable.empty()
stars.add_fake_constellation(n_stars=5, mag=[7.0, 7.0, 7.0, 10.2, 10.3])
aca = get_aca_catalog(
**mod_std_info(n_fid=3, n_guide=5, obsid=1, man_angle_next=5.0),
**mod_std_info(
n_fid=3, n_guide=5, obsid=1, man_angle_next=5.0, dyn_bgd_n_faint=0
),
stars=stars,
dark=DARK40,
raise_exc=True,
Expand Down
2 changes: 2 additions & 0 deletions sparkles/tests/test_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"focus_offset": 0,
"t_ccd_acq": -9.943,
"t_ccd_guide": -9.938,
"dyn_bgd_n_faint": 0,
}


Expand Down Expand Up @@ -282,6 +283,7 @@ def test_uniform_roll_options(proseco_agasc_1p7):
"sim_offset": 0,
"t_ccd_acq": -9.8,
"t_ccd_guide": -9.8,
"dyn_bgd_n_faint": 0,
}

aca = get_aca_catalog(**kwargs)
Expand Down