Skip to content
Snippets Groups Projects
Commit 0f5113c0 authored by Baviere Merlin's avatar Baviere Merlin
Browse files

Upload New File

parents
No related branches found
No related tags found
No related merge requests found
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import sys
import os.path
if len(sys.argv)==1:
print('usage : python read_data.py <date des données>')
exit()
else:
nom = sys.argv[1]
path= "LOG_14/" + nom
if os.path.isfile(path)==False:
print('la date '+path+' n\'existe pas')
exit()
df=pd.read_csv(path+"00.csv",sep=';',skiprows=[0])
print('Taille du tableau lu :');print(df.shape)
print('Libellé des colonnes :');print(df.dtypes)
temps0 = pd.to_datetime(df.loc[:,'Date'])
delta_t0=df.loc[:,'delta_t'].values
t0=np.cumsum((delta_t0 / 3600)) + 13.26
U0=df['U'];U_moy=df['U_moy']
I0=df['I'];I_moy=df['I_moy']
df=pd.read_csv(path+"01",sep=';',skiprows=[0])
print('Taille du tableau lu :');print(df.shape)
print('Libellé des colonnes :');print(df.dtypes)
temps1 = pd.to_datetime(df.loc[:,'Date'])
delta_t1=df.loc[:,'delta_t'].values
t1=np.cumsum((delta_t0 / 3600)) + 13.26
U1=df['U'];U_moy=df['U_moy']
I1=df['I'];I_moy=df['I_moy']
df=pd.read_csv(path+"02.csv",sep=';',skiprows=[0])
print('Taille du tableau lu :');print(df.shape)
print('Libellé des colonnes :');print(df.dtypes)
temps2 = pd.to_datetime(df.loc[:,'Date'])
delta_t2=df.loc[:,'delta_t'].values
t2=np.cumsum((delta_t2 / 3600)) + 13.26
U2=df['U'];U_moy=df['U_moy']
I2=df['I'];I_moy=df['I_moy']
df=pd.read_csv(path+"03.csv",sep=';',skiprows=[0])
print('Taille du tableau lu :');print(df.shape)
print('Libellé des colonnes :');print(df.dtypes)
temps3 = pd.to_datetime(df.loc[:,'Date'])
delta_t3=df.loc[:,'delta_t'].values
t3=np.cumsum((delta_t1 / 3600)) + 13.26
U3=df['U'];U_moy=df['U_moy']
I3=df['I'];I_moy=df['I_moy']
#display
fig, axs = plt.subplots(1,2)
#crnt
axs[0].plot(t,U_moy,'--.r',label='U_moy')
axs[0].plot(t,I_moy,'--.r',label='I_moy')
axs[0].plot(t,U,'--.b',label='U')
axs[0].plot(t,I,'--.b',label='I')
axs[0].set_title("voltage")
axs[0].legend()
#tension
#show
fig.suptitle("channel : " + nom[6:8])
plt.show()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment