@@ -39,7 +39,7 @@ def plotIntegral(data, a, b, typ, trapezoidals = False):
39
39
plt .savefig (filename , dpi = 600 )
40
40
plt .show ()
41
41
42
- def trapezoidalIntegration (data , a , b ):
42
+ def compositeTrapezoidalIntegration (data , a , b ):
43
43
""" returns trapezoidal integral between a, b
44
44
finds nearest x values to a and b where b > a"""
45
45
aIdx = (np .abs (data [:, 0 ] - a )).argmin ()
@@ -95,7 +95,7 @@ def performIntegration(data, idx, f, typ):
95
95
integrals [i ], a , b = f (data , a , b )
96
96
plotIntegral (data , a , b , typ )
97
97
98
- print ("type : {typ}"
98
+ print ("type : {typ}" )
99
99
for i in range (len (integrals )):
100
100
print (f"I{ i } = { integrals [i ]} " )
101
101
print ("---------" )
@@ -122,7 +122,7 @@ def performIntegration(data, idx, f, typ):
122
122
[14. , 14.75 ],
123
123
[20.1 , 21. ],
124
124
[24.7 , 25.6 ]])
125
- # performIntegration(dataUnknown, naclIdx, compositeSimpsonsIntegration, "unknown")
125
+ performIntegration (dataUnknown , naclIdx , compositeSimpsonsIntegration , "unknown" )
126
126
127
127
# indexes used by dataGAuss integration
128
128
kclIdx = np .array ([
@@ -133,17 +133,17 @@ def performIntegration(data, idx, f, typ):
133
133
[13.5 , 14.95 ],
134
134
[19.5 , 21.5 ],
135
135
[24.7 , 25.6 ]])
136
- # performIntegration(dataGauss, naclIdx, compositeSimpsonsIntegration, "gauss")
136
+ performIntegration (dataGauss , naclIdx , compositeSimpsonsIntegration , "gauss" )
137
137
138
138
# indexes used by si integration
139
- siIdx = np .array ([
140
- [11.93 , 13.86 ],
141
- [20.47 , 21.9 ],
142
- [24.38 , 25.59 ]])
143
- performIntegration (dataSi , siIdx , trapezoidalIntegration , "si" )
144
-
145
- siIdx = np .array ([
146
- [12.25 , 13.25 ],
147
- [20.75 , 21.75 ],
148
- [24.37 , 25.5 ]])
149
- performIntegration (dataSi , siIdx , trapezoidalIntegration , "si" )
139
+ # siIdx = np.array([
140
+ # [11.93, 13.86],
141
+ # [20.47, 21.9],
142
+ # [24.38, 25.59]])
143
+ # performIntegration(dataSi, siIdx, trapezoidalIntegration, "si")
144
+
145
+ # siIdx = np.array([
146
+ # [12.25, 13.25],
147
+ # [20.75, 21.75],
148
+ # [24.37, 25.5]])
149
+ # performIntegration(dataSi, siIdx, trapezoidalIntegration, "si")
0 commit comments