Traitement-signal-plantes/Py-Script/puissance.py

39 lines
713 B
Python

import math
import numpy as np
# import matplotlib.pyplot as plt
import csv
#"C:\Users\quent\OneDrive\Bureau\ENSC\TransD\Framboisier\02400001.TXT"
#! /usr/bin/env python3
# -*- coding: UTF-8 -*-
taille = 100000
freq = 250
periode = 1 / freq
temps = periode * taille
resultat = np.zeros(taille)
i = 0
# opening the CSV file
with open('rawData.csv', mode ='r') as file:
# reading the CSV file
csvFile = csv.DictReader(file)
# displaying the contents of the CSV file
for lines in csvFile:
resultat[i] = lines
print(lines)
i+=1
"""
resultat*=resultat
aire = 0
for i in range(taille-1):
aire += (resultat[i]+resultat[i+1]) / 2 * periode
res = aire/temps
print(res)"""