-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserInterface.py
165 lines (152 loc) · 4.94 KB
/
UserInterface.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# HTML for 2D fitter form
htmlForm_2D = '''
<table border=1 cellpadding=20>
<tr><td><b>Example 2D f(x) Web Fitter</b></td></tr>
<tr><td>
<form action="/simplefitter_2D" method="post" target=_blank>
--- 2D Text Data ---<br>
<textarea rows="10" cols="45" name="textdata" wrap=off>
Example 2D data for testing
X Y
5.357 10.376
5.457 10.489
5.936 11.049
6.161 11.327 ending text is ignored
6.697 12.054
8.442 14.744
9.769 17.068
9.861 17.104
</textarea>
<br><br>
--- Example 2D Equations ---<br>
<input type="radio" name="equation" value="Linear" checked>Linear Polynomial<br>
<input type="radio" name="equation" value="Quadratic">Quadratic Polynomial<br>
<input type="radio" name="equation" value="Cubic">Cubic Polynomial<br>
<input type="radio" name="equation" value="WitchA">Witch Of Maria Agnesi A<br>
<input type="radio" name="equation" value="LorentzianPeakCWithOffset">Lorentzian Peak C With Offset<br>
<input type="radio" name="equation" value="GammaRayDegreesB">Gamma Ray Angular Distribution (degrees) B<br>
<input type="radio" name="equation" value="ExponentialWithOffset">Exponential With Offset<br>
<br>
<table><tr>
<td>
<input type="submit" value="Submit">
</td>
<td align="left">
<input type="radio" name="target" value="SSQABS" checked>Lowest Sum Of Squared Absolute Error<br>
<input type="radio" name="target" value="LNQREL">Lowest Sum Of Squared Log[Pred/Actual]<br>
<input type="radio" name="target" value="SSQREL">Lowest Sum Of Squared Relative Error<br>
<input type="radio" name="target" value="ODR">Lowest Sum Of Squared Orthogonal Distance<br>
</td>
</tr></table>
</form>
<br><br>
<a href="/equationlist_2D">Link to all standard 2D equations</a>
</td></tr></table>
'''
# HTML for 3D fitter form
htmlForm_3D = '''
<table border=1 cellpadding=20>
<tr><td><b>Example 3D f(x,y) Web Fitter</b></td></tr>
<tr><td>
<form action="/simplefitter_3D" method="post" target=_blank>
--- 3D Text Data ---<br>
<textarea rows="10" cols="45" name="textdata" wrap=off>
Example 3D data for testing
X Y Z
3.017 2.175 0.0320
2.822 2.624 0.0629
1.784 3.144 6.570
1.712 3.153 6.721
2.972 2.106 0.0313
2.719 2.542 0.0643
2.0 2.6 4.0 ending text is ignored
1.479 2.957 6.583
1.387 2.963 6.744
2.843 1.984 0.0315
2.485 2.320 0.0639
0.742 2.568 6.581
0.607 2.571 6.753
</textarea>
<br><br>
--- Example 3D Equations ---<br>
<input type="radio" name="equation" value="Linear" checked>Linear Polynomial<br>
<input type="radio" name="equation" value="FullQuadratic">Full Quadratic Polynomial<br>
<input type="radio" name="equation" value="FullCubic">Full Cubic Polynomial<br>
<input type="radio" name="equation" value="MonkeySaddleA">Monkey Saddle A<br>
<input type="radio" name="equation" value="GaussianCurvatureOfWhitneysUmbrellaA">Gaussian Curvature Of Whitneys Umbrella A<br>
<input type="radio" name="equation" value="NIST_NelsonAutolog">NIST Nelson Autolog<br>
<input type="radio" name="equation" value="CustomPolynomialOne">Custom Polynomial One<br>
<br>
<table><tr>
<td>
<input type="submit" value="Submit">
</td>
<td align="left">
<input type="radio" name="target" value="SSQABS" checked>Lowest Sum Of Squared Absolute Error<br>
<input type="radio" name="target" value="LNQREL">Lowest Sum Of Squared Log[Pred/Actual]<br>
<input type="radio" name="target" value="SSQREL">Lowest Sum Of Squared Relative Error<br>
<input type="radio" name="target" value="ODR">Lowest Sum Of Squared Orthogonal Distance<br>
</td>
</tr></table>
</form>
<br><br>
<a href="/equationlist_3D">Link to all standard 3D equations</a>
</td></tr></table>
'''
htmlForm_2D_All = '''
<table border=1 cellpadding=20>
<tr><td><b>All 2D Equations</b></td></tr>
<tr><td>
<form action="/fitter_2D_All" method="post" target=_blank>
--- 2D Text Data ---<br>
<textarea rows="10" cols="45" name="textdata" wrap=off>
Example 2D data for testing
X Y
5.357 10.376
5.457 10.489
5.936 11.049
6.161 11.327 ending text is ignored
6.697 12.054
8.442 14.744
9.769 17.068
9.861 17.104
</textarea>
<br><br>
<input type="textbox" name="count" placeholder="Enter a number">
<br><br>
<input type="submit" value="Submit">
</form>
<br><br>
</td></tr></table>
'''
htmlForm_3D_All = '''
<table border=1 cellpadding=20>
<tr><td><b>All 3D Equations</b></td></tr>
<tr><td>
<form action="/fitter_3D_All" method="post" target=_blank>
--- 3D Text Data ---<br>
<textarea rows="10" cols="45" name="textdata" wrap=off>
Example 3D data for testing
X Y Z
3.017 2.175 0.0320
2.822 2.624 0.0629
1.784 3.144 6.570
1.712 3.153 6.721
2.972 2.106 0.0313
2.719 2.542 0.0643
2.0 2.6 4.0 ending text is ignored
1.479 2.957 6.583
1.387 2.963 6.744
2.843 1.984 0.0315
2.485 2.320 0.0639
0.742 2.568 6.581
0.607 2.571 6.753
</textarea>
<br><br>
<input type="textbox" name="count" placeholder="Enter a number">
<br><br>
<input type="submit" value="Submit">
</form>
<br><br>
</td></tr></table>
'''