19 KiB
19 KiB
In [1]:
%classpath add jar ../build/install/trapping/lib/commons-math3-3.6.1.jar %classpath add jar ../build/install/trapping/lib/trapping-dev.jar
In [5]:
scatter = inr.numass.trapping.Scatter.INSTANCE def e = (1..20) // energy in keV factor = 1e-22 sigmaEl = e.collect{scatter.sigmael(it*1000)/factor} sigmaIon = e.collect{scatter.sigmaion(it*1000)/factor} sigmaExc = e.collect{scatter.sigmaexc(it*1000)/factor} def plot = new Plot(logY: true, yLogBase: 10) plot << new Line(x: e, y: sigmaEl, displayName: "Elastic") plot << new Line(x: e, y: sigmaIon, displayName: "Ionization") plot << new Line(x: e, y: sigmaExc, displayName: "Excitation")
In [4]:
println "E(keV)\telastic\tion\texc" for(d = 12.0; d < 18.6; d += 0.1){ def sigmaEl = scatter.sigmael(d*1000)/factor def sigmaIon = scatter.sigmaion(d*1000)/factor def sigmaExc = scatter.sigmaexc(d*1000)/factor println "$d\t$sigmaEl\t$sigmaIon\t$sigmaExc" }
E(keV) elastic ion exc 12.0 0.43948540252301355 2.7362696996880764 2.2754271467658227 12.1 0.4360219815420227 2.716347129996631 2.259247553470829 12.2 0.4326153394877464 2.6967291910800784 2.2433117665045716 12.3 0.42926409223681455 2.6774088086825643 2.227614186457129 12.4 0.42596690029168804 2.6583791281775273 2.212149386181278 12.5 0.4227224669965498 2.639633506055748 2.1969121041685504 12.6 0.41952953683810995 2.621165501807934 2.1818972382301722 12.7 0.4163868938266485 2.602968870180603 2.1670998394665926 12.8 0.4132933599529065 2.585037553785318 2.1525151065102723 12.9 0.4102477937167139 2.567365676042546 2.138138380027344 13.0 0.4072490887234942 2.5499475344425586 2.123965137464613 13.1 0.4042961723450181 2.532777594106803 2.1099909880291814 13.2 0.40138800444100226 2.515850481634202 2.096211667888705 13.3 0.3985235761383543 2.4991609792177183 2.082623035581028 13.4 0.3957019086650494 2.4827040190174023 2.069221067622563 13.5 0.39292205223581 2.466474677776929 2.0560018543054204 13.6 0.39018308498692494 2.4504681716713828 2.042961595673853 13.7 0.3874841119576961 2.434679851374739 2.0300965976711156 13.8 0.3848242641161482 2.419105197336177 2.0174032684483527 13.9 0.3822026974267757 2.403739815254919 2.00487811482759 14.0 0.3796185919582249 2.3885794317439313 1.9925177389113418 14.1 0.3770711510289289 2.373619890173301 1.9803188348317768 14.2 0.3745596003888268 2.358857146684646 1.9682781856327505 14.3 0.3720831874354002 2.3442872663683785 1.9563926602783916 14.4 0.36964118046236066 2.32990641959609 1.9446592107822769 14.5 0.36723286793941123 2.315710878500726 1.9330748694515214 14.6 0.3648575578215951 2.3016970135976464 1.9216367462404509 14.7 0.36251457688682004 2.287861290540006 1.910342026208781 14.8 0.3602032701002296 2.274200267002247 1.8991879670794969 14.9 0.357923000004158 2.26071058968582 1.8881718968918926 15.0 0.3556731461324769 2.2473889914415754 1.8772912117454528 15.1 0.353453104448203 2.234232288503513 1.8665433736304802 15.2 0.35126228680329497 2.221237377828907 1.8559259083415982 15.3 0.3491001204196282 2.2084012345400286 1.845436403470438 15.4 0.3469660473901797 2.1957209094629615 1.835072506474014 15.5 0.3448595241995173 2.1831935267592297 1.824831922815469 15.6 0.3427800212627204 2.170816281646157 1.8147124141740314 15.7 0.34072702248191666 2.158586438202101 1.8047117967211865 15.8 0.33870002481965195 2.1465013272528792 1.7948279394602165 15.9 0.3366985378883526 2.134558344335901 1.7850587626263867 16.0 0.33472208355517563 2.122754947738674 1.7754022361452126 16.1 0.33277019556158083 2.111088656608532 1.7658563781463463 16.2 0.33084241915698676 2.0995570491305764 1.7564192535307461 16.3 0.32893831074590485 2.0881577607709536 1.7470889725889123 16.4 0.3270574375479805 2.0768884825827687 1.7378636896680617 16.5 0.3251993772703896 2.0657469595720115 1.7287416018862318 16.6 0.32336371779207285 2.054730989121034 1.7197209478913829 16.7 0.3215500568593091 2.043838419467228 1.7108000066636726 16.8 0.31975800179215863 2.0330671482346325 1.7019770963591483 16.9 0.3179871692013229 2.022415121016355 1.693250573193194 17.0 0.3162371847149949 2.011880330005736 1.684618830362136 17.1 0.3145076827152896 2.0014608126743285 1.6760802970014965 17.2 0.31279830608386505 1.991154650494809 1.6676334371794341 17.3 0.31110870595636253 1.9809599677070577 1.6592767489239986 17.4 0.3094385414853119 1.9708749301257074 1.6510087632828718 17.5 0.3077874796111622 1.9608977439875288 1.6428280434143254 17.6 0.30615519484111486 1.9510266548371218 1.6347331837082066 17.7 0.3045413690354524 1.9412599464494087 1.6267228089357717 17.8 0.3029456912010658 1.9315959397875393 1.6187955734272899 17.9 0.3013678572919011 1.9220329919948316 1.6109501602763423 18.0 0.29980757001605496 1.9125694954194674 1.603185280569817 18.1 0.29826453864926233 1.9032038766707016 1.5954996726426307 18.2 0.29673847885453164 1.8939345957053948 1.5878921013562524 18.3 0.29522911250768985 1.8847601449437406 1.5803613574001418 18.4 0.2937361675286164 1.8756790484131034 1.5729062566152603 18.5 0.2922593777179467 1.866689860918917 1.565525639338836
Out[4]:
null
In [21]:
import com.twosigma.beakerx.table.* def list = [] for(d = 12.0; d < 18.6; d += 0.1){ list << [ "x": d, "el": scatter.sigmael(d*1000)/factor, "ion": scatter.sigmaion(d*1000)/factor, "exc": scatter.sigmaexc(d*1000)/factor ] } beakerx["table"] = new TableDisplay(list) list
In [23]:
%%python from beakerx.object import beakerx import pandas as pd beakerx.table
Out[23]:
[{'x': 12.0, 'el': 0.43948540252301355, 'ion': 2.7362696996880764, 'exc': 2.2754271467658227}, {'x': 12.1, 'el': 0.4360219815420227, 'ion': 2.716347129996631, 'exc': 2.259247553470829}, {'x': 12.2, 'el': 0.4326153394877464, 'ion': 2.6967291910800784, 'exc': 2.2433117665045716}, {'x': 12.3, 'el': 0.42926409223681455, 'ion': 2.6774088086825643, 'exc': 2.227614186457129}, {'x': 12.4, 'el': 0.42596690029168804, 'ion': 2.6583791281775273, 'exc': 2.212149386181278}, {'x': 12.5, 'el': 0.4227224669965498, 'ion': 2.639633506055748, 'exc': 2.1969121041685504}, {'x': 12.6, 'el': 0.41952953683810995, 'ion': 2.621165501807934, 'exc': 2.1818972382301722}, {'x': 12.7, 'el': 0.4163868938266485, 'ion': 2.602968870180603, 'exc': 2.1670998394665926}, {'x': 12.8, 'el': 0.4132933599529065, 'ion': 2.585037553785318, 'exc': 2.1525151065102723}, {'x': 12.9, 'el': 0.4102477937167139, 'ion': 2.567365676042546, 'exc': 2.138138380027344}, {'x': 13.0, 'el': 0.4072490887234942, 'ion': 2.5499475344425586, 'exc': 2.123965137464613}, {'x': 13.1, 'el': 0.4042961723450181, 'ion': 2.532777594106803, 'exc': 2.1099909880291814}, {'x': 13.2, 'el': 0.40138800444100226, 'ion': 2.515850481634202, 'exc': 2.096211667888705}, {'x': 13.3, 'el': 0.3985235761383543, 'ion': 2.4991609792177183, 'exc': 2.082623035581028}, {'x': 13.4, 'el': 0.3957019086650494, 'ion': 2.4827040190174023, 'exc': 2.069221067622563}, {'x': 13.5, 'el': 0.39292205223581, 'ion': 2.466474677776929, 'exc': 2.0560018543054204}, {'x': 13.6, 'el': 0.39018308498692494, 'ion': 2.4504681716713828, 'exc': 2.042961595673853}, {'x': 13.7, 'el': 0.3874841119576961, 'ion': 2.434679851374739, 'exc': 2.0300965976711156}, {'x': 13.8, 'el': 0.3848242641161482, 'ion': 2.419105197336177, 'exc': 2.0174032684483527}, {'x': 13.9, 'el': 0.3822026974267757, 'ion': 2.403739815254919, 'exc': 2.00487811482759}, {'x': 14.0, 'el': 0.3796185919582249, 'ion': 2.3885794317439313, 'exc': 1.9925177389113418}, {'x': 14.1, 'el': 0.3770711510289289, 'ion': 2.373619890173301, 'exc': 1.9803188348317768}, {'x': 14.2, 'el': 0.3745596003888268, 'ion': 2.358857146684646, 'exc': 1.9682781856327505}, {'x': 14.3, 'el': 0.3720831874354002, 'ion': 2.3442872663683785, 'exc': 1.9563926602783916}, {'x': 14.4, 'el': 0.36964118046236066, 'ion': 2.32990641959609, 'exc': 1.9446592107822769}, {'x': 14.5, 'el': 0.36723286793941123, 'ion': 2.315710878500726, 'exc': 1.9330748694515214}, {'x': 14.6, 'el': 0.3648575578215951, 'ion': 2.3016970135976464, 'exc': 1.9216367462404509}, {'x': 14.7, 'el': 0.36251457688682004, 'ion': 2.287861290540006, 'exc': 1.910342026208781}, {'x': 14.8, 'el': 0.3602032701002296, 'ion': 2.274200267002247, 'exc': 1.8991879670794969}, {'x': 14.9, 'el': 0.357923000004158, 'ion': 2.26071058968582, 'exc': 1.8881718968918926}, {'x': 15.0, 'el': 0.3556731461324769, 'ion': 2.2473889914415754, 'exc': 1.8772912117454528}, {'x': 15.1, 'el': 0.353453104448203, 'ion': 2.234232288503513, 'exc': 1.8665433736304802}, {'x': 15.2, 'el': 0.35126228680329497, 'ion': 2.221237377828907, 'exc': 1.8559259083415982}, {'x': 15.3, 'el': 0.3491001204196282, 'ion': 2.2084012345400286, 'exc': 1.845436403470438}, {'x': 15.4, 'el': 0.3469660473901797, 'ion': 2.1957209094629615, 'exc': 1.835072506474014}, {'x': 15.5, 'el': 0.3448595241995173, 'ion': 2.1831935267592297, 'exc': 1.824831922815469}, {'x': 15.6, 'el': 0.3427800212627204, 'ion': 2.170816281646157, 'exc': 1.8147124141740314}, {'x': 15.7, 'el': 0.34072702248191666, 'ion': 2.158586438202101, 'exc': 1.8047117967211865}, {'x': 15.8, 'el': 0.33870002481965195, 'ion': 2.1465013272528792, 'exc': 1.7948279394602165}, {'x': 15.9, 'el': 0.3366985378883526, 'ion': 2.134558344335901, 'exc': 1.7850587626263867}, {'x': 16.0, 'el': 0.33472208355517563, 'ion': 2.122754947738674, 'exc': 1.7754022361452126}, {'x': 16.1, 'el': 0.33277019556158083, 'ion': 2.111088656608532, 'exc': 1.7658563781463463}, {'x': 16.2, 'el': 0.33084241915698676, 'ion': 2.0995570491305764, 'exc': 1.7564192535307461}, {'x': 16.3, 'el': 0.32893831074590485, 'ion': 2.0881577607709536, 'exc': 1.7470889725889123}, {'x': 16.4, 'el': 0.3270574375479805, 'ion': 2.0768884825827687, 'exc': 1.7378636896680617}, {'x': 16.5, 'el': 0.3251993772703896, 'ion': 2.0657469595720115, 'exc': 1.7287416018862318}, {'x': 16.6, 'el': 0.32336371779207285, 'ion': 2.054730989121034, 'exc': 1.7197209478913829}, {'x': 16.7, 'el': 0.3215500568593091, 'ion': 2.043838419467228, 'exc': 1.7108000066636726}, {'x': 16.8, 'el': 0.31975800179215863, 'ion': 2.0330671482346325, 'exc': 1.7019770963591483}, {'x': 16.9, 'el': 0.3179871692013229, 'ion': 2.022415121016355, 'exc': 1.693250573193194}, {'x': 17.0, 'el': 0.3162371847149949, 'ion': 2.011880330005736, 'exc': 1.684618830362136}, {'x': 17.1, 'el': 0.3145076827152896, 'ion': 2.0014608126743285, 'exc': 1.6760802970014965}, {'x': 17.2, 'el': 0.31279830608386505, 'ion': 1.991154650494809, 'exc': 1.6676334371794341}, {'x': 17.3, 'el': 0.31110870595636253, 'ion': 1.9809599677070577, 'exc': 1.6592767489239986}, {'x': 17.4, 'el': 0.3094385414853119, 'ion': 1.9708749301257074, 'exc': 1.6510087632828718}, {'x': 17.5, 'el': 0.3077874796111622, 'ion': 1.9608977439875288, 'exc': 1.6428280434143254}, {'x': 17.6, 'el': 0.30615519484111486, 'ion': 1.9510266548371218, 'exc': 1.6347331837082066}, {'x': 17.7, 'el': 0.3045413690354524, 'ion': 1.9412599464494087, 'exc': 1.6267228089357717}, {'x': 17.8, 'el': 0.3029456912010658, 'ion': 1.9315959397875393, 'exc': 1.6187955734272899}, {'x': 17.9, 'el': 0.3013678572919011, 'ion': 1.9220329919948316, 'exc': 1.6109501602763423}, {'x': 18.0, 'el': 0.29980757001605496, 'ion': 1.9125694954194674, 'exc': 1.603185280569817}, {'x': 18.1, 'el': 0.29826453864926233, 'ion': 1.9032038766707016, 'exc': 1.5954996726426307}, {'x': 18.2, 'el': 0.29673847885453164, 'ion': 1.8939345957053948, 'exc': 1.5878921013562524}, {'x': 18.3, 'el': 0.29522911250768985, 'ion': 1.8847601449437406, 'exc': 1.5803613574001418}, {'x': 18.4, 'el': 0.2937361675286164, 'ion': 1.8756790484131034, 'exc': 1.5729062566152603}, {'x': 18.5, 'el': 0.2922593777179467, 'ion': 1.866689860918917, 'exc': 1.565525639338836}]
In [ ]: