diff --git a/crates/applications/stacked_cores/scripts/stacked_cores_40xx_db.py b/crates/applications/stacked_cores/scripts/stacked_cores_40xx_db.py index 0c7a23b..8e52d47 100644 --- a/crates/applications/stacked_cores/scripts/stacked_cores_40xx_db.py +++ b/crates/applications/stacked_cores/scripts/stacked_cores_40xx_db.py @@ -21,14 +21,17 @@ sims = [ ("40-0.00059999997rad-6coupling-11_1_winding-5e10-drive", "fwd_40_600um_6_11_1_5e10", 10000), ] -measurements = { real: (human, norm) for (real, human, norm) in sims } +measurements = { real: [human, norm, None, None] for (real, human, norm) in sims } -def set_meas(name: str, pw: Piecewise): - human, norm = measurements[name] - globals()[human] = measurements[name] = pw.normalized(norm) +def set_meas(name: str, expr: str): + pw = eval(expr) + measurements[name][2] = expr + human, norm, _, _ = measurements[name] + globals()[human] = measurements[name][3] = pw.normalized(norm) -set_meas("40-0.0004rad-12coupling-3_1_winding-5e10-drive", Piecewise( +set_meas("40-0.0004rad-12coupling-3_1_winding-5e10-drive", """ +Piecewise( [ [ -16453, -5877 ], # -2.0 [ -16171, -5444 ], # -1.5 @@ -57,9 +60,11 @@ set_meas("40-0.0004rad-12coupling-3_1_winding-5e10-drive", Piecewise( [ 13301, 16442 ], # 1.5 [ 14146, 16474 ], # 2.0 ] -)) +) +""") -set_meas("40-0.0004rad-6coupling-3_1_winding-5e10-drive", Piecewise( +set_meas("40-0.0004rad-6coupling-3_1_winding-5e10-drive", """ +Piecewise( [ [ -16689, -6116 ], # -2.0 [ -16510, -5954 ], # -1.5 @@ -88,9 +93,11 @@ set_meas("40-0.0004rad-6coupling-3_1_winding-5e10-drive", Piecewise( [ 15309, 15457 ], # 1.5 [ 16329, 15683 ], # 2.0 ] -)) +) +""") -set_meas("40-0.0004rad-6coupling-7_1_winding-5e10-drive", Piecewise( +set_meas("40-0.0004rad-6coupling-7_1_winding-5e10-drive", """ +Piecewise( [ [ -16244, -8159 ], # -2.0 [ -15756, -7835 ], # -1.5 @@ -119,9 +126,11 @@ set_meas("40-0.0004rad-6coupling-7_1_winding-5e10-drive", Piecewise( [ 12329, 11657 ], # 1.5 [ 13223, 12045 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-20coupling-3_1_winding-3e10-drive", Piecewise( +set_meas("40-0.00059999997rad-20coupling-3_1_winding-3e10-drive", """ +Piecewise( [ [ -9940, -2886 ], # -2.0 [ -9292, -2432 ], # -1.5 @@ -150,9 +159,11 @@ set_meas("40-0.00059999997rad-20coupling-3_1_winding-3e10-drive", Piecewise( [ 7699, 6755 ], # 1.5 [ 8113, 6906 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-20coupling-3_1_winding-5e10-drive", Piecewise( +set_meas("40-0.00059999997rad-20coupling-3_1_winding-5e10-drive", """ +Piecewise( [ [ -11623, -2886 ], # -2.0 [ -10847, -2125 ], # -1.5 @@ -181,9 +192,11 @@ set_meas("40-0.00059999997rad-20coupling-3_1_winding-5e10-drive", Piecewise( [ 8790, 13075 ], # 1.5 [ 9248, 13503 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-20coupling-3_1_winding-1e11-drive", Piecewise( +set_meas("40-0.00059999997rad-20coupling-3_1_winding-1e11-drive", """ +Piecewise( [ [ -14284, -3414 ], # -2.0 [ -13332, -2406 ], # -1.5 @@ -212,9 +225,11 @@ set_meas("40-0.00059999997rad-20coupling-3_1_winding-1e11-drive", Piecewise( [ 10166, 14547 ], # 1.5 [ 10774, 14789 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-20coupling-3_1_winding-2e11-drive", Piecewise( +set_meas("40-0.00059999997rad-20coupling-3_1_winding-2e11-drive", """ +Piecewise( [ [ -17130, -2396 ], # -2.0 [ -16555, -1969 ], # -1.5 @@ -243,9 +258,11 @@ set_meas("40-0.00059999997rad-20coupling-3_1_winding-2e11-drive", Piecewise( [ 11938, 11738 ], # 1.5 [ 13090, 12062 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-12coupling-5_1_winding-5e10-drive", Piecewise( +set_meas("40-0.00059999997rad-12coupling-5_1_winding-5e10-drive", """ +Piecewise( [ [ -11347, -6303 ], # -2.0 [ -10626, -5304 ], # -1.5 @@ -274,9 +291,11 @@ set_meas("40-0.00059999997rad-12coupling-5_1_winding-5e10-drive", Piecewise( [ 7278, 6265 ], # 1.5 [ 7937, 6759 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-12coupling-5_1_winding-1e11-drive", Piecewise( +set_meas("40-0.00059999997rad-12coupling-5_1_winding-1e11-drive", """ +Piecewise( [ [ -14026, -4901 ], # -2.0 [ -13014, -4368 ], # -1.5 @@ -305,9 +324,11 @@ set_meas("40-0.00059999997rad-12coupling-5_1_winding-1e11-drive", Piecewise( [ 9248, 12388 ], # 1.5 [ 10140, 13087 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-12coupling-5_1_winding-2e11-drive", Piecewise( +set_meas("40-0.00059999997rad-12coupling-5_1_winding-2e11-drive", """ +Piecewise( [ [ -17015, -1518 ], # -2.0 [ -16471, -1243 ], # -1.5 @@ -336,9 +357,11 @@ set_meas("40-0.00059999997rad-12coupling-5_1_winding-2e11-drive", Piecewise( [ 11594, 10686 ], # 1.5 [ 12900, 10836 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-8coupling-7_1_winding-5e10-drive", Piecewise( +set_meas("40-0.00059999997rad-8coupling-7_1_winding-5e10-drive", """ +Piecewise( [ [ -11191, -8744 ], # -2.0 [ -10386, -8104 ], # -1.5 @@ -367,9 +390,11 @@ set_meas("40-0.00059999997rad-8coupling-7_1_winding-5e10-drive", Piecewise( [ 6868, 1020 ], # 1.5 [ 7684, 1464 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-8coupling-7_1_winding-1e11-drive", Piecewise( +set_meas("40-0.00059999997rad-8coupling-7_1_winding-1e11-drive", """ +Piecewise( [ [ -14253, -5453 ], # -2.0 [ -13129, -5047 ], # -1.5 @@ -398,9 +423,11 @@ set_meas("40-0.00059999997rad-8coupling-7_1_winding-1e11-drive", Piecewise( [ 9254, 7438 ], # 1.5 [ 10288, 7992 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-6coupling-9_1_winding-5e10-drive", Piecewise( +set_meas("40-0.00059999997rad-6coupling-9_1_winding-5e10-drive", """ +Piecewise( [ [ -11138, -9779 ], # -2.0 [ -10280, -9491 ], # -1.5 @@ -429,9 +456,11 @@ set_meas("40-0.00059999997rad-6coupling-9_1_winding-5e10-drive", Piecewise( [ 6678, -2391 ], # 1.5 [ 7561, -1986 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-6coupling-9_1_winding-1e11-drive", Piecewise( +set_meas("40-0.00059999997rad-6coupling-9_1_winding-1e11-drive", """ +Piecewise( [ [ -14471, -5820 ], # -2.0 [ -13297, -5501 ], # -1.5 @@ -460,9 +489,11 @@ set_meas("40-0.00059999997rad-6coupling-9_1_winding-1e11-drive", Piecewise( [ 9255, 3962 ], # 1.5 [ 10362, 4340 ], # 2.0 ] -)) +) +""") -set_meas("40-0.00059999997rad-6coupling-11_1_winding-5e10-drive", Piecewise( +set_meas("40-0.00059999997rad-6coupling-11_1_winding-5e10-drive", """ +Piecewise( [ [ -10841, -10684 ], # -2.0 [ -10118, -10416 ], # -1.5 @@ -491,4 +522,5 @@ set_meas("40-0.00059999997rad-6coupling-11_1_winding-5e10-drive", Piecewise( [ 5884, -4342 ], # 1.5 [ 6611, -4071 ], # 2.0 ] -)) +) +""")