trapping/notebooks/cross-sections.ipynb

92 lines
2.1 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-08T18:49+0000",
"start_time": "2018-04-08T18:49+0000"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Added jar: [commons-math3-3.6.1.jar]\n",
"Added jar: [trapping-dev.jar]\n"
]
}
],
"source": [
"%classpath add jar ../build/install/trapping/lib/commons-math3-3.6.1.jar\n",
"%classpath add jar ../build/install/trapping/lib/trapping-dev.jar"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-08T18:58+0000",
"start_time": "2018-04-08T18:58+0000"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "30d035de-65b2-4c03-96c6-25b897f10de4",
"version_major": 2,
"version_minor": 0
},
"method": "display_data"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def scatter = inr.numass.trapping.Scatter.INSTANCE\n",
"\n",
"def e = (1..20) // energy in keV\n",
"\n",
"def factor = 1e-22\n",
"def sigmaEl = e.collect{scatter.sigmael(it*1000)/factor}\n",
"def sigmaIon = e.collect{scatter.sigmaion(it*1000)/factor}\n",
"def sigmaExc = e.collect{scatter.sigmaexc(it*1000)/factor}\n",
"\n",
"def plot = new Plot(logY: true, yLogBase: 10)\n",
"plot << new Line(x: e, y: sigmaEl, displayName: \"Elastic\")\n",
"plot << new Line(x: e, y: sigmaIon, displayName: \"Ionization\")\n",
"plot << new Line(x: e, y: sigmaExc, displayName: \"Excitation\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Groovy",
"language": "groovy",
"name": "groovy"
},
"language_info": {
"codemirror_mode": "groovy",
"file_extension": ".groovy",
"mimetype": "",
"name": "Groovy",
"nbconverter_exporter": "",
"version": "2.4.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}