InfluxDB Line Protocol timestamp updater, plotter and formatter for Auxspace telemetry data.
This python program updates the relative timestamps from the telemetry project to absolute ones.
Since the microcontroller that is used in the rocket doesn't have an RTC, the time data in data.txt is only relative to its launch.
This program helps updating these relative timestamps to dates, in case the data has to be transferred into a timeseries database.
A quick example can be found in the example/ directory.
data.txt is the data from the Microcontroller, containing relative
timestamps generated by the monotonic clock.
There is no info about the date yet, but the updated version called
data_updated.txt has this info added by telhelp.
The diagram shows the data from data_updated.txt, which was obtained on the Launch day of METER-1 (2024-08-31) by the sensors in the Rocket.
Other examples under example/ show the different output formats of the
program, such as json, json-lines and csv.
Run a quick setup using python3-venv:
# Setup and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate
# OPTIONAL: recompile requirements
# > pip3 install pip-tools
# > pip-compile requirements.in
# Install requirements
pip3 install -r requirements.txt
# Install pybuild
python3 -m pip install --upgrade buildNote: This program has been developed with Python version 3.12.
The project wheel can be build with pybuild:
python3 -m buildAfter building, install the wheel with pip:
pip install ./dist/telhelp_auxspace-<VERSION>.whlCurrently there is no testing environment set up. This is a feature for the future.
telhelp --helpTo make it easier for users to access the data than to load them into an InfluxDB first, looking for the right timespan and querying for the data, this program can also plot the data for you.
To only use this funciton without converting timestamps, either set
--timebase 0 or --show-only:
telhelp --show-only <DATA_FILE>The plotter function is enabled by default, disable it via --no-show.
telhelp --no-show [<OTHER_OPTIONS>] <DATA_FILE>In case that the output data is wanted in another format than the InfluxDB Line Protocol, the program can also convert it into different formats. There are multiple examples about the different output formats in the example/ directory.
Tipp: If you only want to convert data inbetween different formats,
use --timebase 0, which lets the timestamps untouched:
# Example for only updating the data format without timestamp conversion
telhelp \
--no-show \
--timebase 0 \
--output ~/Documents/METER-1-launch.csv \
--data-format csv \
./example/data_updated.txt
