This codebase implements a transient detection algorithm for data acquired by the HERMES-FM1 payload onboard the SpIRIT nanosatellite. Targets Python 3.6+ and was developed for deployment on the SpIRIT-Loris NVIDIA Jetson Nano single-board computer.
Assuming python3 points to Python 3.6+:
- Copy the script
ht1.pyfrom thesrc/ht1directory. - Run with
python3 ht1.py path/to/SRAFILE.raw.
The ht1.py script has no dependencies outside standard library and requires no installation.
The algorithm searches for transients across six quadrant/band combinations: quadrants B, C, and D in both the MID and HIGH energy bands (LOW band is excluded). A detection requires at least 5 out of 6 combinations to trigger simultaneously, guaranteeing all three quadrants and at least two energy bands are over threshold.
If the transient search returns a positive, a new file SRAFILE_trigger.txt is created in the SRAFILE.raw parent directory.
The trigger output files are purposefully minimal UTF-8 encoded text files.
They contain only three integers: the number of trigger hits, a start-time index, and an end-time index. The transients live somewhere between the start and end time indices.
If no transient is found, no file is created.
The script returns error code 0 upon successful execution, error code 1 over invalid input file, or error code 2 over wrong parameters.
Logging to stderr defaults to error level. Use --log for info level, or --log=LEVEL to set a specific level (info, warning, error).
For logging to file redirect stderr, e.g. python3 ht1.py pat/to/SRAFILE.raw --log &> ht1_log.txt.
Search parameters can be controlled using a number of flags, see python3 ht1.py --help for more information.
This codebase can also be installed as package for reproducibility and on-ground applications, see documentation for more info.
The package comes with a minimal docker setup intended for testing in a replica environment of the NVIDIA Jetson Nano board.
-
Build the Docker container:
docker-compose build
Or, to build with no cache and logs, use
docker build --progress=plain --no-cache -t fm1trig-dev:latest . 2>&1. -
Run the container:
docker-compose run --rm dev
-
Run the tests:
python3 -m pytest tests/ -v
Install the package with pip install ".[dev]" and run the tests with python -m pytest tests.