added miscCal.html

This commit is contained in:
Ryan@fsunuc 2022-12-11 00:07:35 -05:00
parent 13735a2622
commit b236aea862
6 changed files with 316 additions and 15 deletions

View File

@ -164,7 +164,8 @@ print ("Content-Type: text/html\r\n\r\n")
print ("<html>")
print ("<style> img {max-width: 100%} </style>")
print ("<style> body { font-family: courier, courier new, serif;} </style>")
print ("<style> a { color: #F7CF3C;} </style>")
#print ("<style> a { color: #F7CF3C;} </style>")
print ("<style> a { color: #1363A7;} </style>")
print ("<body>")
if dwbaPNG != "" :

View File

@ -27,7 +27,8 @@
float: left;
width : 400px;
height: 100vh;
background: #6DB33E;
//background: #6DB33E;
background: #1363A7;
padding: 0px;
}
article {
@ -35,8 +36,13 @@
padding: 0px;
margin-left: 400px;
height : 100vh;
background: #1363A7;
//background: #1363A7;
background: #6DB33E;
}
a {
color : #F7CF3C;
}
@media (max-width: 1000px) {
nav {
width: 100%;
@ -141,15 +147,23 @@
</table>
</form>
<p>
&nbsp; &nbsp; &nbsp; &nbsp; Simplfied Input : <a href="simpleSim.html" target="uploaded">Click Here.</a>
</p>
<p></p>
<table>
<tr>
<td style="text-align:right">Simplfied Input : </td>
<td><a href="simpleSim.html" target="uploaded">Click Here.</a></td>
</tr>
<tr>
<td style="text-align:right"> &nbsp;&nbsp;Misc. Calulations : </td>
<td><a href="miscCal.html" target="uploaded">Click Here.</a></td>
</tr>
<table>
<p></p><!-- ////////////////////////////////////////// -->
<form action = "get_nuclear_data.py" method = "POST" target = "NuclearData">
<table>
<tr>
<td style="text-align:right">Isotopes Name:</td>
<td style="text-align:right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Isotopes Name:</td>
<td><input type = "text" name = "isotopes_name" size="13" value="18O"/></td>
</tr>
<tr>

View File

@ -7,13 +7,15 @@
font-family: Arial, Helvetica, sans-serif;
}
a {
color : #F7CF3C;
//color : #F7CF3C;
color : #1363A7;
}
</style>
<h1>Intructions:</h1>
<p>
<ul>
<li>The easiest way is use the <a href="simpleSim.html" target="uploaded">Simplied Interface</a>
<li>The kenimatic calculation is documented in <a href="https://wiki.anl.gov/wiki_heliosdaq/images/3/3f/Kinematics_of_HELIOS.pdf" target="_blank" >Here</a>.</li>
<li>The DWBA calucation is using Ptolemy. <a href="https://www.phy.anl.gov/theory/research/ptolemy/" target="_blank">Here</a> for more detail. </li>
<li>File name can be customized.</li>

284
miscCal.html Normal file
View File

@ -0,0 +1,284 @@
<!DOCTYOE html>
<html>
<style>
body{
font-family: Arial, Helvetica, sans-serif;
}
table{
border-collapse: collapse;
border : 1px solid;
}
td{
padding : 4px;
}
</style>
<body>
<h1> enA, pnA, pps convertor </h1>
<table id="convertor">
<tr>
<td style="text-align:right">Charge state:</td>
<td><input type="text" id="ChargeState" size="10" value="6"/> </td>
</tr>
<tr>
<td style="text-align:right">Attenuation:</td>
<td><input type="text" id="att" size="10" value="1e+4"/> </td>
</tr>
<tr>
<td>enA </td>
<td>pnA </td>
<td>pps </td>
<td>att. pps </td>
</tr>
<tr>
<td><input type="text" id='enA' size="10"/></td>
<td><input type="text" id="pnA" size="10"/></td>
<td><input type="text" id="pps" size="10"/></td>
<td width="100"></td>
</tr>
</table>
<h1> Yield Calculator </h1>
<table id="yieldTable">
<tr>
<td style="text-align:right"> Integrated Xsec </td>
<td><Input type="text" id="Xsec" size="10" value="4"/></td>
<td>mb</td>
</tr>
<tr>
<td style="text-align:right"> Beam intensity </td>
<td><Input type="text" id="BeamPPS" size="10" value="1e5"/></td>
<td>pps</td>
</tr>
<tr>
<td style="text-align:right"> Target thickness </td>
<td><Input type="text" id="thickness" size="10" value="100"/></td>
<td>ug/cm2</td>
</tr>
<tr>
<td style="text-align:right"> Target molar mass </td>
<td><Input type="text" id="molar" size="10" value="16"/></td>
<td>g/mol</td>
</tr>
<tr>
<td style="text-align:right"> Nucleus/molecule </td>
<td><Input type="text" id="ddd" size="10" value="2"/></td>
</tr>
<tr>
<td style="text-align:right"> Num of nucleus per area </td>
<td></td>
<td>count/cm2</td>
</tr>
<tr>
<td style="text-align:right"> Yield per sec </td>
<td></td>
<td>count/sec</td>
</tr>
<tr>
<td style="text-align:right"> Spectroscopic factor </td>
<td><Input type="text" id="SF" size="10" value="0.6"/></td>
</tr>
<tr>
<td style="text-align:right"> Wanted Count </td>
<td><Input type="text" id="wantedCount" size="10" value="1000"/></td>
</tr>
<tr>
<td style="text-align:right"> stat. uncertainty </td>
<td></td>
<td>%</td>
</tr>
<tr>
<td style="text-align:right"> Beam Time required </td>
<td></td>
<td>day</td>
</tr>
</table>
</body>
<script>
function toSci(xx, digi){
//return xx.toExponential(digi).replace(/e\+?/, ' x 10^');
return xx.toExponential(digi);
}
function convert(type){
let chargeState = document.getElementById('ChargeState').value;
let attenuation = document.getElementById('att').value;
let eee = 6241510000;
let table = document.getElementById('convertor');
if ( type == 1 ){
let enA = document.getElementById('enA').value;
let pnA = enA/chargeState;
let pps = pnA*eee;
var att = pps/attenuation;
document.getElementById('pnA').value = pnA;
document.getElementById('pps').value = toSci(pps,3);
}
if ( type == 2 ){
let pnA = document.getElementById('pnA').value;
let enA = pnA*chargeState;
let pps = pnA*eee;
var att = pps/attenuation;
document.getElementById('enA').value = enA;
document.getElementById('pps').value = toSci(pps,3);
}
if ( type == 3 ){
let pps = document.getElementById('pps').value;
let pnA = pps/eee;
let enA = pnA*chargeState;
var att = pps/attenuation;
document.getElementById('enA').value = enA;
document.getElementById('pnA').value = pnA;
}
table.rows[3].cells[3].innerHTML = '<span style="color:#FF0000">' + toSci(att,3) + '</span>';
}
function yieldCal(type){
let NA = 6.0221409e+23;
let mb2cm = 1e-27;
let xsec = document.getElementById('Xsec').value;
let beamPPS = document.getElementById('BeamPPS').value;
let thickness = document.getElementById('thickness').value;
let molar = document.getElementById('molar').value;
let nParticle = document.getElementById('ddd').value;
let SF = document.getElementById('SF').value;
let wantedCount = document.getElementById('wantedCount').value;
let table = document.getElementById('yieldTable');
let nTarget = thickness * NA * nParticle / molar / 1e6;
let yield = xsec * beamPPS * nTarget * mb2cm;
table.rows[5].cells[1].innerHTML = toSci(nTarget, 3);
table.rows[6].cells[1].innerHTML = yield.toPrecision(4);
let error = Math.sqrt(wantedCount)/wantedCount*100;
table.rows[9].cells[1].innerHTML = error.toPrecision(4);
let day = wantedCount / SF /yield /60/60/24;
//table.rows[10].cells[1].innerHTML = day.toPrecision(4);
table.rows[10].cells[1].innerHTML = '<span style="color:#FF0000">' + day.toPrecision(4) + '</span>';
}
document.getElementById('enA').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
convert(1);
}
}, false
);
document.getElementById('pnA').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
convert(2);
}
}, false
);
document.getElementById('pps').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
convert(3);
}
}, false
);
document.getElementById('att').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
convert(1);
}
}, false
);
document.getElementById('ChargeState').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
convert(1);
}
}, false
);
document.getElementById('Xsec').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
yieldCal(0);
}
}, false
);
document.getElementById('BeamPPS').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
yieldCal(1);
}
}, false
);
document.getElementById('thickness').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
yieldCal(2);
}
}, false
);
document.getElementById('molar').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
yieldCal(3);
}
}, false
);
document.getElementById('ddd').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
yieldCal(4);
}
}, false
);
document.getElementById('SF').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
yieldCal(5);
}
}, false
);
document.getElementById('wantedCount').addEventListener('keypress',
function(e){
if(e.keyCode == 13){
yieldCal(6);
}
}, false
);
</script>
</html>

View File

@ -240,7 +240,8 @@ print ("Content-Type: text/html\r\n\r\n")
print ("<html>")
print ("<style> img {max-width: 100%} </style>")
print ("<style> body { font-family: courier, courier new, serif;} </style>")
print ("<style> a { color: #F7CF3C;} </style>")
#print ("<style> a { color: #F7CF3C;} </style>")
print ("<style> a { color: #1364A7;} </style>")
print ("<body>")
'''
@ -285,9 +286,10 @@ if pngName != "" :
print ("<br> Downlaod the simulation <a href=\"files/transfer.root\" download=\"transfer.root\">root file</a>")
print ("<br><br><br>#################################### programs text output")
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % dwba_1)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % dwba_3)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % dwba_4)
if isDWBA:
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % dwba_1)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % dwba_3)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % dwba_4)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % result)
print ("<br><span style=\"white-space: pre-line\"> %s </span>" % haha)
print ("</body>")

View File

@ -12,8 +12,6 @@
</style>
<h1> I am working on it. </h1>
<form action = "simpleInput.py" method = "POST" target = "uploaded">
<h3>Reaction:</h3>