remove FRIB beam rate, improve UI
This commit is contained in:
parent
9871bdeeaa
commit
92ad200739
|
@ -1,6 +1,23 @@
|
|||
var energy = [];
|
||||
var jpi = [];
|
||||
var Name;
|
||||
var A;
|
||||
var Sym;
|
||||
|
||||
function breakdownName(str) {
|
||||
const match = str.match(/^(\d+)([a-zA-Z]+)$/);
|
||||
if (match) {
|
||||
const numberPart = parseInt(match[1]);
|
||||
const stringPart = match[2];
|
||||
return { numberPart, stringPart };
|
||||
} else {
|
||||
return null; // If the input string doesn't match the expected format
|
||||
}
|
||||
}
|
||||
|
||||
var Sn = 999;
|
||||
var Sp = 999;
|
||||
var Sa = 999;
|
||||
|
||||
function GetData(){
|
||||
|
||||
|
@ -19,6 +36,10 @@ function GetData(){
|
|||
energy = [];
|
||||
haha.forEach(line =>{
|
||||
// console.log(line);
|
||||
if( line.includes("Sn:") && line.length != 0 ){
|
||||
Sn = line.substring(-8);
|
||||
}
|
||||
|
||||
if( line.includes("<tr><td style=") && line.length != 0) {
|
||||
jpi.push(line.substring(98).slice(0,-10).trim());
|
||||
energy.push(parseFloat(line.substring(43,54).trim())/1000.);
|
||||
|
@ -43,6 +64,8 @@ function PlotLevels(){
|
|||
const plotWidth = 300;
|
||||
const plotHeight = 600;
|
||||
const yMin = -1;
|
||||
|
||||
let maxEx = parseFloat(document.getElementById('maxEx').value);
|
||||
const maxExExp = Math.max(...energy);
|
||||
|
||||
// console.log(maxExExp);
|
||||
|
@ -63,7 +86,7 @@ function PlotLevels(){
|
|||
range: [-0.5, 3]
|
||||
},
|
||||
yaxis: {
|
||||
range: [yMin, maxExExp + 1],
|
||||
range: [yMin, maxEx + 2],
|
||||
showline: false,
|
||||
visible: false
|
||||
},
|
||||
|
@ -137,10 +160,13 @@ function PlotLevels(){
|
|||
// let NameYPos = (parseFloat(maxEx) + 2*fontSizeMeV);
|
||||
// console.log(NameYPos);
|
||||
|
||||
let name2 = breakdownName(Name);
|
||||
|
||||
|
||||
fig.layout.annotations.push({
|
||||
x: 0.5,
|
||||
y: (parseFloat(maxEx) + 0.5),
|
||||
text: Name,
|
||||
y: (maxEx + 1),
|
||||
text: "<sup>" + name2.numberPart +"</sup>" + name2.stringPart,
|
||||
font: { size: 2 * fontSize },
|
||||
showarrow: false
|
||||
});
|
||||
|
|
|
@ -20,16 +20,16 @@ print( "Content-type:text/html\r\n\r\n")
|
|||
|
||||
#print("==== requesting FRIB rate for A = %s, Z = %s " % (A, Z))
|
||||
|
||||
url = "https://groups.nscl.msu.edu/frib/rates/source/frib_yieldY.php?a="+A + "&z=" + Z + "&y=y"
|
||||
#url = "https://groups.nscl.msu.edu/frib/rates/source/frib_yieldY.php?a="+A + "&z=" + Z + "&y=y"
|
||||
|
||||
fp = urllib.request.urlopen(url)
|
||||
#fp = urllib.request.urlopen(url)
|
||||
|
||||
list = fp.read().decode("utf8").split(",")
|
||||
#list = fp.read().decode("utf8").split(",")
|
||||
|
||||
#for haha in list:
|
||||
# print(haha)
|
||||
|
||||
print(list[5])
|
||||
#print(list[5])
|
||||
|
||||
|
||||
|
||||
|
|
2
digios
2
digios
|
@ -1 +1 @@
|
|||
Subproject commit f50d916d3814bbee8973336adff7c0ea4bec588a
|
||||
Subproject commit f5eef9c19afb833c4fa94ff5b88b4e602918733d
|
|
@ -75,7 +75,7 @@
|
|||
<td><Input type="text" style="width:60px" value="0" id="beamEx" enterkeyhint="done"/></td>
|
||||
<td>MeV</td>
|
||||
<td id='beamSp'></td>
|
||||
<td id="beamYield"></td>
|
||||
<!--td id="beamYield"></td>-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:right"> Target (a):</td>
|
||||
|
|
|
@ -112,14 +112,15 @@ var color = ['rgb(31,119,180)', // muted blue
|
|||
'rgb(23,190,207)']; // blue-teal
|
||||
|
||||
function GetYield(A,Z){
|
||||
let str = 'beamRate.py?A=' + A + '&Z=' + Z;
|
||||
let client = new XMLHttpRequest();
|
||||
client.onreadystatechange = function() {
|
||||
let haha = client.responseText.split(",");
|
||||
yield = haha[0]
|
||||
}
|
||||
client.open('GET', str, false);
|
||||
client.send();
|
||||
// let str = 'beamRate.py?A=' + A + '&Z=' + Z;
|
||||
// let client = new XMLHttpRequest();
|
||||
// client.onreadystatechange = function() {
|
||||
// let haha = client.responseText.split(",");
|
||||
// yield = haha[0]
|
||||
// }
|
||||
// client.open('GET', str, false);
|
||||
// client.send();
|
||||
// FRIB blocking the request....:(
|
||||
}
|
||||
|
||||
function GetMassFromSym(AZ, id){
|
||||
|
@ -189,7 +190,7 @@ function GetMass(){
|
|||
document.getElementById('heavySp').innerHTML = 'Sn: ' + heavy[4] + ' MeV, Sp: ' + heavy[5] + ' MeV, Sa : ' + heavy[6] + ' MeV';
|
||||
|
||||
//document.getElementById('beamSp').innerHTML = "haah";
|
||||
document.getElementById('beamYield').innerHTML = "FRIB ultimate yield : " + yield + " pps";
|
||||
//document.getElementById('beamYield').innerHTML = "FRIB ultimate yield : " + yield + " pps";
|
||||
//document.getElementById('n0').innerHTML = beam[0] + "," + beam[1] + "," + beam[2]
|
||||
//document.getElementById('n1').innerHTML = target[0] + "," + target[1] + "," + target[2]
|
||||
//document.getElementById('n2').innerHTML = light[0] + "," + light[1] + "," + light[2]
|
||||
|
|
|
@ -34,17 +34,28 @@ BField = form.getvalue('BField')
|
|||
posArray = form.getvalue('posArray')
|
||||
posRecoil = form.getvalue('posRecoil')
|
||||
|
||||
isDWBA = form.getvalue('DWBA');
|
||||
isDWBA = form.getvalue('DWBA')
|
||||
if isDWBA == "On" :
|
||||
isDWBA = True
|
||||
else:
|
||||
isDWBA = False
|
||||
|
||||
SSType = form.getvalue('SSType');
|
||||
onlyDWBA = form.getvalue('onlyDWBA')
|
||||
minAng = form.getvalue('minAng')
|
||||
maxAng = form.getvalue('maxAng')
|
||||
|
||||
ExList = form.getvalue('Ex');
|
||||
JpiList = form.getvalue('Jpi');
|
||||
OrbList = form.getvalue('Orb');
|
||||
if onlyDWBA == "On" :
|
||||
onlyDWBA = True
|
||||
isDWBA = True
|
||||
else :
|
||||
onlyDWBA = False
|
||||
|
||||
|
||||
SSType = form.getvalue('SSType')
|
||||
|
||||
ExList = form.getvalue('Ex')
|
||||
JpiList = form.getvalue('Jpi')
|
||||
OrbList = form.getvalue('Orb')
|
||||
|
||||
op1 = form.getvalue('op1')
|
||||
op2 = form.getvalue('op2')
|
||||
|
@ -216,7 +227,10 @@ haha=""
|
|||
|
||||
if isDWBA :
|
||||
|
||||
dwba_1 = subprocess.run(["../Cleopatra/InFileCreator", fn4, "0", "180", "0.1"] , stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
if onlyDWBA :
|
||||
dwba_1 = subprocess.run(["../Cleopatra/InFileCreator", fn4, minAng, maxAng, "0.1"] , stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
else :
|
||||
dwba_1 = subprocess.run(["../Cleopatra/InFileCreator", fn4, "0", "180", "0.1"] , stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
cmd = "../Cleopatra/ptolemy <%s.in> %s.out" % (fn4, fn4)
|
||||
outFile = fn4+ ".out"
|
||||
if os.path.exists(outFile):
|
||||
|
@ -239,17 +253,18 @@ if isDWBA :
|
|||
#if os.path.exists("transfer.root"):
|
||||
# os.remove("transfer.root");
|
||||
|
||||
if isDWBA :
|
||||
result = subprocess.run(["../Cleopatra/Transfer", fn1, fn2, dwbaExFile, dwbaRootFile, "transfer.root", "reaction.dat", "0"], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
else:
|
||||
result = subprocess.run(["../Cleopatra/Transfer", fn1, fn2, fnEx, "", "transfer.root", "reaction.dat", "0"], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
if onlyDWBA == False:
|
||||
|
||||
if isDWBA :
|
||||
result = subprocess.run(["../Cleopatra/Transfer", fn1, fn2, dwbaExFile, dwbaRootFile, "transfer.root", "reaction.dat", "0"], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
else:
|
||||
result = subprocess.run(["../Cleopatra/Transfer", fn1, fn2, fnEx, "", "transfer.root", "reaction.dat", "0"], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
|
||||
if fn5 =="":
|
||||
haha = subprocess.run(["../Cleopatra/PlotSimulation", "transfer.root"], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
else:
|
||||
haha = subprocess.run(["../Cleopatra/PlotSimulation", "transfer.root", fn5], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
pngName=haha.splitlines().pop()
|
||||
if fn5 =="":
|
||||
haha = subprocess.run(["../Cleopatra/PlotSimulation", "transfer.root"], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
else:
|
||||
haha = subprocess.run(["../Cleopatra/PlotSimulation", "transfer.root", fn5], stdout=subprocess.PIPE).stdout.decode('utf-8')
|
||||
pngName=haha.splitlines().pop()
|
||||
|
||||
|
||||
|
||||
|
@ -310,6 +325,7 @@ if pngName != "" :
|
|||
print ("<br> Download the <a href=\"files/%s\" download=\"%s\">Ex file</a>" % (fnEx, fnEx))
|
||||
print ("<br> Download the simulation <a href=\"files/transfer.root\" download=\"transfer.root\">root file</a>")
|
||||
|
||||
|
||||
if fn5 != "" :
|
||||
print ("<br> Downlaod the <a href=\"files/%s\" download=\"%s\">Plot Config file</a>" % (fn5, fn5))
|
||||
|
||||
|
|
|
@ -20,34 +20,34 @@
|
|||
|
||||
<h3>Reaction: </h3>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Beam Energy</td>
|
||||
<td><input type = "text" name = "KEA" size="6" value="10" /></td>
|
||||
<td style="text-align:left">MeV/u</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Beam </td>
|
||||
<td><input type = "text" name = "beam_AZ" size="6" value="16O"/></td>
|
||||
<td style="text-align:right">J<sup>π</sup></td>
|
||||
<td><input type = "text" id="beam_Jpi" name = "beam_Jpi" size="5" value="0+"/><td>
|
||||
<td style="text-align:right">Ex:</td>
|
||||
<td><input type = "text" name = "beam_Ex" size="6" value="0.00"/></td>
|
||||
<td style="text-align:left">MeV</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target</td>
|
||||
<td><input type = "text" name = "target_AZ" size="6" value="d"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Light recoil</td>
|
||||
<td><input type = "text" name = "lRecoil_AZ" size="6" value="p"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> Number of events </td>
|
||||
<td><input type = "text" name = "numEvent" size="6" value="100000"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Beam Energy</td>
|
||||
<td><input type = "text" name = "KEA" size="6" value="10" /></td>
|
||||
<td style="text-align:left">MeV/u</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Beam </td>
|
||||
<td><input type = "text" name = "beam_AZ" size="6" value="16O"/></td>
|
||||
<td style="text-align:right">J<sup>π</sup></td>
|
||||
<td><input type = "text" id="beam_Jpi" name = "beam_Jpi" size="5" value="0+"/><td>
|
||||
<td style="text-align:right">Ex:</td>
|
||||
<td><input type = "text" name = "beam_Ex" size="6" value="0.00"/></td>
|
||||
<td style="text-align:left">MeV</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target</td>
|
||||
<td><input type = "text" name = "target_AZ" size="6" value="d"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Light recoil</td>
|
||||
<td><input type = "text" name = "lRecoil_AZ" size="6" value="p"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> Number of events </td>
|
||||
<td><input type = "text" name = "numEvent" size="6" value="100000"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Detector:</h3>
|
||||
|
||||
|
@ -76,21 +76,21 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>DWBA and E<sub>x</sub> List:</h3>
|
||||
<h3>DWBA and E<sub>x</sub> List:</h3>
|
||||
|
||||
<p><b style="color:red;">For 2-nucleon transfer</b>, <b>Orbital</b> take the form NL=X, where N is number of node, X is momentum number. n and L are related by Σ<sub>i</sub> (2n<sub>i</sub>+l<sub>i</sub>) = 2N + X + 2n + l, where n<sub>i</sub> and l<sub>i</sub> are the principle number and orbital angular momentum of the each transfered nucleon, and n and l are the internal quanta of the 2-nucleon. e.g. (t,p) reaction to 0f orbtial, the left-hand side would be n<sub>i</sub> = 0 and l<sub>i</sub> = 3 and the sum is 3+3 = 6 = 2N + X + 2n+l. Assume n = l = 0, we have 6 = 2N+L. Thus, 3L=0, 2L=2,1L=4, 0L=6. </p>
|
||||
<p><b style="color:red;">For 2-nucleon transfer</b>, <b>Orbital</b> take the form NL=X, where N is number of node, X is momentum number. n and L are related by Σ<sub>i</sub> (2n<sub>i</sub>+l<sub>i</sub>) = 2N + X + 2n + l, where n<sub>i</sub> and l<sub>i</sub> are the principle number and orbital angular momentum of the each transfered nucleon, and n and l are the internal quanta of the 2-nucleon. e.g. (t,p) reaction to 0f orbtial, the left-hand side would be n<sub>i</sub> = 0 and l<sub>i</sub> = 3 and the sum is 3+3 = 6 = 2N + X + 2n+l. Assume n = l = 0, we have 6 = 2N+L. Thus, 3L=0, 2L=2,1L=4, 0L=6. </p>
|
||||
|
||||
TODO: guess the orbital
|
||||
<br>
|
||||
<input type="checkbox" id="pos" onclick="checkParity()" checked/>Positive parity</td>
|
||||
<input type="checkbox" id="neg" onclick="checkParity()" checked/>Negative parity</td>
|
||||
<input type="checkbox" id="unk" onclick="checkParity()" checked/>Unknown parity</td>
|
||||
<br>
|
||||
<button type="button" onclick="addStates()">Add known states</button>
|
||||
Isotope: <input type="text" id="AZ" size="5" value="17O"/>
|
||||
Max Ex: <input type="text" id="maxEx" size="5" value="5"/>MeV
|
||||
TODO: guess the orbital
|
||||
<br>
|
||||
<input type="checkbox" id="pos" onclick="checkParity()" checked/>Positive parity</td>
|
||||
<input type="checkbox" id="neg" onclick="checkParity()" checked/>Negative parity</td>
|
||||
<input type="checkbox" id="unk" onclick="checkParity()" checked/>Unknown parity</td>
|
||||
<br>
|
||||
<button type="button" onclick="addStates()">Add known states</button>
|
||||
Isotope: <input type="text" id="AZ" size="5" value="17O"/>
|
||||
Max Ex: <input type="text" id="maxEx" size="5" value="5"/>MeV
|
||||
|
||||
<p id='waiting'></p>
|
||||
<p id='waiting'></p>
|
||||
|
||||
<table id="ExTable">
|
||||
<tr>
|
||||
|
@ -181,7 +181,19 @@ Max Ex: <input type="text" id="maxEx" size="5" value="5"/>MeV
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<h3> Plot config:</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<input type="checkbox" name="onlyDWBA" value="On"/>Only DWBA and Don't Sim. Angle range (for only DWBA)
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Min [deg]: </td>
|
||||
<td><input type = "text" name = "minAng" size="6" value="0" /></td>
|
||||
<td>Max [deg]: </td>
|
||||
<td><input type = "text" name = "maxAng" size="6" value="90"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3> Plot config:</h3>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -207,10 +219,9 @@ Max Ex: <input type="text" id="maxEx" size="5" value="5"/>MeV
|
|||
<input type="checkbox" name="gate" value="loop<=1" checked/>Loop = 1<br>
|
||||
<input type="checkbox" name="gate" value="thetaCM>10" checked/> ThetaCM > 10 deg<br>
|
||||
|
||||
<p></p>
|
||||
|
||||
<p></p>
|
||||
|
||||
<input type = "submit" value = "Submit and Run Simulation" style="width:200px;height:60px;" formtarget="_blank"/>
|
||||
<input type = "submit" value = "Run DWBA and Simulation" style="width:200px;height:60px;" formtarget="_blank"/>
|
||||
</form>
|
||||
|
||||
<hr style="height:4px;background-color:#F7CF3C; border-style:none; border-width:none">
|
||||
|
|
Loading…
Reference in New Issue
Block a user