power check ok
This commit is contained in:
parent
4bf0dfc70d
commit
b904f19500
|
@ -1,3 +1,3 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//double *power(int **p);
|
void *power(int **p, double a[]);
|
1600022
Code-C/rawData.txt
1600022
Code-C/rawData.txt
File diff suppressed because it is too large
Load diff
|
@ -1,39 +1,34 @@
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
# import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import csv
|
import csv
|
||||||
|
|
||||||
#"C:\Users\quent\OneDrive\Bureau\ENSC\TransD\Framboisier\02400001.TXT"
|
|
||||||
#! /usr/bin/env python3
|
|
||||||
# -*- coding: UTF-8 -*-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
taille = 100000
|
taille = 100000
|
||||||
freq = 250
|
freq = 250
|
||||||
periode = 1 / freq
|
periode = 1 / freq
|
||||||
temps = periode * taille
|
temps = periode * taille
|
||||||
resultat = np.zeros(taille)
|
resultat = np.zeros([taille,8])
|
||||||
i = 0
|
j = 0
|
||||||
# opening the CSV file
|
# opening the CSV file
|
||||||
with open('rawData.csv', mode ='r') as file:
|
with open('rawData.csv', mode ='r') as file:
|
||||||
|
|
||||||
# reading the CSV file
|
# reading the CSV file
|
||||||
csvFile = csv.DictReader(file)
|
csvFile = csv.reader(file, delimiter=",")
|
||||||
|
|
||||||
# displaying the contents of the CSV file
|
# displaying the contents of the CSV file
|
||||||
for lines in csvFile:
|
for lines in csvFile:
|
||||||
resultat[i] = lines
|
line = np.zeros(8)
|
||||||
print(lines)
|
for i in range(8):
|
||||||
i+=1
|
line[i] = lines[i+1]
|
||||||
|
resultat[j] = line
|
||||||
|
j+=1
|
||||||
|
if(j == taille) : break
|
||||||
"""
|
#print(resultat.shape)
|
||||||
resultat*=resultat
|
resultat*=resultat
|
||||||
aire = 0
|
for i in range(8):
|
||||||
for i in range(taille-1):
|
aire = 0
|
||||||
aire += (resultat[i]+resultat[i+1]) / 2 * periode
|
for j in range(taille-1):
|
||||||
res = aire/temps
|
aire += (resultat[j,i]+resultat[j+1,i]) / 2 * periode
|
||||||
print(res)"""
|
res = aire/temps
|
||||||
|
print("power c°" + str(i+1) + " : " + str(res))
|
Loading…
Reference in a new issue