source: trunk/FACT++/www/viewer/index.html@ 17822

Last change on this file since 17822 was 17822, checked in by tbretz, 11 years ago
Added isMC, isDRS and isCalibrated
File size: 29.5 KB
Line 
1<!DOCTYLE HTML>
2<html>
3<head>
4 <link rel="stylesheet" href="jquery-ui-1.10.4.custom/css/smoothness/jquery-ui-1.10.4.custom.min.css"/>
5 <script src="jquery-2.1.0.min.js"></script>
6 <script src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js"></script>
7
8 <link rel="stylesheet" href="codemirror-4.1/lib/codemirror.css"/>
9 <!--<link rel="stylesheet" href="codemirror-4.1/theme/myblackboard.css"/>-->
10 <!--<link rel="stylesheet" href="codemirror-4.1/theme/blackboard.css">-->
11 <!--<link rel="stylesheet" href="codemirror-4.1/theme/3024-night.css">-->
12 <link rel="stylesheet" href="codemirror-4.1/addon/display/fullscreen.css"/>
13 <link rel="stylesheet" href="codemirror-4.1/addon/dialog/dialog.css"/>
14 <link rel="stylesheet" href="codemirror-4.1/addon/fold/foldgutter.css"/>
15 <link rel="stylesheet" href="codemirror-4.1/addon/lint/lint.css"/>
16 <script src="codemirror-4.1.min.js"></script>
17 <!--
18 <script src="codemirror-4.1/lib/codemirror.js"></script>
19 <script src="codemirror-4.1/mode/javascript/javascript.js"></script>
20 <script src="codemirror-4.1/addon/selection/active-line.js"></script>
21 <script src="codemirror-4.1/addon/fold/brace-fold.js"></script>
22 <script src="codemirror-4.1/addon/runmode/colorize.js"></script>
23 <script src="codemirror-4.1/addon/fold/comment-fold.js"></script>
24 <script src="codemirror-4.1/addon/dialog/dialog.js"></script>
25 <script src="codemirror-4.1/addon/fold/foldcode.js"></script>
26 <script src="codemirror-4.1/addon/fold/foldgutter.js"></script>
27 <script src="codemirror-4.1/addon/display/fullscreen.js"></script>
28 <script src="codemirror-4.1/addon/hint/javascript-hint.js"></script>
29 <script src="codemirror-4.1/addon/lint/lint.js"></script>
30 <script src="codemirror-4.1/addon/lint/javascript-lint.js"></script>
31 <script src="codemirror-4.1/addon/search/match-highlighter.js"></script>
32 <script src="codemirror-4.1/addon/edit/matchbrackets.js"></script>
33 <script src="codemirror-4.1/addon/runmode/runmode.js"></script>
34 <script src="codemirror-4.1/addon/search/search.js"></script>
35 <script src="codemirror-4.1/addon/search/searchcursor.js"></script>
36 <script src="codemirror-4.1/addon/hint/show-hint.js"></script>
37 -->
38 <script src="flot-0.8.3/jquery.flot.min.js"></script>
39 <script src="flot-0.8.3/jquery.flot.selection.min.js"></script>
40 <script src="flot-0.8.3/jquery.flot.symbol.min.js"></script>
41 <script src="flot-0.8.3/jquery.flot.resize.js"></script>
42 <script src="jshint.js"></script>
43 <script src="index.js"></script>
44
45 <link rel="stylesheet" href="index.css"/>
46</head>
47
48<body>
49
50<div id='tooltip' style="z-index:1000;position:absolute;display:none;border:1px solid #fdd;padding;2px;background-color:#fee;opacity:0.8"></div>
51
52<div class="myaccordion" id="accordion5">
53 <h3><a href="#">Editor 1 (proc)</a></h3>
54 <div id="editorcontainer1fake" style="position:absolute;border:0;opacity:0"></div>
55</div>
56<div id="editorcontainer1" style="z-index:600;">
57 <form action="index.php" method="post" style="margin-bottom:0px">
58 <div id="textcontainer1">
59 <textarea id="editor1" name="editor1" type="textarea">
60return $.data[pixel];
61 </textarea>
62 </div>
63 <div class="ui-widget-content" style="background:#333;color:#eef;border-top-width:0;padding-top:2px;">
64 <input type="submit" value="Save"></input>
65 <input type="file" name="files[]" id="selectfile1"></input><output id="file1"></output>
66 </div>
67 </form>
68</div>
69
70<div class="myaccordion" id="accordion1">
71 <h3><a href="#">Editor 2 (main)</a></h3>
72 <div id="editorcontainer2fake" style="position:absolute;border:0;opacity:0"></div>
73</div>
74<div id="editorcontainer2">
75 <form action="index.php" method="post" style="margin-bottom:0px">
76 <div id="textcontainer2">
77 <textarea id="editor2" name="editor2" type="textarea">
78print("This output will go to the virtual Console.\n");
79
80// The four first values of pixel 1
81var arr = [ $.data[1][0], $.data[1][1], $.data[1][2], $.data[1][3] ];
82print("Pixel 1: [ "+arr+" ]\n");
83
84// Get the maximum sample from each pixel
85var rc = [new Array(1440),new Array(1440)];
86for (var p=0; p<$.event.numPix; p++)
87{
88 var max = 0;
89 var idx = -1;
90 for (var s=5; s<$.event.numRoi-60; s++)
91 {
92 // spike suppression
93 var h = ($.data[p][s]-$.data[p][s-1]) + ($.data[p][s]-$.data[p][s+1]);
94
95 if ($.data[p][s]>max && h<20)
96 {
97 max = $.data[p][s];
98 idx = s;
99 }
100 }
101 rc[0][p]=idx<0 ? null : max;
102 rc[1][p]=idx<0 ? null : idx;
103}
104
105return rc;
106 </textarea>
107 </div>
108 <div class="ui-widget-content" style="background:#333;color:white;border-top-width:0;padding-top:2px;">
109 <input type="submit" value="Save"></input>
110 <input type="file" name="files[]" id="selectfile2"></input><output id="file2"></output>
111 </div>
112 </form>
113</div>
114
115<div class="myaccordion" id="accordion" style="margin-bottom:1ex">
116 <h3><a style="color:red" href="#">Runtime error</a></h3>
117 <div>
118 <pre id="error" style="color:red"></pre>
119 </div>
120 <h3><a href="#">Console</a></h3>
121 <div>
122 <pre style="color:green" id="console"></pre>
123 </div>
124 <h3><a href="#">Run info</a></h3>
125 <div>
126 <pre id="runinfo"></pre>
127 </div>
128 <h3><a href="#">Debug</a></h3>
129 <div id="debug">
130 </div>
131</div>
132
133<div class="ui-widget-content" style="background:#eee;margin-top:-10px">
134 <input id="submit" type="button" onclick="onSubmit();" value="Submit"></input>
135 <span style="float:right;white-space:nowrap;">
136 MC
137 <input id="montecarlo" style="margin-left:0px;margin-right:5px;" type="checkbox" onclick="onSubmit();" disabled="true"></input>
138 DRS
139 <input id="drsfile" style="margin-left:0px;margin-right:5px;" type="checkbox" onclick="onSubmit();"></input>
140 Cal
141 <input id="calibrated" style="margin-left:0px;margin-right:5px;" type="checkbox" onclick="onSubmit();"></input>
142 Run
143 <input id="file" style="width:100px"></input>
144 </span>
145 &nbsp;
146 <span style="white-space:nowrap">
147 Evt
148 <input id="event" style="text-align:right;" type="number" onchange="onEvent();" value="0" min="0" max="0" step="1"></input>/<span id="numevents">---</span>
149 </span>
150 &nbsp;
151 <span style="white-space:nowrap">
152 Pix
153 <input id="pixel" style="text-align:right;width:50px;" type="number" onchange="onPixel();" value="0" min="0" max="1439" step="1"></input>
154 </span>
155 &nbsp;
156 <span style="white-space:nowrap">
157 CBPX
158 <input id="cbpx-c" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="1" min="0" max="3" step="1"></input>
159 <input id="cbpx-b" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="0" min="0" max="9" step="1"></input>
160 <input id="cbpx-p" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="3" min="0" max="3" step="1"></input>
161 <input id="cbpx-x" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="6" min="0" max="8" step="1"></input>
162 =
163 <input id="cbpx" style="text-align:right;width:50px;" type="number" onchange="onHW();" value="393" min="0" max="1439" step="1"></input>
164 </span>
165</div>
166
167<div class="myaccordion" id="accordion2">
168 <h3><a href="#">Camera display</a></h3>
169</div>
170<div id="cameracontainer" class="ui-widget-content">
171 <table width="100%">
172 <colgroup>
173 <col style="width:38.5%;">
174 <col style="width:23%;">
175 <col style="width:38.5%;">
176 </colgroup>
177 <tr>
178 <td>
179 <span style="white-space:nowrap;margin-right:2px;">
180 Min
181 <input id="cameramin1" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(1);" value="0" disabled="true"></input>
182 <input id="cameraminon1" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(1);" checked="true"></input>
183 </span>
184 <span style="white-space:nowrap">
185 Max
186 <input id="cameramax1" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(1);" value="0" disabled="true"></input>
187 <input id="cameramaxon1" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(1);" checked="true"></input>
188 </span>
189 </td>
190 <td style="text-align:center" id="eventinfo">
191 </td>
192 <td style="text-align:right">
193 <span style="white-space:nowrap">
194 Min
195 <input id="cameramin2" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(2);" value="0" disabled="true"></input>
196 <input id="cameraminon2" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(2);" checked="true"></input>
197 </span>
198 <span style="white-space:nowrap;margin-left:2px;">
199 Max
200 <input id="cameramax2" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(2);" value="0" disabled="true"></input>
201 <input id="cameramaxon2" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(2);" checked="true"></input>
202 </span>
203 </td>
204 <td>
205 </td>
206 </tr>
207 </table>
208
209 <table id="table" width="100%" border="0" style="border:0;margin:0;padding:0;">
210 <tr style="margin:0;padding:0;">
211 <td style="margin:0;padding:0;">
212 <table border="0" style="margin:0;padding:0;">
213 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera1"></tr>
214 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera3"><canvas id="camera3" width="1" height="1"></canvas></td></tr>
215 </table>
216 </td>
217 <td style="margin:0;padding:0;" id="centercamera"><canvas id="camera1" width="1" height="1"></canvas></td>
218 <td style="margin:0;padding:0;">
219 <table border="0" style="margin:0;padding:0;">
220 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera2"><canvas id="camera2" width="1" height="1"></canvas></td></tr>
221 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera4"><canvas id="camera4" width="1" height="1"></canvas></td></tr>
222 </table>
223 </td>
224 </tr>
225 </table>
226
227 <table width="100%">
228 <colgroup>
229 <col style="width:38.5%;">
230 <col style="width:23%;">
231 <col style="width:38.5%;">
232 </colgroup>
233 <tr>
234 <td>
235 <span style="white-space:nowrap;margin-right:2px;">
236 Min
237 <input id="cameramin3" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(3);" value="0" disabled="true"></input>
238 <input id="cameraminon3" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(3);" checked="true"></input>
239 </span>
240 <span style="white-space:nowrap">
241 Max
242 <input id="cameramax3" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(3);" value="0" disabled="true"></input>
243 <input id="cameramaxon3" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(3);" checked="true"></input>
244 </span>
245 </td>
246 <td style="text-align:center;">
247 <span style="white-space:nowrap;margin-left:1px;margin-right:1px;"><input id="grid" type="checkbox" onclick="refreshCameras();" checked="true">Grid</input></span>
248 <span style="white-space:nowrap;margin-left:1px;margin-right:1px;"><input id="marker" type="checkbox" onclick="refreshCameras();" checked="true">Marker</input></span>
249 <span style="white-space:nowrap;margin-left:1px;margin-right:1px;"><input id="image" type="checkbox" onclick="refreshCameras();">Image</input></span>
250 <!--Pixel value:
251 <input id="value" type="text" readonly="true" value="0" style="text-align:right;width:100px"></input>-->
252 </td>
253 <td style="text-align:right">
254 <span style="white-space:nowrap">
255 Min
256 <input id="cameramin4" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(4);" value="0" disabled="true"></input>
257 <input id="cameraminon4" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(4);" checked="true"></input>
258 </span>
259 <span style="white-space:nowrap;margin-left:2px;">
260 Max
261 <input id="cameramax4" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(4);" value="0" disabled="true"></input>
262 <input id="cameramaxon4" style="margin-left:0px;" type="checkbox" onclick="onCameraMinMaxOn(4);" checked="true"></input>
263 </span>
264 </td>
265 </tr>
266 </table>
267</div>
268
269<div class="myaccordion" id="accordion7">
270 <h3><a href="#">Histograms</a></h3>
271</div>
272<div id="histcontainer" class="ui-widget-content">
273 <table width="100%">
274 <colgroup>
275 <col style="width:40%;">
276 <col style="width:20%;">
277 <col style="width:40%;">
278 </colgroup>
279 <tr>
280 <td>
281 <span style="white-space:nowrap;margin-right:2px;">
282 Min
283 <input id="histmin1" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(1);" value="0" disabled="true"></input>
284 <input id="histminon1" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(1);" checked="true"></input>
285 </span>
286 <span style="white-space:nowrap">
287 Max
288 <input id="histmax1" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(1);" value="0" disabled="true"></input>
289 <input id="histmaxon1" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(1);" checked="true"></input>
290 </span>
291 </td>
292 <td style="text-align:center" id="eventinfo">
293 </td>
294 <td style="text-align:right">
295 <span style="white-space:nowrap">
296 Min
297 <input id="histmin2" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(2);" value="0" disabled="true"></input>
298 <input id="histminon2" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(2);" checked="true"></input>
299 </span>
300 <span style="white-space:nowrap;margin-left:2px;">
301 Max
302 <input id="histmax2" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(2);" value="0" disabled="true"></input>
303 <input id="histmaxon2" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(2);" checked="true"></input>
304 </span>
305 </td>
306 <td>
307 </td>
308 </tr>
309 </table>
310
311 <table id="table" width="100%" border="0" style="border:0;margin:0;padding:0;">
312 <tr style="margin:0;padding:0;">
313 <td style="margin:0;padding:0;">
314 <table border="0" style="margin:0;padding:0;">
315 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="conthist1"></tr>
316 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="conthist3"><div style="width:1px;height:1px;" id="hist3"></div></td></tr>
317 </table>
318 </td>
319 <td style="margin:0;padding:0;" id="centerhist"><div style="width:1px;height:1px;" id="hist1"></div></td>
320 <td style="margin:0;padding:0;">
321 <table border="0" style="margin:0;padding:0;">
322 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="conthist2"><div style="width:1px;height:1px;" id="hist2"></div></td></tr>
323 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="conthist4"><div style="width:1px;height:1px;" id="hist4"></div></td></tr>
324 </table>
325 </td>
326 </tr>
327 </table>
328
329 <table width="100%">
330 <colgroup>
331 <col style="width:50%;">
332 <col style="width:50%;">
333 </colgroup>
334 <tr>
335 <td>
336 <span style="white-space:nowrap;margin-right:2px;">
337 Min
338 <input id="histmin3" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(3);" value="0" disabled="true"></input>
339 <input id="histminon3" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(3);" checked="true"></input>
340 </span>
341 <span style="white-space:nowrap">
342 Max
343 <input id="histmax3" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(3);" value="0" disabled="true"></input>
344 <input id="histmaxon3" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(3);" checked="true"></input>
345 </span>
346 </td>
347 <td style="text-align:right">
348 <span style="white-space:nowrap">
349 Min
350 <input id="histmin4" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(4);" value="0" disabled="true"></input>
351 <input id="histminon4" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(4);" checked="true"></input>
352 </span>
353 <span style="white-space:nowrap;margin-left:2px;">
354 Max
355 <input id="histmax4" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(4);" value="0" disabled="true"></input>
356 <input id="histmaxon4" style="margin-left:0px;" type="checkbox" onclick="onHistMinMaxOn(4);" checked="true"></input>
357 </span>
358 </td>
359 </tr>
360 </table>
361</div>
362
363<div class="myaccordion" id="accordion3">
364 <h3><a href="#">Waveform</a></h3>
365</div>
366<div id="waveformcontainer" class="ui-widget-content">
367 <div id="waveform" style="width:100%;height:300px;"></div>
368 <table style="width:100%">
369 <colgroup>
370 <col style="width:33%;">
371 <col style="width:66%;">
372 </colgroup>
373 <tr>
374 <td style="text-align:left;margin-right:2px;">
375 <span style="white-space:nowrap;float:left">
376 Xmin
377 <input id="waveformxmin" style="width:55px;text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
378 <input id="waveformxminon" style="margin-left:0px;" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
379 </span>
380 <span style="white-space:nowrap;float:left">
381 Xmax
382 <input id="waveformxmax" style="width:55px;text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
383 <input id="waveformxmaxon" style="margin-left:0px;" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
384 </span>
385 </td>
386 <td style="text-align:right">
387 <span style="white-space:nowrap;">
388 Ymin
389 <input id="waveformmin" style="text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
390 <input id="waveformminon" style="margin-left:0px;" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
391 </span>
392 <span style="white-space:nowrap;margin-left:2px;">
393 Ymax
394 <input id="waveformmax" style="text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
395 <input id="waveformmaxon" style="margin-left:0px;" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
396 </span>
397 </td>
398 </tr>
399 </table>
400</div>
401
402<div class="myaccordion" id="accordion6">
403 <h3><a href="#">Additional controls</a></h3>
404</div>
405<div id="ctrlcontainer" class="ui-widget-content">
406 <form id="controls" method="POST" style="margin-bottom:0">
407 <input id="getcamera" type="button" onclick="onGetCameras();" value="Get camera data"></input>
408 <input id="getwaveform" type="button" onclick="onGetWaveforms();" value="Get waveforms"></input>
409 <input id="data" name="data" type="hidden"></input>
410 </form>
411</div>
412
413<div class="myaccordion" id="accordion4">
414 <h3><a href="#">Help</a></h3>
415</div>
416<div id="helpcontainer" class="ui-widget-content" style="padding-left:40px;padding-right:40px;padding-bottom:40px;">
417<H1>HELP</H1>
418
419<H3>How does it work?</H3>
420When you submit a javascript to the server, it will be executed
421on a sandbox on the server. Before the event is loaded from a file
422and made available within the sandbox. Generally, the sandbox
423can easily be enhanced, e.g. with algorithms available in php.
424This can be done on request. After execution, the result returned
425by the script is then displayed in the camera display.
426
427<H3>Why Javascript?</H3>
428Simply for security reasons. To avoid tranferring the event to the client's
429browser, the script must be executed on the server side. Also Python
430and PHP offer the possibility to execute scripts within a program,
431they do not have any security feature to avoid for exmple access to the
432local disk. The V8 Javascript engine however, is very limited in
433functionality and therefore ideally suited for a sandboxed and
434therefore safe excution on the server. Any other solution is welcome.
435
436<H3>Javascript hints!</H3>
437Please note that in Javascript only basic data typed (number, etc)
438are copied in an assignment. In all other cases, only a reference
439is copied. For example, the following code snippet does not return 2
440as you might expect but 7!
441<pre>
442var arr = [ 0, 1, 2, 3 ];
443var cpy = arr;
444cpy[2] = 7;
445print(arr[2]);
446</pre>
447To avoid that, the global namespace implements a clone function.
448For exmaple, the following code snippet will return the expected output:
449<pre>
450var arr = [ 0, 1, 2, 3 ];
451var cpy = $.clone(arr);
452cpy[2] = 7;
453print(arr[2]);
454</pre>
455
456<H3>Javascript arrays</H3>
457Note that javascript arrays have some very powerful member functions.
458For a description see for example
459<A HREF="http://www.tutorialspoint.com/javascript/javascript_arrays_object.htm">here</A>
460or search google for function like <i>map</i> or <i>reduce</i>.
461
462<H3>The global object $</H3>
463
464The environment provides a global object (namesapce) called $ with the following members:
465<table>
466<tr><td>$.file.numEvents</td><td>Number of events in the file</td></tr>
467<tr><td>$.file.runStart</td><td>MJD of run start minus 40587 (unix time in days)</td></tr>
468<tr><td>$.file.runEnd</td><td>MJD of run end minus 40587 (unix time in days)</td></tr>
469<tr><td>$.file.drsFile</td><td>If this is a DRS calibration file, the step id, otherwise -1</td></tr>
470<tr><td>$.file.isMC</td><td>True is this was requested as Monte Carlo file</td></tr>
471<tr><td>$.file.isDRS</td><td>True if DRS calibration constants were requested</td></tr>
472<tr><td>$.file.isCalibrated</td><td>True if a calibrated file was requested</td></tr>
473<tr><td>$.event</td><td>The event header information as obtained from the file</td></tr>
474<tr><td>$.event.numRoi</td><td>Number of samples per pixel</td></tr>
475<tr><td>$.event.numPix</td><td>Number of pixels</td></tr>
476<tr><td>$.event.eventNumber</td><td>Event number</td></tr>
477<tr><td>$.event.triggerNumber</td><td>Trigger number</td></tr>
478<tr><td>$.event.triggerType</td><td>Trigger type</td></tr>
479<tr><td>$.event.trigger</td><td>Decoded trigger information</td></tr>
480<tr><td>$.event.unixTime[2]</td><td>Timestamp when the event arrived at the event builder</td></tr>
481<tr><td>$.data[numPix][numRoi]</td><td>The event data</td></tr>
482<tr><td>$.nroi</td><td>Shortcut to $.event.numRoi</td></tr>
483<tr><td>$.npix</td><td>Shortcut to $.event.numPix</td></tr>
484<tr><td>$.trigger</td><td>Shortcut to $.event.trigger</td></tr>
485<tr><td>$.neighbors</td><td>Array of 1440 arrays each containing the corresponding neighbors</td></tr>
486<tr><td>$.map</td><td>Array of 1440 entries (software index) containing the hardware indices.</td></tr>
487<tr><td>$.geom</td><td>Array of 1440 entries. Each an array with two entries, x and y. The distance between two neighbors is 1.</td></tr>
488<tr><td>$.dist(i,j)</td><td>Calculated the distance of two pixels in degree.</td></tr>
489<tr><td>$.conv</td><td>Conversion factor to convert geom and dist to degree.</td></tr>
490</table>
491
492<H3>Stack traces</H3>
493Please note that due to some interna, the line numbers in the
494stack trace shown in case of runtime errors are by one line too high.
495
496<H3>Editor 1 (proc)</H3>
497
498<I>proc</I> can return an array with numRoi entries or an array with up to
499four sub-arrays each of nRoi entries. They will be displayed in the graph.
500The chosel pixel is available as <I>pixel</I>.
501The most simple is to just return the selected pixel data unprocssed:
502<pre>
503return $.data[pixel];
504</pre>
505
506<H3>Editor 2 (main)</H3>
507<I>main</I> should return extracted data per pixel. As <I>proc</I> it can
508return a single array or an array with up to four sub-arrays each with
509numPix entries. They are displayed in the camera displays. The function
510implemented as <I>proc</I> is accessible as <I>proc(i)</I> with <I>i</I>
511being available in <I>proc</I> as <I>pixel</I>. A very simple extractor
512could be to return just the sample at the trigger position
513<pre>
514var rc = [];
515for (var i=0; i<$.event.numPix; i++)
516 rc[i] = $.data[i][60];
517return rc;
518</pre>
519or taking the data pre-procesed by the code of the <I>proc</I>-function:
520<pre>
521var rc = [];
522for (var i=0; i<$.event.numPix; i++)
523 rc[i] = proc(i)[60];
524return rc;
525</pre>
526
527Note that the precise access to the result of proc might depend on what
528exactly is retruned by proc (an array, or an array with sub-arrays).
529
530Pixel which are not returned (<tt>undefind</tt> or <tt>null</tt>) are
531not displayed. This allows to show cleaned images as well or test
532image cleaning algorithms.
533
534<H3>What is the data?</H3>
535The data are all data files found in disks in La Palma (to be precise:
536on daq's disks). The data is raw-data but with the most recent
537DRS calibration (only the 1024-cell offset calibration)
538applied, while the application is done in intergers, i.e. the
539fractional part of the calibration constant is removed.
540(This is basically what is written in our FITS files as part of the
541lossless compression process). No spike or jump removal is applied.
542
543<H3>The editor</H3>
544Key bindings of the editor can be found at
545<A HREF="http://codemirror.net/doc/manual.html#commands">Codemirror</A>.
546In addition the following binding are defined: Tab - Auto indent;
547F11 - Switch to fullscreen; Esc - In fullscreen mode to
548leave fullscreen; Ctrl-r - replace; Ctrl-y - Delete the line under the cursor;
549Ctrl-. (dot) - Fold code; Ctrl-Down (cursor down) - Autocomplete.
550
551<H3>How to change the file?</H3>
552Start typing the date in the filename field. The available files
553will be filtered as you type. To select a file you need to select
554it fom the pull down.
555
556<H3>What is the meaning of the DRS and Cal checkboxes?</H3>
557For some files, files which contain calibrated data are available.
558This means that the DRS calibration (offset (1024), gain and offset
559(roi)) has been applied. Enabling the checkbox will show this data
560instead of the raw data. Note that the precision is limited to 0.1mV.
561In some cases files were taken to deduce this calibration constants
562(DRS files). This is done in four steps: offset, gain, offset (1024),
563offset (roi). These steps are called 0, 1, 2 and 2 respectively. If the
564checkbox Drs is enabled, the corresponding calibration constants as
565stored in the .drs.fits file, are shown, which is
566<I>BaselineMean</I> [0], <I>GainMean</I> [1] and <I>TriggerOffsetMean</I> [2].
567
568<H3>What is the meaning of the MC checkbox?</h3>
569Currently, it is only to indicate whether the chosen file
570is a Monte Carlo file or not. At the moment, all available
571Monte Carlo file have a four-digit <I>year</I> starting with
572a 0.
573
574<H3>How to change the displayed pixel?</H3>
575Enter the pixel number on the corresponding field or its hwardware
576address. As soon as you acknowledge your change (e.g. remove focus
577by clicking somewhere else) the pixel contents gets displayed.
578
579<H3>How to Save/Load a script?</H3>
580To load a file choose a file fro your local hard drive via the
581file selection dialog. To save the contents of the editor, press
582Save.
583
584<H3>Submit</H3>
585If you have changed the script and you want to run it on the current event
586press Submit. The Javascript will be executed for this event on
587the server.
588
589<!--<H3>Autosubmit</H3>
590If Autosumit is enabled, the script will be submitted each time
591the file name or the event number is changed and executed.-->
592
593<H3>Pixel value</H3>
594To display the value returned for a pixel just click on the pixel.
595The value will be displayed in the Pixel field. This will also
596display the corresponding waveform in the graph.
597
598<H3>Min/max values</H3>
599Min and max values for the plot and the graph can be determined
600automatically or manully. To set the to a fixed value, enable the
601min and/or max field and enter the value of your choice. It will
602survive changing files, events or pixel.
603
604<H3>What is the meaning of the image?</H3>
605The image is a representation of the first and second moment of the
606distribution of the pixel values. The first moment is the center-of-gravity
607of the distirbution, the major and minor axis represent the standard
608deviation around the center-of-gravity (<i>width</I> and <i>length</I>).
609The line represents an estimate for the distance of the center-of-gravity
610to the origin of the primary particle (<i>disp</i>). Due to the lack
611of more information, it is a very simple estimate using
612disp=1.42*(1-width/length).
613
614<H3>Why is loading the page so slow?</H3>
615The total contents of the javascript libraries is about 1MB which
616all have to be treasferred to the browser. In addition the loading
617and processing of the event takes up to 1s so that the loading
618time of the page might be untypically slow. Once finished,
619the amaount of code to load can be decreased.
620
621<H3>How to unzoom the plot?</H3>
622Double click on the plot.
623
624</div>
625
626
627</body>
628</html>
Note: See TracBrowser for help on using the repository browser.