-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathfastTimingWalkCurves.html
More file actions
298 lines (257 loc) · 12.9 KB
/
fastTimingWalkCurves.html
File metadata and controls
298 lines (257 loc) · 12.9 KB
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
<html>
<head>
<title>GRIFFIN Fast-Timing Walk Curves</title>
<script src='scripts/HTMLImports.min.js' type="text/javascript"></script>
<script src='scripts/mustache.js' type="text/javascript"></script>
<script src='scripts/easeljs-0.7.0.min.js' type="text/javascript"></script>
<script src='scripts/dygraphs.1.1.1.min.js' type="text/javascript"></script>
<script src='scripts/regression.min.js' type="text/javascript"></script>
<script src='scripts/gammaSpectrum.js' type="text/javascript"></script>
<script src='scripts/fitit.js' type="text/javascript"></script>
<script src="scripts/jquery1-11-3.min.js"></script>
<script src="scripts/bootstrap3-3-5.min.js"></script>
<script src='scripts/helpers.js' type="text/javascript"></script>
<script src='scripts/fastTimingWalkCurves.js' type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap3-3-5.min.css">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<!--HTML imports-->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link id='header' rel="import" href="templates/header/header.html">
<link id='paginationMenu' rel="import" href="templates/paginationMenu/paginationMenu.html">
<link id='fastTimingWalkCurvesReport' rel="import" href="templates/fastTimingWalkCurvesReport/fastTimingWalkCurvesReport.html">
<link id='fastTimingWalkCurvesReportTable' rel="import" href="templates/fastTimingWalkCurvesReport/fastTimingWalkCurvesReportTable.html">
<link id='fastTimingWalkCurvesFitsReportTable' rel="import" href="templates/fastTimingWalkCurvesReport/fastTimingWalkCurvesReportTable.html">
<link id='plotGrid' rel="import" href="templates/plotGrid/plotGrid.html">
<link id='plotControl' rel="import" href="templates/plotControl/plotControl.html">
<link id='plotListLite' rel="import" href="templates/plotList/plotListLite.html">
<link id='dataplot' rel="import" href="templates/dataplot/dataplot.html">
<link id='footer' rel="import" href="templates/footer/footer.html">
</head>
<body>
<div id='head'></div>
<div id='messageDiv' class='col-md-12'>
<div id='messageDivText'></div><div id='messageDivButton'></div>
</div>
<div id='progressDiv' class="container progress hidden">
<div id='fastTimingWalkCurvesProgress' class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">Initializing App...
</div>
</div>
<!--helpful hints-->
<div class='col-md-6'>
<div id='welcomeMessage' class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="false"></span>
This app will generate the Compton-Walk curves from LaBr3-gated TAC spectra.
</div>
<div id='fetchingMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Spectra are downloading from the server...
</div>
<div id='projectionsMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Projecting the 2d matrices...
</div>
<div id='fittingSinglesMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Fitting the peaks in the 1d spectra...
</div>
<div id='fittingProjectionsMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Fitting the peaks in the projected spectra from the 2d spectra...
</div>
<div id='reviewMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Analysis complete. Review the results in the table below. Results can be downloaded as CSV or text files.
</div>
</div>
<div id='error-messages-for-drop-area' class='col-md-6 error-text'></div>
<div id="peakFitterDivContainer" class='col-md-12 hidden'>
<div id='inputsHistosContainerDiv' class='col-md-12'>
<div class='col-md-12'>
<label for="inputHistogramFiles" class='col-md-4'>List of Histogram files (.tar):</label>
<div id='histo-list-menu-div' class='col-md-4'>
<label for="HistoListSelect">Select files to add them:</label>
</div>
<div class='col-md-6'>
<textarea id="inputHistogramFiles" name="inputHistogramFiles" rows="4" cols="50"></textarea>
</div>
</div>
</div>
<div id='inputs1dContainerDiv' class='col-md-12'>
<div class='col-md-4'>
<label for="input1dSpectrumNames" class='col-md-12'>List of 1d spectra:</label>
<textarea id="input1dSpectrumNames" name="input1dSpectrumNames" rows="4" cols="50"></textarea>
</div>
<div class='col-md-4'>
<label for="input1dPeaks" class='col-md-12'>List of peaks to fit in all 1d spectra:</label>
<textarea id="input1dPeaks" name="input1dPeaks" rows="4" cols="50"></textarea>
</div>
</div>
<div id='inputs2dContainerDiv' class='col-md-12'>
<div class='col-md-4'>
<label for="input2dSpectrumNames" class='col-md-12'>List of 2d spectra:</label>
<textarea id="input2dSpectrumNames" name="input2dSpectrumNames" rows="4" cols="50"></textarea>
</div>
<div class='col-md-4'>
<label for="input2dGates" class='col-md-12'>List of gates to make projections for all 2d spectra:</label>
<textarea id="input2dGates" name="input2dGates" rows="4" cols="50"></textarea>
</div>
<div class='col-md-4'>
<label for="input2dPeaks" class='col-md-12'>List of peaks to fit in all projections:</label>
<textarea id="input2dPeaks" name="input2dPeaks" rows="4" cols="50"></textarea>
</div>
</div>
</div>
<div id='buttonsContainerDiv' class='col-md-12'>
<div id='launchSubmitDiv' class='col-md-6 hidden'></div>
<div id='saveCalDiv' class='col-md-3 hidden'>
<button type="button" class="btn btn-primary btn-lg" id='saveCal'>
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Save Cal file
</button>
<input id='saveCalname' type='text' value='GRIFFIN-Fast-Timing-Cal-File.cal' width='500px'></input>
</div>
<div id='saveCSVDiv' class='col-md-3 hidden'>
<button type="button" class="btn btn-primary btn-lg" id='saveCSV'>
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>Download results as CSV
</button>
</div>
<div id='saveScriptDiv' class='col-md-3 hidden'>
<button type="button" class="btn btn-primary btn-lg" id='saveScript'>
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>Download input script
</button>
</div>
</div>
</div>
<!-- Histogram Choice Div -->
<div id='histoChoiceBar' class='col-md-12'>
<div id='histoChoiceDir' class='col-md-8'></div>
<div class='col-md-12'>
<div id='histoChoiceTimeCalibrator' class='col-md-4'></div>
<div id='histoChoice60Co' class='col-md-4'></div>
</div>
<div id='histoChoiceSubmitDiv' class='col-md-4'></div>
</div>
<!-- Pagination menu Div -->
<div id='menu' class='col-md-12'></div>
<!-- Spectrum Plotting -->
<div id='plotRegion' class='sectionWrapper'>
<div id='plotWrap' class='col-md-9 plotRegion item'>
<div id='plottingGrid'></div>
<div class='col-md-8' id='plotCtrl'></div>
<div class='sectionWrapper refitButtons'>
<div class='col-md-12'>
<select id="refitSelect"></select>
<button type="button" class="btn btn-default btn-lg" id='refitButton' engaged='0'>
<span id='refitButtonBadge' class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
<span id='refitButtonText'>Refit this Peak</span>
</button>
</div>
</div>
</div>
<div class='col-md-2 item'>
<div id='plotList' style='overflow-y:scroll; height:400px;'></div>
</div>
</div>
<!-- Peak-Fitting results table -->
<div id='resultsTableRegion' class='col-md-12 hidden'>
<div id='fastTimingWalkCurvesFits' class='col-md-12'></div>
</div>
<!--Table of calculations and results-->
<div id='detectorReportRegion' class='col-md-12'>
<div id='tableMenuDiv' class='col-md-12'></div>
<div id='fastTimingWalkCurves' class='col-md-4'></div>
<div id='detectorReportPlot' class='col-md-8'></div>
</div>
<!-- Plot of all curves together -->
<div id='resultsPlotRegion' class='col-md-12'>
<div id='fastTimingWalkCurvesPlot' class='col-md-12'></div>
</div>
<!--Table of calculations and results - per crystal corrections -->
<div id='crystalKReportRegion' class='col-md-12 hidden'>
<div id='crystalKReportRegiontableMenuDiv' class='col-md-12'></div>
<div id='crystalKReportRegionreportCardDiv' class='col-md-6'></div>
<div id='crystalKReportRegionpileupCorrectionsDetector' class='col-md-7'></div>
<div id='crystalKReportRegiondetectorReportPlot' class='col-md-5'></div>
</div>
<div id='crystal1stHitReportRegion' class='col-md-12 hidden'>
<div id='crystal1stHitReportRegiontableMenuDiv' class='col-md-12'></div>
<div id='crystal1stHitReportRegionreportCardDiv' class='col-md-6'></div>
<div id='crystal1stHitReportRegionpileupCorrectionsDetector' class='col-md-7'></div>
<div id='crystal1stHitReportRegiondetectorReportPlot' class='col-md-5'></div>
</div>
<div id='foot'></div>
<script>
window.addEventListener('HTMLImportsLoaded', function(e) {
dataStore._plotGrid = new plotGrid('plottingGrid');
dataStore._plotControl = new plotControl('plotCtrl', 'horizontal');
dataStore.templates = prepareTemplates(['header', 'paginationMenu', 'fastTimingWalkCurvesReport', 'fastTimingWalkCurvesReportTable', 'fastTimingWalkCurvesFitsReportTable', 'plotGrid', 'plotControl', 'plotListLite', 'dataplot', 'footer']);
setupHeader('head', 'Fast-Timing Walk Curves');
setupPaginationMenu('menu');
dataStore._plotGrid.setup();
dataStore._plotControl.setup();
//set up spectrum cell
dataStore._plotGrid.manageCellCreation(null, dataStore.plots[0]);
setupFooter('foot');
//don't want additional plots in this app
deleteNode('plottingGridnewPlotButton');
// Inject the dismiss button to the server messageDiv
newButton = document.createElement('button');
newButton.setAttribute('id', 'messageDivDismissButton');
newButton.setAttribute('class', 'btn btn-default btn-lg');
newButton.innerHTML = "Dismiss";
newButton.onclick = function(){
ClearErrorConnectingToAnalyzerServer();
}.bind(newButton);
document.getElementById('messageDivButton').appendChild(newButton);
// Create the text input for the Histogram file directory and file inputs
var newLabel = document.createElement("label");
newLabel.for = 'HistoDirectoryInput';
newLabel.innerHTML = 'Directory of Histogram files: ';
document.getElementById('histoChoiceDir').appendChild(newLabel);
newInput = document.createElement('input');
newInput.id = 'HistoDirectoryInput';
newInput.type = 'text';
newInput.style.width = '400px';
newInput.value = dataStore.histoFileDirectoryPath;
newInput.onchange = function(){
dataStore.histoFileDirectoryPath = this.value;
getHistoFileListFromServer();
}.bind(newInput);
document.getElementById('histoChoiceDir').appendChild(newInput);
// Grab the histogram list for the default directory
getHistoFileListFromServer();
getMidasFileListFromServer(); // The request for details follows this. Needed for adding run titles to selects
// Set up event listener for adding run titles to selects
listener('histoChoiceDir', 'midasFileDetailsAvailable', addTitlesToHistoListSelect);
// Set up the refit button
document.getElementById('refitButton').onclick = function(){ toggleRefitMode(); }
document.getElementById('refitButton').disabled = true; // Disabled until there are peaks to refit
// Set up the CSV file button
document.getElementById('saveCSV').onclick = function(){ buildCSVfile(); }
// Set up the Script download file button
document.getElementById('saveScript').onclick = function(){ buildScriptfile(); }
//make sure the file name for Cal file download gets passed around:
document.getElementById('saveCalname').onchange = function(){
//set the filename to whatever the user has requested:
document.getElementById('saveCal').download = this.value;
}
// Set up the Cal file button
document.getElementById('saveCal').onclick = function(){ buildCalfile(); }
// Create the Launch Submit button to begin the process
newButton = document.createElement('button');
newButton.setAttribute('id', 'launchSubmitButton');
newButton.setAttribute('class', 'btn btn-default btn-lg');
newButton.innerHTML = "Produce Compton-Walk Curves";
newButton.style.padding = '4px';
newButton.onclick = function(){
setupfastTimingWalkCurves();
}.bind(newButton);
document.getElementById('histoChoiceSubmitDiv').appendChild(newButton);
// Reveal the progress bar
document.getElementById('progressDiv').classList.remove('hidden');
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
});
</script>
</body>
</html>