Radiation alerts #3
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains MTA radiation alerting package
radalertsand testsradalerts/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
The code relies on the
ACE.h5andhrc_shield.h5archives built in/proj/sot/ska3/flight/data/arcwitharc(Replan Central) -- but until now it was tested on local h5 files, see definition of PATH inradalerts.py.Adding new alerts
alert.jsonfileget_message_<name>method to the Alert class inradalerts.pypars[<name>]inmain()inradalerts.pyManually disabling alerts
<name>.loglogfile in working directoryalerts.jsonto change manual_disable from 0 to 1.Testing
pytest -s tests/test_basic.py --email <test_email>to run all the testsor
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.pyor
pytest -s tests/test_basic.py::<test_method>