From 801d4563b2984ea3a8b00bc81c24eec6edd367fd Mon Sep 17 00:00:00 2001 From: Danila Gamkov Date: Mon, 9 Jun 2025 14:37:23 +0300 Subject: [PATCH] add .bat files for cmd windows --- bin/asotr_unzip_plot.bat | 21 +++++++++++++++++++++ bin/brd_wheel_1Hz_parser.py | 18 ++++-------------- bin/plot_flight_borders.bat | 21 +++++++++++++++++++++ 3 files changed, 46 insertions(+), 14 deletions(-) create mode 100755 bin/asotr_unzip_plot.bat create mode 100755 bin/plot_flight_borders.bat diff --git a/bin/asotr_unzip_plot.bat b/bin/asotr_unzip_plot.bat new file mode 100755 index 0000000..e073082 --- /dev/null +++ b/bin/asotr_unzip_plot.bat @@ -0,0 +1,21 @@ +@echo off +REM check for one argument +IF "%~1"=="" ( + echo error using scrpt. Right use this script: + echo %~nx0 path + goto :EOF +) + +REM copy acotr_csv parsert to /bin +copy "..\asotr_csv\target\release\asotr_csv.exe" .\ + +set "path_=%~1" + +REM unpacking recursively archive using Python script +python recursive_unpack_targz.py "%path_%" + +REM run parser +asotr_csv.exe -d "%path_%" + +REM plot data +python plot_asotr_flight_all.py diff --git a/bin/brd_wheel_1Hz_parser.py b/bin/brd_wheel_1Hz_parser.py index d838a59..b4bbfeb 100644 --- a/bin/brd_wheel_1Hz_parser.py +++ b/bin/brd_wheel_1Hz_parser.py @@ -93,7 +93,7 @@ def collect_tm_brd_wheel_data(root_dir_wheel_data, column_list, column_list_itog print('data saved: ' + fname) -## collect raw tm brd data into one file for each brd +### collect raw tm brd data into one file for each brd ### root_dir_tm_data = '/home/danila/Danila/work/MVN/flight/brd_data/arch_for_MB/archive_tm_data_txt/' column_list = ['TIME', 'PER_1Hz', 'ST_HV'] @@ -102,6 +102,8 @@ column_list_itog = ['TIME', 'timestamp', 'PER_1Hz', 'ST_HV'] collect_tm_brd_files(root_dir_tm_data, column_list, column_list_itog) +### collect raw tm wheel data into one file for each brd ### + root_dir_wheel_data = '/home/danila/Danila/work/MVN/flight/brd_data/arch_for_MB/archive_wheel_data_txt/' column_list = ['TIME', 'STATE'] column_list_itog = ['TIME', 'timestamp', 'STATE'] @@ -109,7 +111,6 @@ column_list_itog = ['TIME', 'timestamp', 'STATE'] collect_tm_brd_wheel_data(root_dir_wheel_data, column_list, column_list_itog) - ## plot 'evolution' 1 Hz from tm brd data fname = path_itog_brd_data + 'mvn_tm_brd01.csv' @@ -120,6 +121,7 @@ plt.plot(df['timestamp'], df['PER_1Hz'], '.') plt.show() +## parse and plot wheel csv data border_clr_wheel = 2 fname = path_itog_brd_data + 'mvn_wheel_brd01.csv' @@ -136,15 +138,3 @@ wheel_df_peaks = wheel_df[(wheel_df['TIME_diff'] <= median_tdiff - border_clr_wh plt.plot(wheel_df_clear['TIME'], wheel_df_clear['TIME_diff']) plt.show() - - - -# df1 = df[df['TIME_diff'] < 30.6] -# print(df[df['TIME_diff'] > 30.6 or df['TIME_diff'] < 29.4] ) - -# for idx, row in df.iterrows(): -# print(row['TIME']) - - - - diff --git a/bin/plot_flight_borders.bat b/bin/plot_flight_borders.bat new file mode 100755 index 0000000..25eb6e7 --- /dev/null +++ b/bin/plot_flight_borders.bat @@ -0,0 +1,21 @@ +@echo off +REM check for two arguments +IF "%~2"=="" ( + echo Error: Incorrect usage. + echo Usage: %~nx0 25.02.2025_00:00:00 10.03.2025_23:59:59 + goto :EOF +) + +set "path_csv_data=..\data\asotr" +set "begin=%~1" +set "end=%~2" + +REM run Python-script with parameters +python plot_flight_borders.py -s "%path_csv_data%" -c 111100 -a 01 -b %begin% -e %end% +python plot_flight_borders.py -s "%path_csv_data%" -c 001000 -a 01 -b %begin% -e %end% +python plot_flight_borders.py -s "%path_csv_data%" -c 000011 -a 01 -b %begin% -e %end% +python plot_flight_borders.py -s "%path_csv_data%" -c 111100 -a 02 -b %begin% -e %end% +python plot_flight_borders.py -s "%path_csv_data%" -c 010100 -a 02 -b %begin% -e %end% +python plot_flight_borders.py -s "%path_csv_data%" -c 010000 -a 02 -b %begin% -e %end% +python plot_flight_borders.py -s "%path_csv_data%" -c 000100 -a 02 -b %begin% -e %end% +python plot_flight_borders.py -s "%path_csv_data%" -c 000011 -a 02 -b %begin% -e %end%