Changeset 17810 for trunk/FACT++/www/viewer
- Timestamp:
- 05/08/14 17:09:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/viewer/index.js
r17808 r17810 470 470 } 471 471 472 canv.hillas = Hillas(canv.dataAbs);473 474 472 canv.min = Math.min.apply(Math, canv.dataAbs.filter(function(e){return !isNaN(e)})); 475 473 canv.max = Math.max.apply(Math, canv.dataAbs.filter(function(e){return !isNaN(e)})); … … 1359 1357 // ======================= Draw Ellipse ====================== 1360 1358 1361 var h = canv.hillas; 1362 if (h && document.getElementById('image').checked) 1363 { 1364 ctx.save(); 1365 1366 ctx.translate(h.mean[0], h.mean[1]); 1367 ctx.rotate(h.phi); 1368 1369 ctx.save(); 1370 ctx.scale(h.axis[0], h.axis[1]); 1371 ctx.beginPath(); 1372 ctx.arc(0, 0, 1, 0, 2*Math.PI); 1373 ctx.restore(); 1374 1375 ctx.lineWidth = 0.15; 1376 ctx.strokeStyle = "#444"; 1377 ctx.stroke(); 1378 1379 ctx.strokeStyle = "#888"; 1380 ctx.beginPath(); 1381 ctx.moveTo(0, -h.disp); 1382 ctx.lineTo(0, h.disp); 1383 ctx.stroke(); 1384 1385 ctx.restore(); 1359 if (document.getElementById('image').checked) 1360 { 1361 var h = Hillas(canv.dataAbs, canv.zmin); 1362 if (h) 1363 { 1364 ctx.save(); 1365 1366 ctx.translate(h.mean[0], h.mean[1]); 1367 ctx.rotate(h.phi); 1368 1369 ctx.save(); 1370 ctx.scale(h.axis[0], h.axis[1]); 1371 ctx.beginPath(); 1372 ctx.arc(0, 0, 1, 0, 2*Math.PI); 1373 ctx.restore(); 1374 1375 ctx.lineWidth = 0.15; 1376 ctx.strokeStyle = "#555"; 1377 ctx.stroke(); 1378 1379 ctx.strokeStyle = "#888"; 1380 ctx.beginPath(); 1381 ctx.moveTo(0, -h.disp); 1382 ctx.lineTo(0, h.disp); 1383 ctx.stroke(); 1384 1385 ctx.restore(); 1386 } 1386 1387 } 1387 1388 … … 1426 1427 // =================================================================== 1427 1428 1428 function Hillas(data )1429 function Hillas(data, min) 1429 1430 { 1430 1431 var mx = 0; … … 1439 1440 for (var i=0; i<1440; i++) 1440 1441 { 1441 if (data[i]===undefined )1442 if (data[i]===undefined || data[i]<min) 1442 1443 continue; 1443 1444
Note:
See TracChangeset
for help on using the changeset viewer.