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

Last change on this file since 17790 was 17790, checked in by tbretz, 11 years ago
Added $.geom and $.map
File size: 26.8 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="onMarker();">Show pixel marker</input>
247 <!--Pixel value:
248 <input id="value" type="text" readonly="true" value="0" style="text-align:right;width:100px"></input>-->
249 </td>
250 <td style="text-align:right">
251 <span style="white-space:nowrap">
252 Min:
253 <input id="cameramin4" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(4);" value="0" disabled="true"></input>
254 <input id="cameraminon4" type="checkbox" onclick="onCameraMinMaxOn(4);" checked="true"></input>
255 </span>
256 <span style="white-space:nowrap">
257 &nbsp;
258 Max:
259 <input id="cameramax4" style="text-align:right;width:100px;" type="number" onchange="onCameraMinMax(4);" value="0" disabled="true"></input>
260 <input id="cameramaxon4" type="checkbox" onclick="onCameraMinMaxOn(4);" checked="true"></input>
261 </span>
262 </td>
263 </tr>
264 </table>
265</div>
266
267<div class="myaccordion" id="accordion7">
268 <h3><a href="#">Histograms</a></h3>
269</div>
270<div id="histcontainer" class="ui-widget-content">
271 <table width="100%">
272 <colgroup>
273 <col style="width:40%;">
274 <col style="width:20%;">
275 <col style="width:40%;">
276 </colgroup>
277 <tr>
278 <td>
279 <span style="white-space:nowrap">
280 Min:
281 <input id="histmin1" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(1);" value="0" disabled="true"></input>
282 <input id="histminon1" type="checkbox" onclick="onHistMinMaxOn(1);" checked="true"></input>
283 </span>
284 &nbsp;
285 <span style="white-space:nowrap">
286 Max:
287 <input id="histmax1" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(1);" value="0" disabled="true"></input>
288 <input id="histmaxon1" type="checkbox" onclick="onHistMinMaxOn(1);" checked="true"></input>
289 </span>
290 </td>
291 <td style="text-align:center" id="eventinfo">
292 </td>
293 <td style="text-align:right">
294 <span style="white-space:nowrap">
295 Min:
296 <input id="histmin2" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(2);" value="0" disabled="true"></input>
297 <input id="histminon2" type="checkbox" onclick="onHistMinMaxOn(2);" checked="true"></input>
298 </span>
299 <span style="white-space:nowrap">
300 &nbsp;
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" 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:40%;">
332 <col style="width:20%;">
333 <col style="width:40%;">
334 </colgroup>
335 <tr>
336 <td>
337 <span style="white-space:nowrap">
338 Min:
339 <input id="histmin3" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(3);" value="0" disabled="true"></input>
340 <input id="histminon3" type="checkbox" onclick="onHistMinMaxOn(3);" checked="true"></input>
341 </span>
342 &nbsp;
343 <span style="white-space:nowrap">
344 Max:
345 <input id="histmax3" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(3);" value="0" disabled="true"></input>
346 <input id="histmaxon3" type="checkbox" onclick="onHistMinMaxOn(3);" checked="true"></input>
347 </span>
348 </td>
349 <td style="text-align:center;">
350 <!--<input id="marker" type="checkbox" checked="true" onclick="onMarker();">Show pixel marker</input>-->
351 <!--Pixel value:
352 <input id="value" type="text" readonly="true" value="0" style="text-align:right;width:100px"></input>-->
353 </td>
354 <td style="text-align:right">
355 <span style="white-space:nowrap">
356 Min:
357 <input id="histmin4" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(4);" value="0" disabled="true"></input>
358 <input id="histminon4" type="checkbox" onclick="onHistMinMaxOn(4);" checked="true"></input>
359 </span>
360 <span style="white-space:nowrap">
361 &nbsp;
362 Max:
363 <input id="histmax4" style="text-align:right;width:100px;" type="number" onchange="onHistMinMax(4);" value="0" disabled="true"></input>
364 <input id="histmaxon4" type="checkbox" onclick="onHistMinMaxOn(4);" checked="true"></input>
365 </span>
366 </td>
367 </tr>
368 </table>
369</div>
370
371<div class="myaccordion" id="accordion3">
372 <h3><a href="#">Waveform</a></h3>
373</div>
374<div id="waveformcontainer" class="ui-widget-content">
375 <div id="waveform" style="width:100%;height:300px;"></div>
376 <table style="width:100%">
377 <colgroup>
378 <col style="width:50%;">
379 <col style="width:50%;">
380 </colgroup>
381 <tr>
382 <td style="text-align:left">
383 <span style="white-space:nowrap;float:left">
384 Xmin:
385 <input id="waveformxmin" style="width:55px;text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
386 <input id="waveformxminon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
387 &nbsp;
388 </span>
389 <span style="white-space:nowrap;float:left">
390 Xmax:
391 <input id="waveformxmax" style="width:55px;text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
392 <input id="waveformxmaxon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
393 </span>
394 </td>
395 <td style="text-align:right">
396 <span style="white-space:nowrap;">
397 Ymin:
398 <input id="waveformmin" style="text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
399 <input id="waveformminon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
400 </span>
401 <span style="white-space:nowrap;">
402 &nbsp;Ymax:
403 <input id="waveformmax" style="text-align:right"type="number" onchange="onWaveformMinMax();" value="0" disabled="true"></input>
404 <input id="waveformmaxon" type="checkbox" onclick="onWaveformMinMaxOn();" checked="true"></input>
405 </span>
406 </td>
407 </tr>
408 </table>
409</div>
410
411<div class="myaccordion" id="accordion6">
412 <h3><a href="#">Additional controls</a></h3>
413</div>
414<div id="ctrlcontainer" class="ui-widget-content">
415 <form id="controls" method="POST" style="margin-bottom:0">
416 <input id="getcamera" type="button" onclick="onGetCameras();" value="Get camera data"></input>
417 <input id="getwaveform" type="button" onclick="onGetWaveforms();" value="Get waveforms"></input>
418 <input id="data" name="data" type="hidden"></input>
419 </form>
420</div>
421
422<div class="myaccordion" id="accordion4">
423 <h3><a href="#">Help</a></h3>
424</div>
425<div id="helpcontainer" class="ui-widget-content" style="padding-left:40px;padding-right:40px;padding-bottom:40px;">
426<H1>HELP</H1>
427
428<H3>How does it work?</H3>
429When you submit a javascript to the server, it will be executed
430on a sandbox on the server. Before the event is loaded from a file
431and made available within the sandbox. Generally, the sandbox
432can easily be enhanced, e.g. with algorithms available in php.
433This can be done on request. After execution, the result returned
434by the script is then displayed in the camera display.
435
436<H3>Why Javascript?</H3>
437Simply for security reasons. To avoid tranferring the event to the client's
438browser, the script must be executed on the server side. Also Python
439and PHP offer the possibility to execute scripts within a program,
440they do not have any security feature to avoid for exmple access to the
441local disk. The V8 Javascript engine however, is very limited in
442functionality and therefore ideally suited for a sandboxed and
443therefore safe excution on the server. Any other solution is welcome.
444
445<H3>Javascript hints!</H3>
446Please note that in Javascript only basic data typed (number, etc)
447are copied in an assignment. In all other cases, only a reference
448is copied. For example, the following code snippet does not return 2
449as you might expect but 7!
450<pre>
451var arr = [ 0, 1, 2, 3 ];
452var cpy = arr;
453cpy[2] = 7;
454print(arr[2]);
455</pre>
456To avoid that, the global namespace implements a clone function.
457For exmaple, the following code snippet will return the expected output:
458<pre>
459var arr = [ 0, 1, 2, 3 ];
460var cpy = $.clone(arr);
461cpy[2] = 7;
462print(arr[2]);
463</pre>
464
465<H3>Javascript arrays</H3>
466Note that javascript arrays have some very powerful member functions.
467For a description see for example
468<A HREF="http://www.tutorialspoint.com/javascript/javascript_arrays_object.htm">here</A>
469or search google for function like <i>map</i> or <i>reduce</i>.
470
471<H3>The global object $</H3>
472
473The environment provides a global object (namesapce) called $ with the following members:
474<table>
475<tr><td>$.file.numEvents</td><td>Number of events in the file</td></tr>
476<tr><td>$.file.runStart</td><td>MJD of run start minus 40587 (unix time in days)</td></tr>
477<tr><td>$.file.runEnd</td><td>MJD of run end minus 40587 (unix time in days)</td></tr>
478<tr><td>$.file.drsFile</td><td>If this is a DRS calibration file, the step id, otherwise -1</td></tr>
479<tr><td>$.event</td><td>The event header information as obtained from the file</td></tr>
480<tr><td>$.event.numRoi</td><td>Number of samples per pixel</td></tr>
481<tr><td>$.event.numPix</td><td>Number of pixels</td></tr>
482<tr><td>$.event.eventNumber</td><td>Event number</td></tr>
483<tr><td>$.event.triggerNumber</td><td>Trigger number</td></tr>
484<tr><td>$.event.triggerType</td><td>Trigger type</td></tr>
485<tr><td>$.event.trigger</td><td>Decoded trigger information</td></tr>
486<tr><td>$.event.unixTime[2]</td><td>Timestamp when the event arrived at the event builder</td></tr>
487<tr><td>$.data[numPix][numRoi]</td><td>The event data</td></tr>
488<tr><td>$.nroi</td><td>Shortcut to $.event.numRoi</td></tr>
489<tr><td>$.npix</td><td>Shortcut to $.event.numPix</td></tr>
490<tr><td>$.trigger</td><td>Shortcut to $.event.trigger</td></tr>
491<tr><td>$.neighbors</td><td>Array of 1440 arrays each containing the corresponding neighbors</td></tr>
492<tr><td>$.geom</td><td>Array of 1440 entries. Each an array with two entries, x and y.</td></tr>
493<tr><td>$.map</td><td>Array of 1440 entries (software index) containing the hardware indices.</td></tr>
494</table>
495
496<H3>Stack traces</H3>
497Please note that due to some interna, the line numbers in the
498stack trace shown in case of runtime errors are by one line too high.
499
500<H3>Editor 1 (proc)</H3>
501
502<I>proc</I> can return an array with numRoi entries or an array with up to
503four sub-arrays each of nRoi entries. They will be displayed in the graph.
504The chosel pixel is available as <I>pixel</I>.
505The most simple is to just return the selected pixel data unprocssed:
506<pre>
507return $.data[pixel];
508</pre>
509
510<H3>Editor 2 (main)</H3>
511<I>main</I> should return extracted data per pixel. As <I>proc</I> it can
512return a single array or an array with up to four sub-arrays each with
513numPix entries. They are displayed in the camera displays. The function
514implemented as <I>proc</I> is accessible as <I>proc(i)</I> with <I>i</I>
515being available in <I>proc</I> as <I>pixel</I>. A very simple extractor
516could be to return just the sample at the trigger position
517<pre>
518var rc = [];
519for (var i=0; i<$.event.numPix; i++)
520 rc[i] = $.data[i][60];
521return rc;
522</pre>
523or taking the data pre-procesed by the code of the <I>proc</I>-function:
524<pre>
525var rc = [];
526for (var i=0; i<$.event.numPix; i++)
527 rc[i] = proc(i)[60];
528return rc;
529</pre>
530
531Note that the precise access to the result of proc might depend on what
532exactly is retruned by proc (an array, or an array with sub-arrays).
533
534Pixel which are not returned (<tt>undefind</tt> or <tt>null</tt>) are
535not displayed. This allows to show cleaned images as well or test
536image cleaning algorithms.
537
538<H3>What is the data?</H3>
539The data are all data files found in disks in La Palma (to be precise:
540on daq's disks). The data is raw-data but with the most recent
541DRS calibration (only the 1024-cell offset calibration)
542applied, while the application is done in intergers, i.e. the
543fractional part of the calibration constant is removed.
544(This is basically what is written in our FITS files as part of the
545lossless compression process). No spike or jump removal is applied.
546
547<H3>The editor</H3>
548Key bindings of the editor can be found at
549<A HREF="http://codemirror.net/doc/manual.html#commands">Codemirror</A>.
550In addition the following binding are defined: Tab - Auto indent;
551F11 - Switch to fullscreen; Esc - In fullscreen mode to
552leave fullscreen; Ctrl-r - replace; Ctrl-y - Delete the line under the cursor;
553Ctrl-. (dot) - Fold code; Ctrl-Down (cursor down) - Autocomplete.
554
555<H3>How to change the file?</H3>
556Start typing the date in the filename field. The available files
557will be filtered as you type. To select a file you need to select
558it fom the pull down.
559
560<H3>How to change the displayed pixel?</H3>
561Enter the pixel number on the corresponding field or its hwardware
562address. As soon as you acknowledge your change (e.g. remove focus
563by clicking somewhere else) the pixel contents gets displayed.
564
565<H3>How to Save/Load a script?</H3>
566To load a file choose a file fro your local hard drive via the
567file selection dialog. To save the contents of the editor, press
568Save.
569
570<H3>Submit</H3>
571If you have changed the script and you want to run it on the current event
572press Submit. The Javascript will be executed for this event on
573the server.
574
575<!--<H3>Autosubmit</H3>
576If Autosumit is enabled, the script will be submitted each time
577the file name or the event number is changed and executed.-->
578
579<H3>Pixel value</H3>
580To display the value returned for a pixel just click on the pixel.
581The value will be displayed in the Pixel field. This will also
582display the corresponding waveform in the graph.
583
584<H3>Min/max values</H3>
585Min and max values for the plot and the graph can be determined
586automatically or manully. To set the to a fixed value, enable the
587min and/or max field and enter the value of your choice. It will
588survive changing files, events or pixel.
589
590<H3>Why is loading the page so slow?</H3>
591The total contents of the javascript libraries is about 1MB which
592all have to be treasferred to the browser. In addition the loading
593and processing of the event takes up to 1s so that the loading
594time of the page might be untypically slow. Once finished,
595the amaount of code to load can be decreased.
596
597<H3>How to unzoom the plot?</H3>
598Double click on the plot.
599
600</div>
601
602
603</body>
604</html>
Note: See TracBrowser for help on using the repository browser.