Compare commits
6 Commits
b44fc029fc
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
d8065e025d | ||
|
ce38d49523 | ||
|
32a9f2d5aa | ||
|
aa98cf7b3a | ||
|
bede2322ac | ||
|
65c5634372 |
@@ -12,6 +12,8 @@ The parser for converting data from the ASOTR MVN control channels into the CSV
|
|||||||
- **Output asotr_csv data files description**
|
- **Output asotr_csv data files description**
|
||||||
- **Contacts**
|
- **Contacts**
|
||||||
|
|
||||||
|
**Note**: \<PATH_TO_ASOTR_CSV\> - path where is asotr_csv program is cloned from heagit
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
1. Install Rust compiler (if you don't have).
|
1. Install Rust compiler (if you don't have).
|
||||||
Installation on Linux:
|
Installation on Linux:
|
||||||
@@ -41,7 +43,7 @@ After running this commands you will get an execution file (asotr_csv) in the fo
|
|||||||
\<PATH_TO_ASOTR_CSV\>/target/release/
|
\<PATH_TO_ASOTR_CSV\>/target/release/
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
### parsing ASOTR MVN data files in specified directory
|
### Parsing ASOTR MVN data files in specified directory
|
||||||
1. Donwload data from science data server to directory \<PATH_TO_ASOTR_DATA\>.
|
1. Donwload data from science data server to directory \<PATH_TO_ASOTR_DATA\>.
|
||||||
If you don't have MVN data, you might download it from server with science SRG data (IP: 193.232.11.95).
|
If you don't have MVN data, you might download it from server with science SRG data (IP: 193.232.11.95).
|
||||||
For questions about downloading science data contact Shtykovsky A. (a.shtykovsky@cosmos.ru) or Chelovekov I. (chelovekov@cosmos.ru)
|
For questions about downloading science data contact Shtykovsky A. (a.shtykovsky@cosmos.ru) or Chelovekov I. (chelovekov@cosmos.ru)
|
||||||
@@ -62,7 +64,7 @@ cd <PATH_TO_ASOTR_CSV>/target/release/
|
|||||||
csv data are ready to use in directory:
|
csv data are ready to use in directory:
|
||||||
\<PATH_TO_ASOTR_CSV\>/target/release/
|
\<PATH_TO_ASOTR_CSV\>/target/release/
|
||||||
|
|
||||||
### parsing all ASOTR MVN data files in specified directory and subdirectories
|
### Parsing all ASOTR MVN data files in specified directory and subdirectories
|
||||||
1. Donwload data from science data server to directory \<PATH_TO_ASOTR_DATA\>.
|
1. Donwload data from science data server to directory \<PATH_TO_ASOTR_DATA\>.
|
||||||
If you don't have MVN data, you might download it from server with science SRG data (IP: 193.232.11.95).
|
If you don't have MVN data, you might download it from server with science SRG data (IP: 193.232.11.95).
|
||||||
For questions about downloading science data contact Shtykovsky A. (a.shtykovsky@cosmos.ru) or Chelovekov I. (chelovekov@cosmos.ru)
|
For questions about downloading science data contact Shtykovsky A. (a.shtykovsky@cosmos.ru) or Chelovekov I. (chelovekov@cosmos.ru)
|
||||||
@@ -70,21 +72,36 @@ For questions about downloading science data contact Shtykovsky A. (a.shtykovsky
|
|||||||
2. Run linux bash script **asotr_all_unzip.sh** for directory with MVN data in order to unpack all **asotr.tar.gz** archives with ASOTR MVN data, for example:
|
2. Run linux bash script **asotr_all_unzip.sh** for directory with MVN data in order to unpack all **asotr.tar.gz** archives with ASOTR MVN data, for example:
|
||||||
```
|
```
|
||||||
cd <PATH_TO_ASOTR_CSV>
|
cd <PATH_TO_ASOTR_CSV>
|
||||||
./asotr_all_unzip.sh <PATH_TO_ASOTR_DATA>
|
./asotr_all_unzip.sh <PATH_TO_ASOTR_DATA>/
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note**: the script **asotr_all_unzip.sh** will not work on windows, you will need to unpack the each archive **\<PATH_TO_ASOTR_DATA\>/\<DIRECTORY_WITH_DATA\>/data/asotr.tar.gz** manually or write the corresponding Windows bat-file
|
**Note**: the script **asotr_all_unzip.sh** will not work on windows, you will need to unpack the each archive **\<PATH_TO_ASOTR_DATA\>/\<DIRECTORY_WITH_DATA\>/data/asotr.tar.gz** manually or write the corresponding Windows bat-file
|
||||||
|
|
||||||
3. Run program asotr_csv:
|
If you want to parse astor data in specified directory, run program asotr_csv directly:
|
||||||
```
|
```
|
||||||
cd <PATH_TO_ASOTR_CSV>/target/release/
|
cd <PATH_TO_ASOTR_CSV>/target/release/
|
||||||
./asotr_csv -d <PATH_TO_ASOTR_DATA>
|
./asotr_csv -d <PATH_TO_ASOTR_DATA>
|
||||||
```
|
```
|
||||||
csv data are ready to use in directory:
|
Or if you want to parse all raw data from ASOTR into csv files and plot csv data you might use shell script:
|
||||||
\<PATH_TO_ASOTR_CSV\>/target/release/
|
```
|
||||||
|
cd <PATH_TO_ASOTR_CSV>
|
||||||
|
./asotr_all_unzip_auto.sh
|
||||||
|
```
|
||||||
|
csv data will be in directory:
|
||||||
|
\<PATH_TO_ASOTR_CSV\>/data/
|
||||||
|
|
||||||
### Plot csv data in Python
|
### Plot csv data in Python
|
||||||
If you want to plot csv data you might use \<PATH_TO_ASOTR_CSV\>/**asotr_all_unzip_auto.sh** shell script or use \<PATH_TO_ASOTR_CSV\>/data/**plot_flight_all.py** python-script directly for set different configurations.
|
If you want to parse all raw data from astor into csv files and plot csv data you might use shell script:
|
||||||
|
```
|
||||||
|
cd <PATH_TO_ASOTR_CSV>
|
||||||
|
./asotr_all_unzip_auto.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
or if you already have csv files with ASOTR data, you might use plot script only:
|
||||||
|
```
|
||||||
|
cd <PATH_TO_ASOTR_CSV>/data/
|
||||||
|
python3 plot_flight_all.py
|
||||||
|
```
|
||||||
|
|
||||||
## Output asotr_csv data files description
|
## Output asotr_csv data files description
|
||||||
**description:**
|
**description:**
|
||||||
|
@@ -7,5 +7,6 @@ then
|
|||||||
echo "example 1: $0 ./20250120-000"
|
echo "example 1: $0 ./20250120-000"
|
||||||
else
|
else
|
||||||
path_=$1
|
path_=$1
|
||||||
tar -xvzf ${path_}/data/asotr.tar.gz -C ${path_}/data
|
tar -xzf ${path_}/data/asotr.tar.gz -C ${path_}/data
|
||||||
|
tar -xzf ${path_}/logs.tar.gz -C ${path_}
|
||||||
fi
|
fi
|
||||||
|
BIN
data/beta_2025.xlsx
Normal file
BIN
data/beta_2025.xlsx
Normal file
Binary file not shown.
@@ -4,33 +4,49 @@ import pandas as pd
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
font = 10
|
font = 4
|
||||||
print_width = 20
|
print_width = 6
|
||||||
print_height = 12
|
print_height = 4
|
||||||
width = 1
|
width = 1
|
||||||
plot_windows = 2
|
plot_windows = 2
|
||||||
channels = [1, 1, 1, 1, 1, 1]
|
channels = [0, 0, 1, 0, 0, 1]
|
||||||
|
asotr_kit = '01'
|
||||||
|
|
||||||
xborders=False
|
xborders=False
|
||||||
begin=0;
|
begin=0;
|
||||||
end=0;
|
end=0;
|
||||||
|
|
||||||
path = '/home/danila/Danila/work/MVN/Soft/asotr_csv/data/'
|
path_B = './'
|
||||||
fname = 'asotr01_data_T.csv'
|
fname_B = 'beta_2025.xlsx'
|
||||||
fname_pow = 'asotr01_data_P.csv'
|
path = './'
|
||||||
pict_name = path + "ASOTR1_flight_T_P_all"
|
fname = 'asotr' + asotr_kit + '_data_T.csv'
|
||||||
ox_dtime_format = '%d.%m.%Y %H:%M'
|
fname_pow = 'asotr' + asotr_kit + '_data_P.csv'
|
||||||
|
pict_name = path + 'ASOTR' + asotr_kit + '_flight_T_P_all'
|
||||||
|
ox_dtime_format = '%d.%m %H:%M:%S'
|
||||||
|
|
||||||
legend=['ch1', 'ch2', 'ch3', 'ch4', 'ch5', 'ch6', 'ch7']
|
legend=['БРД1', 'БРД2', 'БРД3', 'БРД4', 'плита МУП МВН, датчик1', 'плита МУП МВН, датчик 2']
|
||||||
width=[1, 1, 1, 1, 1, 1]
|
width=[1, 1, 1, 1, 1, 1]
|
||||||
|
|
||||||
marker = ['-', '-', '-', '-', '-', '-'];
|
marker = ['-', '-', '-', '-', '--', '-'];
|
||||||
width_arr = [1, 0.5, 0.2, 0.1, 1, 1]
|
width_arr = [1, 0.5, 0.2, 0.1, 1, 1]
|
||||||
|
|
||||||
fname = [path + fname, path + fname_pow]
|
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")
|
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),
|
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)]
|
pd.read_csv(fname[1], sep=';', parse_dates=['timestamp'], date_parser=dateparse)]
|
||||||
|
|
||||||
@@ -60,7 +76,7 @@ if plot_windows == 1:
|
|||||||
i = 0
|
i = 0
|
||||||
for elem in data_dict['temp']:
|
for elem in data_dict['temp']:
|
||||||
if channels[i] == 1:
|
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
|
i += 1
|
||||||
|
|
||||||
# ax.axvline(x = data['timestamp'][300], color='r', linestyle='-.', label="power=100")
|
# ax.axvline(x = data['timestamp'][300], color='r', linestyle='-.', label="power=100")
|
||||||
@@ -90,6 +106,12 @@ elif plot_windows == 2:
|
|||||||
ax1.plot(data_dict['time'][begin:end], elem[begin:end], marker[i], linewidth=width[i], label=legend[i])
|
ax1.plot(data_dict['time'][begin:end], elem[begin:end], marker[i], linewidth=width[i], label=legend[i])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
ax3 = ax1.twinx()
|
||||||
|
ax3.plot(data_b['timestamp'], data_b['beta_angle'], marker[4], color='r', linewidth=width[5], label='угол Бета')
|
||||||
|
ax3.set_ylabel('Угол Бета', fontsize=font)
|
||||||
|
ax3.tick_params(axis="y", width=1, labelsize=font)
|
||||||
|
ax3.legend(fontsize=font, loc='upper right')
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
for elem in data_dict['pow']:
|
for elem in data_dict['pow']:
|
||||||
if channels[i] == 1:
|
if channels[i] == 1:
|
||||||
@@ -102,20 +124,21 @@ elif plot_windows == 2:
|
|||||||
ax1.grid(visible=True, linestyle = 'dotted')
|
ax1.grid(visible=True, linestyle = 'dotted')
|
||||||
ax1.set_ylabel('Температура, $^\circ$C', fontsize=font)
|
ax1.set_ylabel('Температура, $^\circ$C', fontsize=font)
|
||||||
ax1.set_xlabel('Время', 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')
|
date_formatter = dates.DateFormatter(ox_dtime_format)
|
||||||
ax1.xaxis.set_major_formatter(date_formatter)
|
ax1.xaxis.set_major_formatter(date_formatter)
|
||||||
|
|
||||||
ax2.tick_params(axis="both", width=1, labelsize=font)
|
ax2.tick_params(axis="both", width=1, labelsize=font)
|
||||||
ax2.grid(visible=True, linestyle = 'dotted')
|
ax2.grid(visible=True, linestyle = 'dotted')
|
||||||
ax2.set_ylabel('Мощность, %', fontsize=font)
|
ax2.set_ylabel('Мощность, %', fontsize=font)
|
||||||
ax2.set_xlabel('Время', 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)
|
date_formatter = dates.DateFormatter(ox_dtime_format)
|
||||||
ax2.xaxis.set_major_formatter(date_formatter)
|
ax2.xaxis.set_major_formatter(date_formatter)
|
||||||
|
|
||||||
|
plt.title('АСОТР ' + asotr_kit, fontsize=font)
|
||||||
plt.tight_layout()
|
plt.tight_layout()
|
||||||
fig.savefig(pict_name)
|
fig.savefig(pict_name)
|
||||||
plt.show()
|
plt.show()
|
||||||
|
@@ -125,6 +125,7 @@ pub mod asotr_data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data.sort();
|
data.sort();
|
||||||
|
data.dedup();
|
||||||
|
|
||||||
if disp { disp_data(&data, &patterns_disp[i])?; }
|
if disp { disp_data(&data, &patterns_disp[i])?; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user