Kaitai Structs, preprocessors and helper scripts for decoding SatNOGS received data.
Adding a new decoder
This project uses the Kaitai Struct language and compiler to describe the various telemetry formats.
To add a new decoder, write a Kaitai struct and add it to the folder
ksy.
More details are given in the wiki guide SatNOGS: Adding a new data decoder.
Every new telemetry decoder should have references to original documentation (highly recommended, but not enforced).
Those references can be added with doc-ref key, see kaitai docs: Documenting your spec.
Note for existing users:
Registering of new decoders in satnogsdecoders/decoder/__init__.py is no longer necessary.
Installation in development mode
Within the root directory of this repository run docker-ksc script to compile KSY to Python code (requires Docker):
$ ./contrib/docker-ksc.sh
The above command will output the compiled files under satnogsdecoders/decoder directory.
Then, install the package from source code directory as usual:
pip install -e .
Helper Scripts
Some helper commands will only be available after installing the package.
Installation
The helper scripts need a few additional dependencies which can be installed via pip:
pip install -r contrib/manage/requirements.txt
Fetch telemetry
To fetch telemetry you will need an API Token. You will have to register yourself on https://db.satnogs.org in order to get it.
Once you have your token create a new file .env in the current directory based on “./contrib/manage/env-dist” and add your token:
SATNOGS_DB_API_TOKEN=1234567890asdfghjkl
$ ./contrib/manage/fetch_telemetry.py --help
usage: fetch_telemetry.py [-h] [--source SOURCE] [--base_dir BASE_DIR] [--max MAX] norad_id
Fetch and store all telemetry data from a satnogs-db instance for a given satellite.
positional arguments:
norad_id NORAD ID of the satellite
optional arguments:
-h, --help show this help message and exit
--source SOURCE satnogs-db Instance: satnogs, satnogs-dev or sputnix
--base_dir BASE_DIR Base directory of the telemetry storage
--max MAX Maximum number of fetched frames. Default: 25
Push telemetry
$ ./contrib/manage/push_telemetry.py --help
usage: push_telemetry.py [-h] [--target TARGET] [--max MAX] telemetry_filename norad_id_import norad_id_export
Push all telemetry data to the target db instance from a local json dump file for a given satellite.
positional arguments:
telemetry_filename Filname of the telemetry data json dump
norad_id_import NORAD ID of the satellite in the data
norad_id_export NORAD ID of the satellite in the target db instance
optional arguments:
-h, --help show this help message and exit
--target TARGET target satnogs-db Instance: satnogs, satnogs-dev or sputnix
--max MAX Maximum number of frames to be submitted.
Export raw frames
$ ./contrib/manage/export_raw.py --help
usage: export_raw.py [-h] norad_id source_file satellite_name
Export raw frames from local telemtry storage json files.
positional arguments:
norad_id NORAD ID of the satellite
source_file Source telemetry storage file (json)
satellite_name Satellite name
optional arguments:
-h, --help show this help message and exit
Decode frame
$ decode_frame --help
usage: decode_frame [-h] [--raw-frame] decoder_name raw_frame_file
Decode a raw frame with the selected decoder (generated by Kaitai) and print its json representation, either of the telemetry frame directly, or the transformed result based on the fields specified in the struct docstring.
positional arguments:
decoder_name name of the decoder (e.g. siriussat)
raw_frame_file Path to the file containing the raw frame
options:
-h, --help show this help message and exit
--raw-frame Show the full decoded frame. If not selected (default), show only selected fields as specified by the docstring.
Fetch frames from network
$ ./contrib/manage/fetch_frames_from_network.py --help
usage: fetch_frames_from_network.py [-h] norad_id start end target_dir
Fetch all frames received in thespecified timeframe from a given satellite in
satnogs-network (prod) and store themto individual raw files.
positional arguments:
norad_id NORAD ID of the satellite
start Start date, YYYY-mm-dd
end End date, YYYY-mm-dd
target_dir target directory for the downloaded raw frames
optional arguments:
-h, --help show this help message and exit
Example Usage
Transfer frames from db-dev to db-dev (duplicating frames…):
SatNOGS Decoders
Kaitai Structs, preprocessors and helper scripts for decoding SatNOGS received data.
Adding a new decoder
This project uses the Kaitai Struct language and compiler to describe the various telemetry formats. To add a new decoder, write a Kaitai struct and add it to the folder ksy. More details are given in the wiki guide SatNOGS: Adding a new data decoder.
Every new telemetry decoder should have references to original documentation (highly recommended, but not enforced). Those references can be added with
doc-refkey, see kaitai docs: Documenting your spec.CubeBel-1cubebel1.ksycubebel1.pyCubebel1This is an example Kaitai struct:
A real Kaitai struct is cubebel1.ksy.
Note for existing users: Registering of new decoders in
satnogsdecoders/decoder/__init__.pyis no longer necessary.Installation in development mode
Within the root directory of this repository run
docker-kscscript to compile KSY to Python code (requires Docker):The above command will output the compiled files under
satnogsdecoders/decoderdirectory.Then, install the package from source code directory as usual:
Helper Scripts
Some helper commands will only be available after installing the package.
Installation
The helper scripts need a few additional dependencies which can be installed via pip:
Fetch telemetry
To fetch telemetry you will need an API Token. You will have to register yourself on https://db.satnogs.org in order to get it.
Once you have your token create a new file
.envin the current directory based on “./contrib/manage/env-dist” and add your token:Push telemetry
Export raw frames
Decode frame
Fetch frames from network
Example Usage
Transfer frames from db-dev to db-dev (duplicating frames…):
Decode a frame by Siriussat:
Download frames from satnogs-network (prod instance) for Fox-1A (norad id: 40967) received in the specified timeframe:
Existing decoders
License
Helper scripts: AGPL-3.0-or-later