project reorganization: 1. executable files in bin directory now. 2. add recursive_unpack_targz.py for recursive unpacking specified in this script archives tar.gz with MVN data. 3. add asotr_unzip_plot.sh bash file for unpacking MVN data, collect asotr data into csv files and plot asotr MVN data. 4. add brd_wheel_1Hz_parser.py for demonstrate how to work with brd telemetry data
This commit is contained in:
41
bin/impulse_response.py
Normal file
41
bin/impulse_response.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import sys
|
||||
from importlib import reload
|
||||
sys.path.append('./')
|
||||
import asotr
|
||||
reload(asotr)
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib import dates
|
||||
import pandas as pd
|
||||
from datetime import datetime
|
||||
|
||||
asotr_kit = 1
|
||||
fname = f'../../python_cyclo/data/asotr0{asotr_kit}_data_T.csv'
|
||||
|
||||
dateparse = lambda x: datetime.strptime(x, "%d.%m.%Y %H:%M:%S.%f")
|
||||
data = pd.read_csv(fname, sep=';', parse_dates=['timestamp'], date_parser=dateparse)
|
||||
|
||||
interp = {'method': 'polynomial', 'order': 2}
|
||||
thermocycle_info = {'date': '14.03.2025', 'type': 'impuse'}
|
||||
cut_step_resp = {'orig_time_step_begin': '14.03.2025 13:49:32', 'orig_step_duration': 20*60}
|
||||
data_info = {'data': data, 'channel': 'ch1', 'period': '1 сек', 'find_accuracy': 'seconds'}
|
||||
|
||||
name = f'{thermocycle_info["type"]}_response_{thermocycle_info["date"].replace(".","")}'
|
||||
|
||||
plot_info = {'title': 'Реакция на импульсное воздействие',
|
||||
'ox_dtime_format': "%H:%M:%S", 'legend_pos': ['upper right', 'lower left'],
|
||||
'name_fig': f'../plots/response/{name}.png',
|
||||
'font': 10}
|
||||
|
||||
tstamp_orig_begin = cut_step_resp['orig_time_step_begin']
|
||||
|
||||
_, interp_imp_resp = asotr.cut_norm_data(data_info['data'], tstamp_orig_begin,
|
||||
cut_step_resp['orig_step_duration'], channel='ch1', interp=interp,
|
||||
accuracy=data_info['find_accuracy'])
|
||||
|
||||
|
||||
interp_imp_resp.to_csv(f'../data/asotr/response/asotr0{asotr_kit}_{name}.csv', index=False, sep=';',
|
||||
encoding='utf-8-sig', decimal='.')
|
||||
|
||||
asotr.plot_imp_response(interp_imp_resp, data_info, plot_info, thermocycle_info)
|
Reference in New Issue
Block a user