Skip to content

Conversation

@malgosias
Copy link
Contributor

@malgosias malgosias commented Feb 8, 2022

This PR contains MTA radiation alerting package radalerts and tests radalerts/tests. It should be considered jointly with PR #2.

Command line options include --email and --mode. Email is the mailing list to which the alerts will be sent. The default at the moment is mtadude@cfa but this will be changes to sot_ace_alert@cfa. Mode can be 'flight' or 'test'. A given alert is disabled for 24 hours after it is triggered.

In the 'test' mode, the alert sending command is printed on the screen so the subject and email can be verified. The actual alert is not sent but this can be changed if requested.

Implemented radiation alerts

  1. ACE P3 2-hour fluence exceeded 3.6e8, i.e. 50,000 x 2 x 3600
  2. No nominal ACE data for >12h
  3. GOES HRC shield proxy limit exceeded 195000, i.e. ~3 x 256 x 248 (3 x SCS107 trip limit)

The code relies on the ACE.h5 and hrc_shield.h5 archives built in /proj/sot/ska3/flight/data/arc with arc (Replan Central) -- but until now it was tested on local h5 files, see definition of PATH in radalerts.py.

Adding new alerts

  • Edit alert.json file
  • Add get_message_<name> method to the Alert class in radalerts.py
  • Add a module method which defines pars[<name>] in main() in radalerts.py

Manually disabling alerts

  • Touch <name>.log logfile in working directory
  • Or edit alerts.json to change manual_disable from 0 to 1.

Testing
pytest -s tests/test_basic.py --email <test_email> to run all the tests
or
pytest -s tests/test_basic.py::<test_method> --email <test_email> to run individual tests.

The tests default to mtadude at cfa.harvard.edu without the --email option(see conftest.py), i.e.:
pytest -s tests/test_basic.py
or
pytest -s tests/test_basic.py::<test_method>

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.

2 participants