Skip to content

Instantly share code, notes, and snippets.

@scopatz
Created March 3, 2015 16:55
Show Gist options
  • Select an option

  • Save scopatz/0caece99d6a540acc6fc to your computer and use it in GitHub Desktop.

Select an option

Save scopatz/0caece99d6a540acc6fc to your computer and use it in GitHub Desktop.
Co56-decay
{
"metadata": {
"name": "",
"signature": "sha256:d09425c8a20589f04c2b83ee13f52f67f1acd671f31bb9e75deccf668872eb11"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Decay 0.2 M\u2609 of Co-56\n",
"\n",
"This notebook demonstrates how to decay a material with pyne and compute electrons coming off of it. First, import pyne."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from pyne import data\n",
"from pyne import nucname\n",
"from pyne.material import Material"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"/home/scopatz/miniconda3/lib/python3.4/importlib/_bootstrap.py:321: QAWarning: pyne.data is not yet QA compliant.\n",
" return f(*args, **kwds)\n",
"/home/scopatz/miniconda3/lib/python3.4/importlib/_bootstrap.py:321: QAWarning: pyne.material is not yet QA compliant.\n",
" return f(*args, **kwds)\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"mat = Material({'Co56': 0.2}) # note that the value is mass-weighted and units are assigned by the user (M\u2609 here)\n",
"print(mat)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Material:\n",
"mass = 0.2\n",
"density = -1.0\n",
"atoms per molecule = -1.0\n",
"-------------------------\n",
"Co56 1.0\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Let's now decay this material for some time t, in seconds"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"t = 365.25 * 24 * 3600\n",
"res = mat.decay(t)\n",
"print(res)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Material:\n",
"mass = 0.19998313326141906\n",
"density = -1.0\n",
"atoms per molecule = 1.0\n",
"--------------------------\n",
"Fe56 0.9622895541676433\n",
"Co56 0.037710445832356755\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Now, if we want to find the gammas associated with the decayed material..."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"for nuc in res:\n",
" for kev, err in data.gamma_energy(nuc):\n",
" print(nucname.name(nuc), kev)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Co56 263.434\n",
"Co56 411.145\n",
"Co56 486.55\n",
"Co56 655.003\n",
"Co56 674.57\n",
"Co56 733.514\n",
"Co56 787.743\n",
"Co56 846.77\n",
"Co56 852.732\n",
"Co56 896.51\n",
"Co56 977.372\n",
"Co56 996.948\n",
"Co56 1037.843\n",
"Co56 1088.894\n",
"Co56 1140.368\n",
"Co56 1159.944\n",
"Co56 1175.101\n",
"Co56 1198.888\n",
"Co56 1238.288\n",
"Co56 1271.92\n",
"Co56 1335.4\n",
"Co56 1360.212\n",
"Co56 1442.746\n",
"Co56 1462.322\n",
"Co56 1640.475\n",
"Co56 1771.357\n",
"Co56 1810.757\n",
"Co56 1963.741\n",
"Co56 2015.215\n",
"Co56 2034.791\n",
"Co56 2113.135\n",
"Co56 2212.944\n",
"Co56 2276.131\n",
"Co56 2373.24\n",
"Co56 2523.09\n",
"Co56 2598.5\n",
"Co56 2657.527\n",
"Co56 3009.645\n",
"Co56 3202.029\n",
"Co56 3253.503\n",
"Co56 3273.079\n",
"Co56 3369.86\n",
"Co56 3451.232\n",
"Co56 3548.05\n",
"Co56 3600.8\n",
"Co56 3611.53\n"
]
}
],
"prompt_number": 4
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment