Skip to content

Generalize handling of optically bright planets.#229

Open
jeanconn wants to merge 20 commits into
masterfrom
obo
Open

Generalize handling of optically bright planets.#229
jeanconn wants to merge 20 commits into
masterfrom
obo

Conversation

@jeanconn

@jeanconn jeanconn commented May 13, 2026

Copy link
Copy Markdown
Contributor

Description

This PR removes Jupiter-specific checking and generalizes the code to handle the optically bright planets. Much of the new code to work generically with the optically bright planets data and planet functions upstream in chandra_aca and proseco.

This PR requires

sot/chandra_aca#203
and
sot/proseco#415


Functional behavior with this PR is:

  • Sparkles gets candidate bright planets over the observation interval.
  • For each candidate planet, Sparkles gets its brightest magnitude state over the interval from chandra_aca.
  • The chandra_aca magnitude states used here are:
    • no action (0.0 <= m < 40)
    • instrument notify (-2.0 <= m < 0.0)
    • partial mitigation (-2.9 <= m < -2.0)
    • full mitigation (-5.0 <= m < -2.9)
    • obo too bright (-30.0 <= m < -5.0)

Per-planet Sparkles behavior:

  • If the planet is within 2 degrees of the pointing but is not on the CCD:
    • Sparkles treats it as off-CCD for checking.
    • If magnitude state is anything but "no action", Sparkles emits a critical message and stops checks for that planet.
  • If the planet is on CCD:
    • If magnitude state is obo too bright, Sparkles emits a critical message and stops checks for that planet.
    • If the planet is not in the target name:
      • info if magnitude level is no action
      • otherwise warning
    • Sparkles emits an info summary for the on-CCD planet, including the magnitude range for the selected state.
    • Sparkles runs acquisition and tracking spoiler checks for bright planets on the CCD.
    • Sparkles runs distribution checks (to get stars and fids opposite bright planets) only for partial mitigation and full mitigation.
  • If the planet is on CCD but no magnitude-state table could be read, Sparkles emits a caution and skips checks for that planet.

Interface impacts

Testing

This PR requires

sot/chandra_aca#203
and
sot/proseco#415

Unit tests

  • Mac
(ska3-latest) flame:sparkles jean$ env PYTHONPATH=/Users/jean/git/obo/chandra_aca:/Users/jean/git/obo/proseco pytest
============================================================ test session starts ============================================================
platform darwin -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/jean/git
configfile: pytest.ini
plugins: anyio-4.12.1, timeout-2.4.0
collected 139 items                                                                                                                         

sparkles/tests/test_checks.py ....................................................................................................... [ 74%]
..                                                                                                                                    [ 75%]
sparkles/tests/test_find_er_catalog.py .....                                                                                          [ 79%]
sparkles/tests/test_review.py .........................                                                                               [ 97%]
sparkles/tests/test_yoshi.py ....                                                                                                     [100%]

=========================================================== 139 passed in 45.31s

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

No functional testing.

@jeanconn
jeanconn marked this pull request as ready for review July 16, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant