add PNG download link in simulation, change HELIOS array position to be the relaistic values
This commit is contained in:
parent
b1c9669fd4
commit
d5dccda144
|
@ -66,7 +66,8 @@ var arrayLen = 50 * 10 + 2 * 9 // SOLARIS
|
|||
var detLen = 50; // SOLARIS
|
||||
var nDet = 10; // SOLARIS
|
||||
var detGap = 2; // SOLARIS
|
||||
var arrayPos = [];
|
||||
var pos = []; //1D array, store the 1st pos of detector
|
||||
var arrayPos = []; // 2D array, store {tip, toe} of each detector
|
||||
|
||||
const c = 299.792468; // mm/ns
|
||||
|
||||
|
@ -214,16 +215,28 @@ function CalConstants(){
|
|||
}
|
||||
|
||||
function CalArrayPos(){
|
||||
let helios = document.getElementById('HELIOS').checked;
|
||||
|
||||
let haha = parseFloat(document.getElementById('posArray').value);
|
||||
arrayPos = [];
|
||||
for( let i = 0; i < nDet; i++){
|
||||
let kaka = [];
|
||||
if( haha < 0 ){
|
||||
kaka.push(haha - (i+1) * detLen - i * detGap);
|
||||
kaka.push(haha - (i) * detLen - i * detGap);
|
||||
if( helios == true ){
|
||||
if( haha < 0 ){
|
||||
kaka.push(haha - pos[i] - detLen );
|
||||
kaka.push(haha - pos[i]);
|
||||
}else{
|
||||
kaka.push(haha + pos[i] );
|
||||
kaka.push(haha + pos[i] + detLen );
|
||||
}
|
||||
}else{
|
||||
kaka.push(haha + (i) * detLen + i * detGap);
|
||||
kaka.push(haha + (i+1) * detLen + i * detGap);
|
||||
if( haha < 0 ){
|
||||
kaka.push(haha - (i+1) * detLen - i * detGap);
|
||||
kaka.push(haha - (i) * detLen - i * detGap);
|
||||
}else{
|
||||
kaka.push(haha + (i) * detLen + i * detGap);
|
||||
kaka.push(haha + (i+1) * detLen + i * detGap);
|
||||
}
|
||||
}
|
||||
arrayPos.push(kaka);
|
||||
}
|
||||
|
@ -239,6 +252,13 @@ function SetSSType(){
|
|||
detGap = 5;
|
||||
detLen = 50;
|
||||
nDet = 6;
|
||||
pos = [];
|
||||
pos.push(.0);
|
||||
pos.push(58.6);
|
||||
pos.push(117.9);
|
||||
pos.push(176.8);
|
||||
pos.push(235.8);
|
||||
pos.push(294.0);
|
||||
}
|
||||
if ( solaris == true ) {
|
||||
perpDistant = 11.5;
|
||||
|
@ -254,6 +274,8 @@ function SetSSType(){
|
|||
}
|
||||
arrayLen = detLen * nDet + detGap * (nDet-1);
|
||||
|
||||
if( helios ) arrayLen = pos[5] + detLen;
|
||||
|
||||
CalArrayPos();
|
||||
//document.getElementById('n1').innerHTML = perpDistant;
|
||||
}
|
||||
|
@ -571,7 +593,7 @@ function CalThetaCM(){
|
|||
let angGate = parseFloat(document.getElementById('thetaCMGate').value);
|
||||
let xGate = parseFloat(document.getElementById('XGate').value);
|
||||
|
||||
CalArrayPos();
|
||||
SetSSType();
|
||||
|
||||
let haha1 = E_tot_cm*E_tot_cm - Math.pow(heavy[2] + ex + light[2],2);
|
||||
let haha2 = E_tot_cm*E_tot_cm - Math.pow(heavy[2] + ex - light[2],2);
|
||||
|
@ -713,7 +735,7 @@ function AdjustRangeEZ(){
|
|||
let xStart = (haha < 0 ? haha - arrayLen - 100 : haha - 100);
|
||||
let xEnd = (haha < 0 ? haha + 100: haha + arrayLen + 100);
|
||||
|
||||
CalArrayPos();
|
||||
SetSSType();
|
||||
|
||||
xRange = [xStart, xEnd];
|
||||
yRange = [0, parseFloat(document.getElementById('eRangeSlider').value)];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import cgi, cgitb
|
||||
#import re
|
||||
|
||||
form = cgi.FieldStorage()
|
||||
|
||||
|
@ -14,6 +15,10 @@ os.chdir(r"files")
|
|||
result = "";
|
||||
|
||||
if 'AZ' in form:
|
||||
#haha = re.split(r'(\d+)', AZ)
|
||||
#haha = list(filter(None, haha))
|
||||
#haha[1] = haha[1].capitalize()
|
||||
#kaka = ''.join(haha)
|
||||
result=subprocess.run(['../Cleopatra/IsotopeShort', AZ], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
|
||||
if 'A' in form:
|
||||
|
@ -59,8 +64,6 @@ else:
|
|||
#print("</body>")
|
||||
#print("</html>")
|
||||
|
||||
|
||||
|
||||
#import plotly.express as px
|
||||
|
||||
#fig = px.scatter(x=range(10), y = range(10))
|
||||
|
|
|
@ -292,6 +292,7 @@ print("<br> %s" % gate)
|
|||
|
||||
if dwbaPNG != "" :
|
||||
print ("<img src=\"files/%s\">" % dwbaPNG)
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">PNG</a>" % (dwbaPNG, dwbaPNG))
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">%s</a>" % (fn4, fn4, fn4))
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">%s</a>" % (fn4+".in", fn4+".in", fn4+".in"))
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">%s</a>" % (fn4+".out", fn4+".out", fn4+".out"))
|
||||
|
@ -303,6 +304,7 @@ if dwbaPNG != "" :
|
|||
|
||||
if pngName != "" :
|
||||
print ("<img src=\"files/%s\">" % pngName)
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">PNG</a>" % (pngName, pngName))
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">reactionConfig file</a>" % (fn1, fn1))
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">detectorGeo file</a>" % (fn2, fn2))
|
||||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">Ex file</a>" % (fnEx, fnEx))
|
||||
|
|
Loading…
Reference in New Issue
Block a user