@@ -50,10 +50,18 @@ def plot(index):
50
50
# =======
51
51
# print(result.attrs["material"], result.predicted_halfthickness.apply(lambda row:row.value).mean())
52
52
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 )
55
55
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
57
65
58
66
# if __name__ == '__main__':
59
67
# with Pool(5) as p:
@@ -64,14 +72,6 @@ def process(indx):
64
72
# >>>>>>> 68cb3cc3a83d6f09391e99a4e1cc04d712bebe16
65
73
66
74
if __name__ == '__main__' :
67
- # plot(7)
68
75
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 ))
77
77
plt .show ()
0 commit comments