Commit fdde016b authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

adding scripts for climatic chamber tests

parent f6df8617
Date,P12V_V,P12V_I,P1V2_V,P3V3_V,Amb_T,LDO_T,FPGA_T,Com_E,Flash_E,Ping_E
#!/usr/bin/python3
import sys
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from datetime import datetime
import time
import numpy as np
import datetime as dt
def get_data(filename):
data = pd.read_csv(filename)
#convert date column to datetime type
data['Date'] = pd.to_datetime(data['Date'])
return data
#####################################################
def plot_temps(data, period):
x = data['Date'].dt.to_pydatetime()
mask = data['Date']>=(data['Date'].iloc[-1]-period)
tstamp = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())
fig, ax = plt.subplots(3, 2)
fig.suptitle('DI/OT System Board IGL (%s)' % tstamp)
sel_cols = ['Amb_T','LDO_T','FPGA_T']
ax[0, 0].set_ylabel('deg C')
ax[0, 0].plot(x[mask], data[mask][sel_cols])
ax[0, 0].legend(sel_cols)
sel_cols = ['P12V_V']
ax[1, 0].set_ylabel('V')
ax[1, 0].plot(x[mask], data[mask][sel_cols], scaley=True)
ax[1, 0].legend(sel_cols)
sel_cols = ['P12V_I']
ax[2, 0].set_ylabel('A')
ax[2, 0].set_xlabel('<day> <time>')
ax[2, 0].plot(x[mask], data[mask][sel_cols], scaley=True)
ax[2, 0].legend(sel_cols)
sel_cols = ['P1V2_V', 'P3V3_V']
ax[0, 1].set_ylabel('V')
ax[0, 1].plot(x[mask], data[mask][sel_cols], scaley=True)
ax[0, 1].legend(sel_cols)
sel_cols = ['Com_E', 'Flash_E', 'Ping_E']
ax[1, 1].set_ylabel('Cnt')
ax[1, 1].plot(x[mask], data[mask][sel_cols], scaley=True)
ax[1, 1].legend(sel_cols)
# Not used for now
ax[2, 1].set_facecolor('tab:gray')
ax[2, 0].set_xlabel('<day> <time>')
mng = plt.get_current_fig_manager()
mng.resize(*mng.window.maxsize())
plt.show()
#####################################################
if len(sys.argv) < 3:
print ("You did not specify the csv file and/or period (in minutes)")
sys.exit()
data = get_data(sys.argv[1])
period = dt.timedelta(minutes=int(sys.argv[2]))
plot_temps(data, period)
\ No newline at end of file
#!/bin/bash
# while [ 1 ]; do
# echo "Date:" `date +"%Y-%m-%d %H:%M:%S"`
# (cd ../tgingold/masterfip && sudo ./read-mon.sh)
# sleep 1
# done
#exctract only CSV file from the log
cat rh-log | grep CSV | sed 's/^.....//' > data.log
cat header_csv.txt data.log > data.csv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment