forked from asudhakar-umass/HappyHapke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.html
760 lines (697 loc) · 36.8 KB
/
ui.html
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
<html>
<head>
<title>Hapke Model April 2019</title>
<link rel="stylesheet" href="_static/css/page.css" type="text/css">
<link rel="stylesheet" href="_static/css/boilerplate.css" type="text/css">
<link rel="stylesheet" href="_static/css/fbm.css" type="text/css">
<link rel="stylesheet" href="_static/jquery/css/themes/base/jquery-ui.min.css">
<link rel="stylesheet" href="{{ static_url('styles.css') }}">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="mpl.js"></script>
<script src="{{ static_url('details-shim.js') }}"></script>
<script src="{{ static_url('web_ui.js') }}"></script>
<script type="text/javascript">
function remove_phase_inputs(btn) {
var div = $(btn).parent();
if ($('.phase_inputs').length === 1) {
$(':input', div).not(':button,:submit,:reset,:hidden').val('');
} else {
div.remove();
}
return false;
}
$(document).ready(WebUI('{{host}}', '{{uid}}'));
</script>
</head>
<body>
<!--
...#
..##
.#.#
...#
...#
...#
.#####
-->
<details open='open'>
<summary><span class='heading'>Initialization</span></summary>
<form method='POST' enctype='multipart/form-data'>
<section>
<div class='param_group'>
<p class="phead">Input Files</p>
<p>
Data files containing a single matrix each.
Either Matlab (.mat) format or ASCII text format is accepted.
Wavelength units should be either nm or microns (not wavenumbers).
</p>
<div id='addFiles'>
<label class="inplbl"><input type='file' class="fileElement" name='file1' />VNIR spectrum - 1</label>
<label class="inplbl"><input type='file' class="fileElement" name='file2' />VNIR spectrum - 2</label>
<label class="inplbl"><input type='file' class="fileElement" name='file3' />VNIR spectrum - 3</label>
</div>
<span id='lnkAddMore'> Add More </span>
<label class="inplbl"><input type='file' name='specwave_file' />Calibration wavelength</label>
<label class="inplbl"><input type='file' name='calspec_file' />Calibration spectrum</label>
</div>
<br />
<script>
//Adding javascript for Section One
$('#lnkAddMore').click(function () {
var fileElements = $('#addFiles input.fileElement');
var index = (fileElements.length + 1);
$('#addFiles').append('<label><input class="fileElement" type="file" name=file' + index + ' />VNIR Spectrum - ' + index + '</label>');
});
</script>
<div class='param_group'>
<p class="phead">Known variables</p>
<div class="inp">
<label class="inplbl">
Incident angle (θ<sub>i</sub>), in degrees.
</label>
<input name='thetai' type='number' step='any' min='-90' max=90 value='-30' />
</div>
<div class="inp">
<label class="inplbl">
Emission angle (θ<sub>e</sub>), in degrees.
</label>
<input name='thetae' type='number' step='any' min='-90' max=90 value=0 />
</div>
<div class="inp">
<label class="inplbl">
Average n, usually at the sodium D line.
</label>
<input name='n1' type='number' step='any' value='1.5725' />
</div>
<div class="inp">
<label class="inplbl">
Opposition surge (B<sub>g</sub>), can be zero
if |θ<sub>i</sub> - θ<sub>e</sub>| > 15.
</label>
<input type="checkbox" id="chkBg" name="Bg" value="Bg">
</div>
</div>
<div class='param_group'>
<p class="phead">Modeling choices</p>
<div class="inp">
<label class="inplbl">
Phase function
</label>
<select id="ddlphase" name='phase_fn'>
<option value='legendre'>Legendre Polynomial</option>
<option value='dhg'>Double Heyney-Greenstein</option>
<option value='constant'>Constant (1)</option>
</select>
</div>
<div class="inp">
<label class="inplbl">
Scattering model
</label>
<select name='scatter_type'>
<option value='isotropic'>Isotropic</option>
<option selected value='lambertian'>Lambertian</option>
</select>
</div>
<div class="inp">
<label class="inplbl">
Use Hu Approximation:
</label>
<input type="checkbox" id="chkHuApprox" name="HuApprox" value="HuApprox">
</div>
</section>
<input name='section' type='hidden' value='initialize' />
<input type='submit' value='Run' />
</form>
<div class='results'></div>
</details>
<!--
.#####
#.....#
......#
.#####
#
#
#######
-->
<details>
<summary><span class='heading'>Preprocessing</span></summary>
<form method='POST'>
<section>
<div class='param_group'>
<p class="phead"> Bounds </p>
<p>
Usable range of wavelengths (in microns).
Use the plots above to determine good cutoffs.
</p>
<div class="inp">
<label class="inplbl">
Lower bound of good region.
</label>
<input name='low' type='number' step='any' value='0.32' />
</div>
<div class="inp">
<label class="inplbl">
Upper bound of good region.
</label>
<input name='high' type='number' step='any' value='2.550' />
</div>
<div class="inp">
<label class="inplbl">
Lower bound after extrapolating the cropped spectrum.
</label>
<input name='UV' type='number' step='any' value='0.30' />
</div>
</div>
<div class='param_group'>
<p class="phead">Interpolation options</p>
<div class="inp">
<label class="inplbl">
Polynomial order.
</label>
<input name='fit_order' type='number' step=1 value=1 min=0 max=5>
</div>
<div class="inp">
<label class="inplbl">
Initial Points to Fit
</label>
<input name='idx_in' type='number' step=1 value=3 min=0 max=5>
</div>
</div>
</section>
<input name='section' type='hidden' value='preprocess' />
<input type='submit' id='preprocess_submit' value='Run' />
</form>
<div class='results'></div>
</details>
<!--
.#####...
#.....#..
......#..
.#####...
......#..
#.....#..
.#####...
-->
<details>
<summary><span class='heading'>Solve for <i>k</i> (All Input Files)</span></summary>
<form method='POST'>
<label>Load Checkpoint</label><input type='file' class="fileElement" name='lcp' />
<section>
<div class='param_group'>
<div id="guess_group" style="display:flex"></div>
</div>
</section>
<input name='key' type='hidden' value='file1' />
<input name='section' type='hidden' value='solve_for_all_k' />
<input type='submit' value='Run' />
</form>
<div class='results'></div>
</details>
<!--
#
#....#
#....#
#######
.....#
.....#
.....#
-->
<details>
<summary><span class='heading'>Solve for <i>k</i> (global)</span></summary>
<form method='POST'>
<label>Load Checkpoint</label><input type='file' class="fileElement" name='lcp' />
<section>
<div class='param_group'>
<div id="boundnote">
<i> Note: The bounds for Henyey Greenstein Function - 0 <= b <= 1, 0 <= c <= 1. <br /> The bounds for Legendre Function - -1.7 <= b <= 1.7, -1 <= c <= 2</i>
</div>
<div id="bounds_group"></div>
</div>
<div class='param_group'>
<p class="phead">Optimization Parameters</pclass="phead">
<div class="inp">
<label class="inplbl">
Previous section to take the initial guess for k from.
</label>
<select id="ddlGuessKey" name='guess_key'></select>
</div>
<div class="inp">
<label class="inplbl">
Lower/upper bounds for each value in k.
</label>
<input name='lowk' type='number' step='any' value='1e-8' />
<input name='upk' type='number' step='any' value='0.1' />
</div>
</div>
<div class='param_group'>
<div>
<p class="phead"> Minimization Parameters </p>
<div>
<div class="inp">
<label class="inplbl">
Max Function Evaluations D1:
</label>
<input name='maxfun' type='number' value='1000' />
</div>
<div class="inp">
<label class="inplbl">
Function Tolerance (smaller is closer match):
</label>
<input name='funtol' type='number' step="any" value='0.0000000001' />
</div>
<div class="inp">
<label class="inplbl">
X Tolerance:
</label>
<input name='xtol' type='number' value='0.000000001' step="any" />
</div>
<div class="inp">
<label class="inplbl">
Start Points:
</label>
<input name='spts' type='number' step='1' value='5' />
</div>
<div class="inp">
<label class="inplbl">
Diff step:
</label>
<input name='diff_step' type='number' step='any' value='0.000001' />
</div>
</div>
</div>
</div>
</section>
<input name='section' type='hidden' value='optimize_global_k' />
<input type='submit' value='Run' />
</form>
<div class='results'></div>
</details>
<!--
#######
#
#
.#####
......#
#.....#
.#####
-->
<details>
<summary><span class='heading'>Add in MIR data</span></summary>
<form method='POST' enctype='multipart/form-data'>
<label>Load Checkpoint</label><input type='file' class="fileElement" name='lcp' />
<section>
<div class='param_group'>
<p>
Matlab MAT-files containing a single matrix each.
Wavelength units should be either nm or microns (not wavenumbers).
</p>
<div class="inp">
<label class="inplbl"><input type='file' name='mirv_file' />MIR wavelength (v)</label>
<label class="inplbl"><input type='file' name='mirk_file' />MIR dispersion (k)</label>
<label class="inplbl"><input type='file' name='repk_file' />Repeat (k) [Minimized from the last section]</label>
</div>
<div class="inp">
<label class="inplbl">
Adjustment Type:
</label>
<select name='adjType'>
<option value='0'>None (Bridge gap with Line)</option>
<option value='1'>Asymmetric (Scales VNIR side of MIR k)</option>
<option value='2'>Symmetric (moves MIR k down by subtraction alone)</option>
<option value='3'>Cheng's Min/Max Adjustment</option>
<option value='4' selected> No MIR data </option>
</select>
</div>
<br />
<i>If you don't have MIR data, in Adjustment Type - use option <b> No MIR data</b> </i>
</div>
</section>
<input name='section' type='hidden' value='add_mir_data' />
<input type='submit' value='Run' />
</form>
<div class='results'></div>
</details>
<!--
.#####
#.....#
#
######
#.....#
#.....#
.#####
-->
<details>
<summary><span class='heading'>Compute index of refraction (Kramers-Kronig)</span></summary>
<form method='POST'>
<label>Load Checkpoint</label><input type='file' class="fileElement" name='lcp' />
<section>
<div class='param_group inp'>
<p class="phead">Known variables</p>
<label class="inplbl">
Anchor wavelength, at which the average n (above) was determined.
</label>
<input name='anchor' type='number' step='any' value='0.58929' />
</div>
</section>
<input name='section' type='hidden' value='run_sskk' />
<input type='submit' value='Run' />
</form>
<div class='results'></div>
</details>
<!--
#######
#....#
....#
...#
..#
..#
..#
-->
<details>
<summary><span class='heading'>Optimize phase function parameters</span></summary>
<form method='POST' enctype='multipart/form-data'>
<label>Load Checkpoint</label><input type='file' class="fileElement" name='lcp' />
<section>
<div class='param_group'>
<p class="phead">Phase Files</p>
<div class="inp">
<label class="inplbl">
Phase Angle Count:
</label>
<input name='phaseAngleCount' id="phaseAngleCount" type='number' step='1' value='1' min='1' />
<span id="AddPhaseCount" /> Add Phase Angles </span>
</div>
<div id='addFilesPhase'></div>
</div>
<div class='param_group'>
<div>
<p class="phead">Parameters Affecting k</p>
<div class="inp">
<label class="inplbl">
Min Scale:
</label>
<input name='minScale' type='number' step='any' value='0.01' min='0.01' max='9' />
</div>
<div class="inp">
<label class="inplbl">
Max Scale:
</label>
<input name='maxScale' type='number' step='any' value='10' min='0.011' max='10' />
</div>
<div class="inp">
<label class="inplbl">
Min Offset:
</label>
<input name='minOffset' type='number' step='any' value='-0.000000008' min="-0.00000008" max="0.0009" />
</div>
<div class="inp">
<label class="inplbl">
Max Offset:
</label>
<input name='maxOffset' type='number' step='any' value='0.001' min='-0.000000007' max="0.001" />
</div>
</div>
<div>
<p class="phead"> Minimization Parameters</p>
<div>
<div class="inp">
<label class="inplbl">
Max Function Evaluations D1:
</label>
<input name='maxfun' type='number' value='1000' />
</div>
<div class="inp">
<label class="inplbl">
Function Tolerance (smaller is closer match):
</label>
<input name='funtol' type='number' step="any" value='0.00000000000001' />
</div>
<div class="inp">
<label class="inplbl">
X Tolerance:
</label>
<input name='xtol' type='number' value='0.000000001' step="any" />
</div>
<div class="inp">
<label class="inplbl">
Start Points:
</label>
<input name='spts' type='number' step='1' value='5' />
</div>
<div class="inp">
<label class="inplbl">
Fit Order:
</label>
<input name='fit_order' type='number' step='1' value='1' />
</div>
<div>
<label class="inplbl">
Diff step:
</label>
<input name='diff_step' type='number' step='any' value='0.000001' />
</div>
</div>
</div>
</div>
</section>
<input name='section' type='hidden' value='phase_solver' />
<input type='submit' value='Run' />
</form>
<div class='results'></div>
</details>
<details>
<summary><span class='heading'>Repeat <i>k</i></span></summary>
<form method='POST'>
<label>Load Checkpoint</label><input type='file' class="fileElement" name='lcp' />
<section>
<div class='param_group'>
<div id="boundnote">
<i> Note: The bounds for Henyey Greenstein Function - 0 <= b <= 1, 0 <= c <= 1. <br /> The bounds for Legendre Function - -1.7 <= b <= 1.7, -1 <= c <= 2</i>
</div>
<div id="rep_bounds_group"></div>
</div>
<div class='param_group'>
<div>
<p class="phead">Optimization Parameters</p>
<div class="inp">
<label class="inplbl">
Lower/upper bounds for each value in k.
</label>
<input name='lowk' type='number' step='any' value='1e-8' />
<input name='upk' type='number' step='any' value='0.1' />
</div>
<p class="phead"> Minimization Parameters</p>
<div>
<div class="inp">
<label class="inplbl">
Max Function Evaluations D1:
</label>
<input name='maxfun' type='number' value='1000' />
</div>
<div class="inp">
<label class="inplbl">
Function Tolerance (smaller is closer match):
</label>
<input name='funtol' type='number' step="any" value='0.0000000001' />
</div>
<div class="inp">
<label class="inplbl">
X Tolerance:
</label>
<input name='xtol' type='number' value='0.000000001' step="any" />
</div>
<div class="inp">
<label class="inplbl">
Start Points:
</label>
<input name='spts' type='number' step='1' value='5' />
</div>
<div class="inp">
<label class="inplbl">
Diff step:
</label>
<input name='diff_step' type='number' step='any' value='0.000001' />
</div>
</div>
</div>
</div>
</section>
<input name='section' type='hidden' value='repeat_k' />
<input type='submit' value='Run' />
</form>
<div class='results'></div>
</details>
<script>
var $options;
$('#preprocess_submit').click(function () {
var phase = $("#ddlphase").val();
var phasefn = phase == "dhg" ? "Double Heyney-Greenstein" : phase == "legendre" ? "Legendre" : "Constant";
$('#ddlGuessKey, #bounds_group, #guess_group, #addFilesPhase, #rep_bounds_group').empty();
var bgcheck = $('#chkBg').prop("checked");
$(".fileElement").each(function (index) {
grain_lb = 0;
grain_ub = 0;
var elementName = $(this).attr('name'); // Holds the fileId for the files added adhoc
var fileAdded = $(this).val().split('\\').pop();
switch (elementName) {
case 'file1':
grain_lb = 21;
grain_ub = 106;
break;
case 'file2':
grain_lb = 35;
grain_ub = 150;
break;
case 'file3':
grain_lb = 50;
grain_ub = 180;
break;
}
//Checks if the variable fileAdded is not an empty string
if (fileAdded) {
$("#ddlGuessKey").append('<option value="' + elementName + '">' + elementName + '</option>');
var local_bgmin = '';
var global_bgmin = '';
var phase_bgmin = '';
var bcmin = '';
var rep_bcmin = '';
if (bgcheck) {
global_bgmin = '<div>' +
'<p>B0:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label> <input name="lowb0' + elementName + '"" type="number" step="any" value="0" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label> <input name="upb0' + elementName + '"" type="number" step="any" value="2" /></div>' +
'</div>' +
'<div>' +
'<p>h:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label> <input name="lowh' + elementName + '"" type="number" step="any" value="0.00001" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label> <input name="uph' + elementName + '"" type="number" step="any" value="0.9" /></div>' +
'</div>';
local_bgmin = ' <div class="inp"><label class="inplbl"> B0:</label > <input name = "b0_' + elementName + '" type = "number" step = "any" value = "0" /></div>' +
'<div class="inp"><label class="inplbl"> h: </label > <input name = "h_' + elementName + '" type = "number" step = "any" value = "0.2" /></div>';
phase_bgmin = '<div class="pggdiv">' +
'<p class="pgg_p">B0:</p>' +
'<label>Lower Bounds:</label><input name="plb_b0_' + index + '"" type="number" step="any" value="0" />' +
'<label>Upper Bounds:<input name="pub_b0_' + index + '"" type="number" step="any" value="2" />' +
'<label>Guess:</label><input name = "p_b0_' + index + '" type = "number" step = "any" value = "1" />' +
'</div>' +
'<div class="pggdiv">' +
'<p class="pgg_p">h:</p>' +
'<label>Lower Bounds:</label><input name="plb_h_' + index + '"" type="number" step="any" value="0.00001" />' +
'<label>Upper Bounds:</label><input name="pub_h_' + index + '"" type="number" step="any" value="0.9" />' +
'<label>Guess:</label><input name = "p_h_' + index + '" type = "number" step = "any" value = "0.02" />' +
'</div>';
}
$('#guess_group').append('<div class="guess_grain_group" ><h3 class="param_grain_head" >' + elementName + ":" + fileAdded +'</h3>' +
'<div class="inp"><label class="inplbl"> Coeff. b:</label > <input name = "b_' + elementName + '" type = "number" step = "any" value = "0.1" /></div>' +
'<div class="inp"><label class="inplbl"> Coeff. c: </label > <input name = "c_' + elementName + '" type = "number" step = "any" value = "0.3" /></div>' +
'<div class="inp"><label class="inplbl"> Filling Factor: </label > <input name = "ff_' + elementName + '" type = "number" step = "any" value = "0.0000000000000001" /></div>' +
'<div class="inp"><label class="inplbl"> Internal Scattering (s):</label > <input name = "s_' + elementName + '" type = "number" step = "any" value = "0" /></div>' +
'<div class="inp"><label class="inplbl"> Grain Size (D): </label ><input name = "D_' + elementName + '" type = "number" step = "any" value = "63" /></div>' +
local_bgmin +
'</div>');
if (phasefn != "Constant") {
$('#boundnote').show();
bcmin = '<p>Coeff b of ' + phasefn + ' poly:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label> <input name="lowb' + elementName + '"" type="number" step="any" value="-1.7" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label> <input name="upb' + elementName + '"" type="number" step="any" value="1.7" /></div>' +
'</div>' +
'<div>' +
'<p>Coeff c of ' + phasefn + ' poly:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label><input name="lowc' + elementName + '"" type="number" step="any" value="-1.0" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label><input name="upc' + elementName + '"" type="number" step="any" value="1.0" /></div>' +
'</div>';
rep_bcmin = '<p>Scale b of ' + phasefn + ' poly:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label> <input name="scalelowb' + elementName + '"" type="number" step="any" value="0" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label> <input name="scaleupb' + elementName + '"" type="number" step="any" value="2" /></div>' +
'</div>' +
'<div>' +
'<p>Offset b of ' + phasefn + ' poly:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label><input name="offlowb' + elementName + '"" type="number" step="any" value="-1" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label><input name="offupb' + elementName + '"" type="number" step="any" value="1" /></div>' +
'</div>' +
'<div>' +
'<p>Scale c of ' + phasefn + ' poly:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label> <input name="scalelowc' + elementName + '"" type="number" step="any" value="0" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label> <input name="scaleupc' + elementName + '"" type="number" step="any" value="2" /></div>' +
'</div>' +
'<div>' +
'<p>Offset c of ' + phasefn + ' poly:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label><input name="offlowc' + elementName + '"" type="number" step="any" value="-1" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label><input name="offupc' + elementName + '"" type="number" step="any" value="1" /></div>' +
'</div>'
}
else {
$('#boundnote').hide();
}
var bgstr_p1 = '<div class="grain_group"><h3 class="param_grain_head">' + elementName + ":" + fileAdded + '</h3>' +
'<div class="ggg">' +
'<div>';
var bgstr_p2 ='<div>' +
'<p>Internal Scattering:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label> <input name="lows' + elementName + '"" type="number" step="any" value="0" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label><input name="ups' + elementName + '"" type="number" step="any" value="0.06" /></div>' +
'</div>' +
'<div>' +
'<p>Grain Size:</p>' +
'<div class="inp"><label class="inplbl">Lower Bounds:</label><input name="lowD' + elementName + '"" type="number" step="any" value="' + grain_lb + '" /></div>' +
'<div class="inp"><label class="inplbl">Upper Bounds:</label><input name="upD' + elementName + '"" type="number" step="any" value="' + grain_ub + '" /></div>' +
'</div>' + global_bgmin + '</div></div>';
;
//Bounds Group is a parent of repeat - rep_bounds_group
$("#bounds_group").append(bgstr_p1 + bcmin + bgstr_p2);
$("#rep_bounds_group").append(bgstr_p1 + rep_bcmin + bgstr_p2);
$('#addFilesPhase').append('<div class="pfilesecs" id="pfilesec_' + index + '">' + '<h3 class="param_pfile_head" >' + elementName + ":" + fileAdded +'</h3>' +
'<span class="p_grain_group" style="display:flex">' +
'<div class="pggdiv">' +
'<p class="pgg_p">Coeff. b:</p>' +
'<label>Lower Bounds:</label><input name="plb_b_' + index + '"" type="number" step="any" value="-1.7" />' +
'<label>Upper Bounds:</label><input name="pub_b_' + index + '"" type="number" step="any" value="1.7" />' +
'<label>Guess:</label ><input name = "p_b_' + index + '" type = "number" step = "any" value = "0.1" />' +
'</div>' +
'<div class="pggdiv">' +
'<p class="pgg_p">Coeff c:</p>' +
'<label>Lower Bounds:</label><input name="plb_c_' + index + '"" type="number" step="any" value="-1.0" />' +
'<label>Upper Bounds:</label><input name="pub_c_' + index + '"" type="number" step="any" value="1.0" />' +
'<label>Guess:</label ><input name = "p_c_' + index + '" type = "number" step = "any" value = "0.3" />' +
'</div>' +
'<div class="pggdiv">' +
'<p class="pgg_p">Scat. s:</p>' +
'<label>Lower Bounds:</label><input name="plb_s_' + index + '"" type="number" step="any" value="0" />' +
'<label>Upper Bounds:<input name="pub_s_' + index + '"" type="number" step="any" value="0.06" />' +
'<label>Guess:</label><input name = "p_s_' + index + '" type = "number" step = "any" value = "0" />' +
'</div>' +
'<div class="pggdiv">' +
'<p class="pgg_p">Grain Size (D):</p>' +
'<label>Lower Bounds:</label><input name="plb_d_' + index + '"" type="number" step="any" value="' + grain_lb + '" />' +
'<label>Upper Bounds:</label><input name="pub_d_' + index + '"" type="number" step="any" value="' + grain_ub + '" />' +
'<label>Guess:</label><input name = "p_d_' + index + '" type = "number" step = "any" value = "63" />' +
'</div>' +
phase_bgmin +
'</span>');
}
});
$('#AddPhaseCount').click(function () {
$('.phaseangle').remove();
var count = $('#phaseAngleCount').val()
for (var i = 0; i < count; i++) {
$(".fileElement").each(function (index) {
var elementName = $(this).attr('name'); // Holds the fileId for the files added adhoc
var fileAdded = $(this).val().split('\\').pop();
if (fileAdded) {
var selector = 'pfilesec_' + index;
var fileElements = $('#' + selector + ' input.pfileElement');
var id = (fileElements.length);
$('#' + selector).append('<div class="phaseangle">' +
'<label><input type="file" class="pfileElement" name="filepfile_' + index + '_' + id + '"/></label>' +
'<label>Phase Angle (I): <input name="pfile_i_' + index + '_' + id + '" type="number" step="10" value="10" /></label>' +
'<label>Phase Angle (E): <input name="pfile_e_' + index + '_' + id + '" type="number" step="10" value="10" /></label>' +
'</div >');
}
});
}
});
}); //Preprocess submit end
//Adding javascript for Section Phase Angle
</script>
</body>
</html>