Compare commits

...

2 Commits

Author SHA1 Message Date
Danila Gamkov
bede2322ac remove consecutive repeated values in data 2025-02-21 20:14:54 +03:00
Danila Gamkov
65c5634372 fix readme 2025-01-31 15:06:08 +03:00
4 changed files with 36 additions and 15 deletions

View File

@ -96,8 +96,8 @@ asotr02_data_P.csv - ASOTR2 power data in channels 1-6 (in %)
asotr02_data_TSET.csv - ASOTR2 temperature sets in channels 1-6 (in Celsius)
**file data csv fromat:**
column 1: Unix timestamp in seconds
column 2: timestamp (data and time)
column 1: Unix timestamp in seconds
column 2: timestamp (data and time)
columns 3-8 - data from control channels (power, temperature or temperature set)

View File

@ -7,5 +7,5 @@ then
echo "example 1: $0 ./20250120-000"
else
path_=$1
tar -xvzf ${path_}/data/asotr.tar.gz -C ${path_}/data
tar -xzf ${path_}/data/asotr.tar.gz -C ${path_}/data
fi

View File

@ -4,9 +4,9 @@ import pandas as pd
from datetime import datetime
import sys
font = 10
print_width = 20
print_height = 12
font = 8
print_width = 10
print_height = 8
width = 1
plot_windows = 2
channels = [1, 1, 1, 1, 1, 1]
@ -15,22 +15,37 @@ xborders=False
begin=0;
end=0;
path_B = '/home/danila/Danila/work/MVN/flight/beta_forecast/'
fname_B = 'beta_2025.xlsx'
path = '/home/danila/Danila/work/MVN/Soft/asotr_csv/data/'
fname = 'asotr01_data_T.csv'
fname_pow = 'asotr01_data_P.csv'
pict_name = path + "ASOTR1_flight_T_P_all"
ox_dtime_format = '%d.%m.%Y %H:%M'
fname = 'asotr02_data_T.csv'
fname_pow = 'asotr02_data_P.csv'
pict_name = path + "ASOTR2_flight_T_P_all"
ox_dtime_format = '%d %H:%M'
legend=['ch1', 'ch2', 'ch3', 'ch4', 'ch5', 'ch6', 'ch7']
legend=['БРД1', 'БРД2', 'БРД3', 'БРД4', 'плита МУП МВН, датчик1', 'плита МУП МВН, датчик 2']
width=[1, 1, 1, 1, 1, 1]
marker = ['-', '-', '-', '-', '-', '-'];
marker = ['-', '-', '-', '-', '--', '-'];
width_arr = [1, 0.5, 0.2, 0.1, 1, 1]
fname = [path + fname, path + fname_pow]
fname_b = path_B + fname_B
dateparse = lambda x: datetime.strptime(x, "%d.%m.%Y %H:%M:%S.%f")
dparse_b = lambda x: datetime.strptime(x, '%Y-%m-%d %H:%M:%S')
data_b = pd.read_excel(fname_b,
sheet_name=0,
usecols=[0,1,2],
header=4,
names=['turn_num', 'beta_angle', 'timestamp'],
parse_dates=['timestamp'],
date_parser=dparse_b)
data = [pd.read_csv(fname[0], sep=';', parse_dates=['timestamp'], date_parser=dateparse),
pd.read_csv(fname[1], sep=';', parse_dates=['timestamp'], date_parser=dateparse)]
@ -60,7 +75,7 @@ if plot_windows == 1:
i = 0
for elem in data_dict['temp']:
if channels[i] == 1:
plt.plot(data_dict['time'][begin:end], elem[begin:end], marker[i], linewidth=width[i], label=legend[i])
ax.plot(data_dict['time'][begin:end], elem[begin:end], marker[i], linewidth=width[i], label=legend[i])
i += 1
# ax.axvline(x = data['timestamp'][300], color='r', linestyle='-.', label="power=100")
@ -90,6 +105,11 @@ elif plot_windows == 2:
ax1.plot(data_dict['time'][begin:end], elem[begin:end], marker[i], linewidth=width[i], label=legend[i])
i += 1
ax3 = ax1.twinx()
ax3.plot(data_b['timestamp'], data_b['beta_angle'], marker[4], linewidth=width[5], label='угол Бета')
ax3.set_ylabel('Угол Бета', fontsize=font)
ax3.legend(fontsize=font, loc='upper right')
i = 0
for elem in data_dict['pow']:
if channels[i] == 1:
@ -102,7 +122,7 @@ elif plot_windows == 2:
ax1.grid(visible=True, linestyle = 'dotted')
ax1.set_ylabel('Температура, $^\circ$C', fontsize=font)
ax1.set_xlabel('Время', fontsize=font)
ax1.legend(fontsize=font)
ax1.legend(fontsize=font, loc='lower right')
date_formatter = dates.DateFormatter('%d.%m.%Y %H')
ax1.xaxis.set_major_formatter(date_formatter)
@ -111,7 +131,7 @@ elif plot_windows == 2:
ax2.grid(visible=True, linestyle = 'dotted')
ax2.set_ylabel('Мощность, %', fontsize=font)
ax2.set_xlabel('Время', fontsize=font)
ax2.legend(fontsize=font)
ax2.legend(fontsize=font, loc='lower right')
date_formatter = dates.DateFormatter(ox_dtime_format)
ax2.xaxis.set_major_formatter(date_formatter)

View File

@ -125,6 +125,7 @@ pub mod asotr_data {
}
data.sort();
data.dedup();
if disp { disp_data(&data, &patterns_disp[i])?; }