Refactor: 1. add print into console data, 2. rewrite CLI parsing, 4. the output format csv has been reworked. 5. Add information to README. For addition create python code for plot csv data

This commit is contained in:
Danila Gamkov
2025-01-29 13:47:36 +03:00
parent d3cf1281dd
commit b44fc029fc
10 changed files with 458 additions and 74 deletions

30
data/prepare_csv.sh Executable file
View File

@@ -0,0 +1,30 @@
#! /bin/bash
if [ $# != 2 ]
then
echo "error use $0. Right use this script: "
echo "$0 path_to_file data_type (flight or KDI)"
echo "example 1: $0 ./data/flight/30_12_2024/ASOTR_1_SOTR_T flight"
else
data_file=$1
data_type=$2
if [ "$data_type" == "flight" ]
then
cat ${data_file}.csv | grep -Eo '[0-9]{2}\.[0-9]{2}\.[0-9]{4}' > file1
cat ${data_file}.csv | grep -Eo [0-9]{2}:.* > file2
elif [ "$data_type" == "KDI" ]
then
cat ${data_file}.csv | grep -Eo [0-9]{2}.[0-9]{2}.[0-9]{4} > file1
cat ${data_file}.csv | grep -Eo [0-9]{2}:.* > file2
else
echo "error argument of data_type: write \"flight\" or \"KDI\" in second argument"
exit 1
fi
paste --delimiter=' ' file1 file2 > file.csv
echo "timestamp;ch1;ch2;ch3;ch4;ch5;ch6" > ${data_file}_clear.csv
cat file.csv >> ${data_file}_clear.csv
rm file1 file2 file.csv
fi