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

Last change on this file since 17813 was 17807, checked in by tbretz, 11 years ago
Added a checkbox for displaying the image and a help text for the meaning of the image.
File size: 27.6 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 Cal:
137 <input id="calibrated" type="checkbox" onclick="onSubmit();"></input>
138 Run:
139 <input id="file" style="width:100px"></input>
140 </span>
141 &nbsp;
142 <span style="white-space:nowrap">
143 Evt:
144 <input id="event" style="text-align:right;" type="number" onchange="onEvent();" value="0" min="0" max="0" step="1"></input>/<span id="numevents">---</span>
145 </span>
146 &nbsp;
147 <span style="white-space:nowrap">
148 Pix:
149 <input id="pixel" style="text-align:right;width:50px;" type="number" onchange="onPixel();" value="0" min="0" max="1439" step="1"></input>
150 </span>
151 &nbsp;
152 <span style="white-space:nowrap">
153 CBPX:
154 <input id="cbpx-c" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="1" min="0" max="3" step="1"></input>
155 <input id="cbpx-b" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="0" min="0" max="9" step="1"></input>
156 <input id="cbpx-p" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="3" min="0" max="3" step="1"></input>
157 <input id="cbpx-x" style="text-align:right;width:30px;" type="number" onchange="onCBPX();" value="6" min="0" max="8" step="1"></input>
158 =
159 <input id="cbpx" style="text-align:right;width:50px;" type="number" onchange="onHW();" value="393" min="0" max="1439" step="1"></input>
160 </span>
161</div>
162
163<div class="myaccordion" id="accordion2">
164 <h3><a href="#">Camera display</a></h3>
165</div>
166<div id="cameracontainer" class="ui-widget-content">
167 <table width="100%">
168 <colgroup>
169 <col style="width:40%;">
170 <col style="width:20%;">
171 <col style="width:40%;">
172 </colgroup>
173 <tr>
174 <td>
175 <span style="white-space:nowrap">
176 Min:
177 <input id="cameramin1" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(1);" value="0" disabled="true"></input>
178 <input id="cameraminon1" type="checkbox" onclick="onCameraMinMaxOn(1);" checked="true"></input>
179 </span>
180 &nbsp;
181 <span style="white-space:nowrap">
182 Max:
183 <input id="cameramax1" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(1);" value="0" disabled="true"></input>
184 <input id="cameramaxon1" type="checkbox" onclick="onCameraMinMaxOn(1);" checked="true"></input>
185 </span>
186 </td>
187 <td style="text-align:center" id="eventinfo">
188 </td>
189 <td style="text-align:right">
190 <span style="white-space:nowrap">
191 Min:
192 <input id="cameramin2" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(2);" value="0" disabled="true"></input>
193 <input id="cameraminon2" type="checkbox" onclick="onCameraMinMaxOn(2);" checked="true"></input>
194 </span>
195 <span style="white-space:nowrap">
196 &nbsp;
197 Max:
198 <input id="cameramax2" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(2);" value="0" disabled="true"></input>
199 <input id="cameramaxon2" type="checkbox" onclick="onCameraMinMaxOn(2);" checked="true"></input>
200 </span>
201 </td>
202 <td>
203 </td>
204 </tr>
205 </table>
206
207 <table id="table" width="100%" border="0" style="border:0;margin:0;padding:0;">
208 <tr style="margin:0;padding:0;">
209 <td style="margin:0;padding:0;">
210 <table border="0" style="margin:0;padding:0;">
211 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera1"></tr>
212 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera3"><canvas id="camera3" width="1" height="1"></canvas></td></tr>
213 </table>
214 </td>
215 <td style="margin:0;padding:0;" id="centercamera"><canvas id="camera1" width="1" height="1"></canvas></td>
216 <td style="margin:0;padding:0;">
217 <table border="0" style="margin:0;padding:0;">
218 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera2"><canvas id="camera2" width="1" height="1"></canvas></td></tr>
219 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="contcamera4"><canvas id="camera4" width="1" height="1"></canvas></td></tr>
220 </table>
221 </td>
222 </tr>
223 </table>
224
225 <table width="100%">
226 <colgroup>
227 <col style="width:40%;">
228 <col style="width:20%;">
229 <col style="width:40%;">
230 </colgroup>
231 <tr>
232 <td>
233 <span style="white-space:nowrap">
234 Min:
235 <input id="cameramin3" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(3);" value="0" disabled="true"></input>
236 <input id="cameraminon3" type="checkbox" onclick="onCameraMinMaxOn(3);" checked="true"></input>
237 </span>
238 &nbsp;
239 <span style="white-space:nowrap">
240 Max:
241 <input id="cameramax3" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(3);" value="0" disabled="true"></input>
242 <input id="cameramaxon3" type="checkbox" onclick="onCameraMinMaxOn(3);" checked="true"></input>
243 </span>
244 </td>
245 <td style="text-align:center;">
246 <input id="marker" type="checkbox" checked="true" onclick="refreshCameras();">Marker</input>&nbsp;&nbsp;
247 <input id="image" type="checkbox" onclick="refreshCameras();">Image</input>
248 <!--Pixel value:
249 <input id="value" type="text" readonly="true" value="0" style="text-align:right;width:100px"></input>-->
250 </td>
251 <td style="text-align:right">
252 <span style="white-space:nowrap">
253 Min:
254 <input id="cameramin4" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(4);" value="0" disabled="true"></input>
255 <input id="cameraminon4" type="checkbox" onclick="onCameraMinMaxOn(4);" checked="true"></input>
256 </span>
257 <span style="white-space:nowrap">
258 &nbsp;
259 Max:
260 <input id="cameramax4" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(4);" value="0" disabled="true"></input>
261 <input id="cameramaxon4" type="checkbox" onclick="onCameraMinMaxOn(4);" checked="true"></input>
262 </span>
263 </td>
264 </tr>
265 </table>
266</div>
267
268<div class="myaccordion" id="accordion7">
269 <h3><a href="#">Histograms</a></h3>
270</div>
271<div id="histcontainer" class="ui-widget-content">
272 <table width="100%">
273 <colgroup>
274 <col style="width:40%;">
275 <col style="width:20%;">
276 <col style="width:40%;">
277 </colgroup>
278 <tr>
279 <td>
280 <span style="white-space:nowrap">
281 Min:
282 <input id="histmin1" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(1);" value="0" disabled="true"></input>
283 <input id="histminon1" type="checkbox" onclick="onHistMinMaxOn(1);" checked="true"></input>
284 </span>
285 &nbsp;
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" 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" type="checkbox" onclick="onHistMinMaxOn(2);" checked="true"></input>
299 </span>
300 <span style="white-space:nowrap">
301 &nbsp;
302 Max:
303 <input id="histmax2" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(2);" value="0" disabled="true"></input>
304 <input id="histmaxon2" type="checkbox" onclick="onHistMinMaxOn(2);" checked="true"></input>
305 </span>
306 </td>
307 <td>
308 </td>
309 </tr>
310 </table>
311
312 <table id="table" width="100%" border="0" style="border:0;margin:0;padding:0;">
313 <tr style="margin:0;padding:0;">
314 <td style="margin:0;padding:0;">
315 <table border="0" style="margin:0;padding:0;">
316 <tr style="margin:0;padding:0;"><td style="margin:0;padding:0;" id="conthist1"></tr>
317 <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>
318 </table>
319 </td>
320 <td style="margin:0;padding:0;" id="centerhist"><div style="width:1px;height:1px;" id="hist1"></div></td>
321 <td style="margin:0;padding:0;">
322 <table border="0" style="margin:0;padding:0;">
323 <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>
324 <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>
325 </table>
326 </td>
327 </tr>
328 </table>
329
330 <table width="100%">
331 <colgroup>
332 <col style="width:40%;">
333 <col style="width:20%;">
334 <col style="width:40%;">
335 </colgroup>
336 <tr>
337 <td>
338 <span style="white-space:nowrap">
339 Min:
340 <input id="histmin3" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(3);" value="0" disabled="true"></input>
341 <input id="histminon3" type="checkbox" onclick="onHistMinMaxOn(3);" checked="true"></input>
342 </span>
343 &nbsp;
344 <span style="white-space:nowrap">
345 Max:
346 <input id="histmax3" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(3);" value="0" disabled="true"></input>
347 <input id="histmaxon3" type="checkbox" onclick="onHistMinMaxOn(3);" checked="true"></input>
348 </span>
349 </td>
350 <td style="text-align:center;">
351 <!--<input id="marker" type="checkbox" checked="true" onclick="onMarker();">Show pixel marker</input>-->
352 <!--Pixel value:
353 <input id="value" type="text" readonly="true" value="0" style="text-align:right;width:100px"></input>-->
354 </td>
355 <td style="text-align:right">
356 <span style="white-space:nowrap">
357 Min:
358 <input id="histmin4" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(4);" value="0" disabled="true"></input>
359 <input id="histminon4" type="checkbox" onclick="onHistMinMaxOn(4);" checked="true"></input>
360 </span>
361 <span style="white-space:nowrap">
362 &nbsp;
363 Max:
364 <input id="histmax4" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(4);" value="0" disabled="true"></input>
365 <input id="histmaxon4" type="checkbox" onclick="onHistMinMaxOn(4);" checked="true"></input>
366 </span>
367 </td>
368 </tr>
369 </table>
370</div>
371
372<div class="myaccordion" id="accordion3">
373 <h3><a href="#">Waveform</a></h3>
374</div>
375<div id="waveformcontainer" class="ui-widget-content">
376 <div id="waveform" style="width:100%;height:300px;"></div>
377 <table style="width:100%">
378 <colgroup>
379 <col style="width:50%;">
380 <col style="width:50%;">
381 </colgroup>
382 <tr>
383 <td style="text-align:left">
384 <span style="white-space:nowrap;float:left">
385 Xmin:
386 <input id="waveformxmin" style="width:55px;text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
387 <input id="waveformxminon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
388 &nbsp;
389 </span>
390 <span style="white-space:nowrap;float:left">
391 Xmax:
392 <input id="waveformxmax" style="width:55px;text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
393 <input id="waveformxmaxon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
394 </span>
395 </td>
396 <td style="text-align:right">
397 <span style="white-space:nowrap;">
398 Ymin:
399 <input id="waveformmin" style="text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
400 <input id="waveformminon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
401 </span>
402 <span style="white-space:nowrap;">
403 &nbsp;Ymax:
404 <input id="waveformmax" style="text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
405 <input id="waveformmaxon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
406 </span>
407 </td>
408 </tr>
409 </table>
410</div>
411
412<div class="myaccordion" id="accordion6">
413 <h3><a href="#">Additional controls</a></h3>
414</div>
415<div id="ctrlcontainer" class="ui-widget-content">
416 <form id="controls" method="POST" style="margin-bottom:0">
417 <input id="getcamera" type="button" onclick="onGetCameras();" value="Get camera data"></input>
418 <input id="getwaveform" type="button" onclick="onGetWaveforms();" value="Get waveforms"></input>
419 <input id="data" name="data" type="hidden"></input>
420 </form>
421</div>
422
423<div class="myaccordion" id="accordion4">
424 <h3><a href="#">Help</a></h3>
425</div>
426<div id="helpcontainer" class="ui-widget-content" style="padding-left:40px;padding-right:40px;padding-bottom:40px;">
427<H1>HELP</H1>
428
429<H3>How does it work?</H3>
430When you submit a javascript to the server, it will be executed
431on a sandbox on the server. Before the event is loaded from a file
432and made available within the sandbox. Generally, the sandbox
433can easily be enhanced, e.g. with algorithms available in php.
434This can be done on request. After execution, the result returned
435by the script is then displayed in the camera display.
436
437<H3>Why Javascript?</H3>
438Simply for security reasons. To avoid tranferring the event to the client's
439browser, the script must be executed on the server side. Also Python
440and PHP offer the possibility to execute scripts within a program,
441they do not have any security feature to avoid for exmple access to the
442local disk. The V8 Javascript engine however, is very limited in
443functionality and therefore ideally suited for a sandboxed and
444therefore safe excution on the server. Any other solution is welcome.
445
446<H3>Javascript hints!</H3>
447Please note that in Javascript only basic data typed (number, etc)
448are copied in an assignment. In all other cases, only a reference
449is copied. For example, the following code snippet does not return 2
450as you might expect but 7!
451<pre>
452var arr = [ 0, 1, 2, 3 ];
453var cpy = arr;
454cpy[2] = 7;
455print(arr[2]);
456</pre>
457To avoid that, the global namespace implements a clone function.
458For exmaple, the following code snippet will return the expected output:
459<pre>
460var arr = [ 0, 1, 2, 3 ];
461var cpy = $.clone(arr);
462cpy[2] = 7;
463print(arr[2]);
464</pre>
465
466<H3>Javascript arrays</H3>
467Note that javascript arrays have some very powerful member functions.
468For a description see for example
469<A HREF="http://www.tutorialspoint.com/javascript/javascript_arrays_object.htm">here</A>
470or search google for function like <i>map</i> or <i>reduce</i>.
471
472<H3>The global object $</H3>
473
474The environment provides a global object (namesapce) called $ with the following members:
475<table>
476<tr><td>$.file.numEvents</td><td>Number of events in the file</td></tr>
477<tr><td>$.file.runStart</td><td>MJD of run start minus 40587 (unix time in days)</td></tr>
478<tr><td>$.file.runEnd</td><td>MJD of run end minus 40587 (unix time in days)</td></tr>
479<tr><td>$.file.drsFile</td><td>If this is a DRS calibration file, the step id, otherwise -1</td></tr>
480<tr><td>$.event</td><td>The event header information as obtained from the file</td></tr>
481<tr><td>$.event.numRoi</td><td>Number of samples per pixel</td></tr>
482<tr><td>$.event.numPix</td><td>Number of pixels</td></tr>
483<tr><td>$.event.eventNumber</td><td>Event number</td></tr>
484<tr><td>$.event.triggerNumber</td><td>Trigger number</td></tr>
485<tr><td>$.event.triggerType</td><td>Trigger type</td></tr>
486<tr><td>$.event.trigger</td><td>Decoded trigger information</td></tr>
487<tr><td>$.event.unixTime[2]</td><td>Timestamp when the event arrived at the event builder</td></tr>
488<tr><td>$.data[numPix][numRoi]</td><td>The event data</td></tr>
489<tr><td>$.nroi</td><td>Shortcut to $.event.numRoi</td></tr>
490<tr><td>$.npix</td><td>Shortcut to $.event.numPix</td></tr>
491<tr><td>$.trigger</td><td>Shortcut to $.event.trigger</td></tr>
492<tr><td>$.neighbors</td><td>Array of 1440 arrays each containing the corresponding neighbors</td></tr>
493<tr><td>$.map</td><td>Array of 1440 entries (software index) containing the hardware indices.</td></tr>
494<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>
495<tr><td>$.dist(i,j)</td><td>Calculated the distance of two pixels in degree.</td></tr>
496<tr><td>$.conv</td><td>Conversion factor to convert geom and dist to degree.</td></tr>
497</table>
498
499<H3>Stack traces</H3>
500Please note that due to some interna, the line numbers in the
501stack trace shown in case of runtime errors are by one line too high.
502
503<H3>Editor 1 (proc)</H3>
504
505<I>proc</I> can return an array with numRoi entries or an array with up to
506four sub-arrays each of nRoi entries. They will be displayed in the graph.
507The chosel pixel is available as <I>pixel</I>.
508The most simple is to just return the selected pixel data unprocssed:
509<pre>
510return $.data[pixel];
511</pre>
512
513<H3>Editor 2 (main)</H3>
514<I>main</I> should return extracted data per pixel. As <I>proc</I> it can
515return a single array or an array with up to four sub-arrays each with
516numPix entries. They are displayed in the camera displays. The function
517implemented as <I>proc</I> is accessible as <I>proc(i)</I> with <I>i</I>
518being available in <I>proc</I> as <I>pixel</I>. A very simple extractor
519could be to return just the sample at the trigger position
520<pre>
521var rc = [];
522for (var i=0; i<$.event.numPix; i++)
523 rc[i] = $.data[i][60];
524return rc;
525</pre>
526or taking the data pre-procesed by the code of the <I>proc</I>-function:
527<pre>
528var rc = [];
529for (var i=0; i<$.event.numPix; i++)
530 rc[i] = proc(i)[60];
531return rc;
532</pre>
533
534Note that the precise access to the result of proc might depend on what
535exactly is retruned by proc (an array, or an array with sub-arrays).
536
537Pixel which are not returned (<tt>undefind</tt> or <tt>null</tt>) are
538not displayed. This allows to show cleaned images as well or test
539image cleaning algorithms.
540
541<H3>What is the data?</H3>
542The data are all data files found in disks in La Palma (to be precise:
543on daq's disks). The data is raw-data but with the most recent
544DRS calibration (only the 1024-cell offset calibration)
545applied, while the application is done in intergers, i.e. the
546fractional part of the calibration constant is removed.
547(This is basically what is written in our FITS files as part of the
548lossless compression process). No spike or jump removal is applied.
549
550<H3>The editor</H3>
551Key bindings of the editor can be found at
552<A HREF="http://codemirror.net/doc/manual.html#commands">Codemirror</A>.
553In addition the following binding are defined: Tab - Auto indent;
554F11 - Switch to fullscreen; Esc - In fullscreen mode to
555leave fullscreen; Ctrl-r - replace; Ctrl-y - Delete the line under the cursor;
556Ctrl-. (dot) - Fold code; Ctrl-Down (cursor down) - Autocomplete.
557
558<H3>How to change the file?</H3>
559Start typing the date in the filename field. The available files
560will be filtered as you type. To select a file you need to select
561it fom the pull down.
562
563<H3>How to change the displayed pixel?</H3>
564Enter the pixel number on the corresponding field or its hwardware
565address. As soon as you acknowledge your change (e.g. remove focus
566by clicking somewhere else) the pixel contents gets displayed.
567
568<H3>How to Save/Load a script?</H3>
569To load a file choose a file fro your local hard drive via the
570file selection dialog. To save the contents of the editor, press
571Save.
572
573<H3>Submit</H3>
574If you have changed the script and you want to run it on the current event
575press Submit. The Javascript will be executed for this event on
576the server.
577
578<!--<H3>Autosubmit</H3>
579If Autosumit is enabled, the script will be submitted each time
580the file name or the event number is changed and executed.-->
581
582<H3>Pixel value</H3>
583To display the value returned for a pixel just click on the pixel.
584The value will be displayed in the Pixel field. This will also
585display the corresponding waveform in the graph.
586
587<H3>Min/max values</H3>
588Min and max values for the plot and the graph can be determined
589automatically or manully. To set the to a fixed value, enable the
590min and/or max field and enter the value of your choice. It will
591survive changing files, events or pixel.
592
593<H3>What is the meaning of the image?</H3>
594The image is a representation of the first and second moment of the
595distribution of the pixel values. The first moment is the center-of-gravity
596of the distirbution, the major and minor axis represent the standard
597deviation around the center-of-gravity (<i>width</I> and <i>length</I>).
598The line represents an estimate for the distance of the center-of-gravity
599to the origin of the primary particle (<i>disp</i>). Due to the lack
600of more information, it is a very simple estimate using
601disp=1.42*(1-width/length).
602
603<H3>Why is loading the page so slow?</H3>
604The total contents of the javascript libraries is about 1MB which
605all have to be treasferred to the browser. In addition the loading
606and processing of the event takes up to 1s so that the loading
607time of the page might be untypically slow. Once finished,
608the amaount of code to load can be decreased.
609
610<H3>How to unzoom the plot?</H3>
611Double click on the plot.
612
613</div>
614
615
616</body>
617</html>
Note: See TracBrowser for help on using the repository browser.