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 sparkles tests for proseco no-color1 guide star change #212

Merged
merged 1 commit into from
Oct 15, 2024
Merged
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
34 changes: 19 additions & 15 deletions sparkles/tests/test_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,28 @@ def test_review_catalog(proseco_agasc_1p7, tmpdir):
acar.run_aca_review()
assert acar.messages == [
{
"text": "Guide star imposter offset 2.6, limit 2.5 arcsec",
"category": "warning",
"text": "Guide star imposter offset 2.6, limit 2.5 arcsec",
"idx": 4,
},
{"text": "P2: 3.33 less than 4.0 for ER", "category": "warning"},
{"category": "warning", "text": "P2: 3.33 less than 4.0 for ER"},
{
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
"category": "critical",
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
},
{"text": "ER with 6 guides but 8 were requested", "category": "caution"},
{"category": "critical", "text": "ER count of guide stars 5.00 < 6.0"},
{"category": "caution", "text": "ER with 5 guides but 8 were requested"},
]

assert acar.roll_options is None

msgs = acar.messages >= "critical"
assert msgs == [
{
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
"category": "critical",
}
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
},
{"category": "critical", "text": "ER count of guide stars 5.00 < 6.0"},
]

assert acar.review_status() == -1
Expand Down Expand Up @@ -336,16 +338,17 @@ def test_run_aca_review_function(proseco_agasc_1p7, tmpdir):
assert exc is None
assert acar.messages == [
{
"text": "Guide star imposter offset 2.6, limit 2.5 arcsec",
"category": "warning",
"text": "Guide star imposter offset 2.6, limit 2.5 arcsec",
"idx": 4,
},
{"text": "P2: 3.33 less than 4.0 for ER", "category": "warning"},
{"category": "warning", "text": "P2: 3.33 less than 4.0 for ER"},
{
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
"category": "critical",
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
},
{"text": "ER with 6 guides but 8 were requested", "category": "caution"},
{"category": "critical", "text": "ER count of guide stars 5.00 < 6.0"},
{"category": "caution", "text": "ER with 5 guides but 8 were requested"},
]

path = Path(str(tmpdir))
Expand All @@ -369,23 +372,24 @@ def test_run_aca_review_dyn_bgd_n_faint(proseco_agasc_1p7, tmpdir):

assert exc is None
assert acar.dyn_bgd_n_faint == 2
assert np.isclose(acar.guide_count, 6, atol=0.1)
assert np.isclose(acar.guide_count, 5, atol=0.1)

# Assert same warnings as test_run_aca_review_function but with a different
# guide count and new info message
assert acar.messages == [
{"text": "Using dyn_bgd_n_faint=2 (call_args val=0)", "category": "info"},
{
"text": "Guide star imposter offset 2.6, limit 2.5 arcsec",
"category": "warning",
"text": "Guide star imposter offset 2.6, limit 2.5 arcsec",
"idx": 4,
},
{"text": "P2: 3.33 less than 4.0 for ER", "category": "warning"},
{"category": "warning", "text": "P2: 3.33 less than 4.0 for ER"},
{
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
"category": "critical",
"text": "ER count of 9th (8.9 for -9.9C) mag guide stars 1.91 < 3.0",
},
{"text": "ER with 6 guides but 8 were requested", "category": "caution"},
{"category": "critical", "text": "ER count of guide stars 5.00 < 6.0"},
{"category": "caution", "text": "ER with 5 guides but 8 were requested"},
]


Expand Down