Skip to content

Commit 14c80ff

Browse files
committed
pipeline complete 😎
1 parent b265c3d commit 14c80ff

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

calculate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def SSE(indicies, prediction, logits, logits_error, function):
5252
def unwrap(datatable):
5353
return datatable.inches, datatable.normalized_count_rate.apply(lambda x:x.value), datatable.normalized_count_rate.apply(lambda x:x.delta)
5454

55-
def sMinFit(datatable, function, param=1, lr=1e-4, epsilon=1e-8, epochs=100000):
55+
def sMinFit(datatable, function, param=1, lr=1e-4, epsilon=1e-8, epochs=int(1e4)):
5656
inches, logits, logits_err = unwrap(datatable)
5757
dydx = epsilon
5858

drive.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,18 @@ def plot(index):
5050
# =======
5151
# print(result.attrs["material"], result.predicted_halfthickness.apply(lambda row:row.value).mean())
5252

53-
def process(indx):
54-
t, smin = sMinFit(results[indx], RelativeIntersity, lr = 5e-4 if "tissue" == results[indx].attrs["material"] else 2e-8)
53+
def process(indx, ax=None):
54+
t, smin = sMinFit(results[indx], RelativeIntersity, lr = 5e-4 if "tissue" == results[indx].attrs["material"] else 2e-7)
5555

56-
return [smin, t]
56+
inches, logits, logits_err = unwrap(results[indx])
57+
t_min, t_max = calculateSfitUncert(t, smin, smin+1, lambda T: SSE(inches, T, logits, logits_err, RelativeIntersity), ax=ax, low=0.1, high=30)
58+
59+
if ax is not None:
60+
ax.set_xlabel(f"T ({results[7].attrs['material']})")
61+
ax.set_ylabel("S(T)")
62+
ax.legend()
63+
64+
return smin, t, t_min, t_max
5765

5866
# if __name__ == '__main__':
5967
# with Pool(5) as p:
@@ -64,14 +72,6 @@ def process(indx):
6472
# >>>>>>> 68cb3cc3a83d6f09391e99a4e1cc04d712bebe16
6573

6674
if __name__ == '__main__':
67-
# plot(7)
6875
fig, ax = plt.subplots()
69-
inches, logits, logits_err = unwrap(results[7])
70-
param = 0.946
71-
smin = 82
72-
calculateSfitUncert(param, smin, smin+1, lambda T: SSE(inches, T, logits, logits_err, RelativeIntersity), ax=ax, low=0.1, high=30)
73-
74-
ax.set_xlabel(f"T ({results[7].attrs['material']})")
75-
ax.set_ylabel("S(T)")
76-
ax.legend()
76+
print(process(7, ax))
7777
plt.show()

0 commit comments

Comments
 (0)