Files
beta_shape_pnpi/notebooks/decay_paceENSDF.ipynb
T
unzhakov 33ed4f7e44 fix: satisfy mypy strict type-checking requirements
- Add proper type annotations to all source files
- Fix return types for numpy operations (np.asarray with dtype=np.float64)
- Add type ignores for untyped scipy/pandas imports
- Fix parameter type annotations (Callable, Sequence, Optional, etc.)
- Add TYPE_CHECKING imports for forward references
- Fix fitter.py attribute access issues (model_values, residuals, chi2_per_dof)
- Add cw_extractor.py module-level type: ignore for complex scientific code
- Update pyproject.toml to exclude notebooks from mypy
- Run black and ruff for formatting and linting
2026-05-03 00:44:11 +03:00

1144 lines
32 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# paceENSDF methods for accessing ENSDF radioactive-decay data sets\n",
"\n",
"Import the Python package `paceENSDF` and load the JSON-formatted ENSDF-decay data sets to a list object."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import paceENSDF as pe\n",
"e = pe.ENSDF()\n",
"edata = e.load_ensdf()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Find all radioactive-decay data pairs in ENSDF\n",
"\n",
"Explore the available data sets and radioactive-decay data pairs, and associated meta data, using the `ensdf_pairs` method."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# Find all radioactive-decay pairs in ENSDF\n",
"alpha_pairs = e.ensdf_pairs(edata,\"A\")\n",
"bm_pairs = e.ensdf_pairs(edata,\"BM\")\n",
"ecbp_pairs = e.ensdf_pairs(edata,\"ECBP\")\n",
"for k,v, in ecbp_pairs.items(): print(k,v)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot the nuclear chart relevant to the decay data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Gather the Z, A information from each decay-mode dictionary\n",
"\n",
"# Alpha decay\n",
"Z_A = [k[1] for (k,v) in alpha_pairs.items()]\n",
"A_A = [k[2] for (k,v) in alpha_pairs.items()]\n",
"\n",
"# Beta-minus decay\n",
"Z_BM = [k[1] for (k,v) in bm_pairs.items()]\n",
"A_BM = [k[2] for (k,v) in bm_pairs.items()]\n",
"\n",
"# Electron-capture/beta-plus decay\n",
"Z_ECBP = [k[1] for (k,v) in ecbp_pairs.items()]\n",
"A_ECBP = [k[2] for (k,v) in ecbp_pairs.items()]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib notebook\n",
"fig, ax = plt.subplots(figsize=(9,6))\n",
"\n",
"ax.scatter(np.array(A_A), np.array(Z_A), color='y', marker='s', alpha=0.5, label=r'$\\alpha$')\n",
"ax.scatter(np.array(A_BM), np.array(Z_BM), color='r', marker='s', alpha=0.10, label=r'$\\beta^{-}$')\n",
"ax.scatter(np.array(A_ECBP), np.array(Z_ECBP), color='b', marker='s', alpha=0.10, label=r'$\\epsilon/\\beta^{+}$')\n",
"\n",
"ax.set_xlabel(r'$A$', size=20)\n",
"ax.set_ylabel(r'$Z$', size=20)\n",
"ax.tick_params(axis='both', which='major', labelsize=15)\n",
"ax.legend(loc='best', fontsize=20)\n",
"\n",
"plt.tight_layout()\n",
"plt.savefig(\"decay_nuclides.png\", dpi=fig.dpi)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## pyENSDF: Manipulation of all primary- and continuation-record data from ENSDF\n",
"\n",
"pyENSDF modules contain methods to access all data from:\n",
"\n",
"* `Parent` record\n",
"* `Normalization` record\n",
"* `Level` record (+ continuation)\n",
"* `Gamma` record (+ continuation)\n",
"* `Beta-minus` record (+ continuation)\n",
"* `Electron-capture/beta-plus` record (+ continuation)\n",
"* `Alpha` record\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Parent isotope properties\n",
"\n",
"Methods associated with the properties of the parent isotope\n",
"\n",
"#### (i) Find all isomeric parent isotopes in the ENSDF database associated with a particular decay mode\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.find_all_parent_isomers)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all alpha-decay isomers\n",
"e.find_all_parent_isomers(edata, mode=\"A\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all beta-minus-decay isomers\n",
"e.find_all_parent_isomers(edata, mode=\"BM\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all electron-capture/beta-plus-decay isomers\n",
"e.find_all_parent_isomers(edata, mode=\"ECBP\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (ii) Find all parents with multiple spin-parity permutations for a given decay mode\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.find_parents_multiple_jpi)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all alpha-decay parents with multiple JPi\n",
"e.find_parents_multiple_jpi(edata, mode=\"A\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all beta-minus-decay parents with multiple JPi\n",
"e.find_parents_multiple_jpi(edata, mode=\"BM\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all electron-capture/beta-plus-decay parents with multiple JPi\n",
"e.find_parents_multiple_jpi(edata, mode=\"ECBP\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (iii) Decay-level energy and Q-value for given parent and defined decay mode and index\n",
"\n",
"NB: Ground-state decays have index 0; isomeric decays have index $\\geq1$.\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_parent_decay)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 173Ir ground-state alpha decay\n",
"e.get_parent_decay(edata, \"Ir173\", 0, mode=\"A\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 102Tc isomer beta-minus decay\n",
"e.get_parent_decay(edata, \"Tc102\", 1, mode=\"BM\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 50V ground-state electron-capture/beta-plus decay\n",
"#e.get_parent_decay(edata, \"V50\", 0, mode=\"ECBP\")\n",
"e.get_parent_decay(edata, \"Dy155\", 0, mode=\"ECBP\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (iv) Get the parent halflife for a defined isotope, decay mode and index\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_parent_halflife)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Beta-minus ground-state decay of 60Co parent (T1/2 in best units)\n",
"e.get_parent_halflife(edata, \"Co60\", 0, mode=\"BM\", units=\"seconds\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Beta-minus isomer decay of 60Co parent (T1/w in best units)\n",
"e.get_parent_halflife(edata, \"Co60\", 1, mode=\"BM\", units=\"best\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Beta-minus isomer decay of 60Co parent (T1/w in seconds units)\n",
"e.get_parent_halflife(edata, \"Co60\", 1, mode=\"BM\", units=\"seconds\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (v) Get spin and parity of a given parent isotope for a defined decay mode and index\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_parent_jpi)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 258Db ground state electron-capture/beta-plus decay (parent with two JPi values)\n",
"#e.get_parent_jpi(edata, \"Db258\", 0, mode=\"ECBP\")\n",
"e.get_parent_jpi(edata, \"Dy155\", 0, mode=\"ECBP\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 60Co isomer beta-minus decay (parent with single JPi value)\n",
"e.get_parent_jpi(edata, \"Co60\", 1, mode=\"BM\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 60Co ground state beta-minus decay (parent with single JPi value)\n",
"e.get_parent_jpi(edata, \"Co60\", 0, mode=\"BM\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Normalization and Production Normalization records\n",
"\n",
"Refer to the docstrings for more information regarding the returned qauntities:\n",
"\n",
"```python\n",
">>> help(e.norm_record)\n",
">>> help(e.prod_norm_record)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Normalization record for 60Co (g.s.)\n",
"#e.norm_record(edata, \"Co60\", 0, mode=\"BM\")\n",
"e.norm_record(edata, \"Dy155\", 0, mode=\"ECBP\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Production Normalization record for 60Co (g.s.)\n",
"#e.prod_norm_record(edata, \"Co60\", 0, mode=\"BM\")\n",
"e.prod_norm_record(edata, \"Dy155\", 0, mode=\"ECBP\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Decay scheme levels and gammas\n",
"\n",
"Methods for accessing the levels and gammas, together with their associated properties, populated in the daughter nucleus following radioactive decay.\n",
"\n",
"The following keyword arguments are accepted and passed to callables requiring the radioactive-decay mode:\n",
"\n",
"```Bash\n",
"mode = \"A\" # alpha decay\n",
"mode = \"BM\" # beta-minus decay\n",
"mode = \"ECBP\" # electron-capture/beta-plus decay\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (i) Decay scheme of daughter nucleus populated in decay\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_levels)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Levels populated in daughter nucleus following radioactive decay\n",
"#e.get_levels(edata,\"Ra226\",0,mode=\"A\" )\n",
"e.get_levels(edata,\"Dy155\",0,mode=\"ECBP\" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (ii) Find all levels of a particular nucleus with unique spin-parity assignments\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.find_unique_jpi)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# For the levels with unique JPi assignments\n",
"#e.find_unique_jpi(edata, \"Ar45\", 0, mode=\"BM\")\n",
"e.find_unique_jpi(edata, \"Dy155\", 0, mode=\"ECBP\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (iii) Find all levels of a particular nucleus with unique spin-parity assignments\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.find_multiple_jpi)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find the levels that have multiple JPi assignments\n",
"levels = e.find_multiple_jpi(edata, \"Dy155\", 0, mode=\"ECBP\")\n",
"for k,v in levels.items():\n",
" print(\"Parent = {0} ({1} keV); Daughter = {2}\".format(k[0],k[4],k[5]))\n",
" for vv in v:\n",
" print(\"index = {0}; energy = {1} \\xb1 {2} keV; J = {3}; Pi = {4}\".\n",
" format(vv[0],vv[1],vv[2],vv[5],vv[6]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (iv) Find all isomeric levels populated in the daughter nucleus\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.find_isomers)\n",
"```\n",
"The halflife information is returned in its 'best' units or in units of 'seconds' depending on the keyword argument:\n",
"\n",
"```Bash\n",
"units = \"best\"\n",
"units = \"seconds\"\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all isomers in daughter nucleus following radioactive decay ('best' or 's' units for halflife)\n",
"isomers = e.find_isomers(edata, \"Dy155\", 0, mode=\"ECBP\", units=\"best\")\n",
"for k,v in isomers.items():\n",
" print(\"Parent = {0} ({1} keV); Daughter = {2}\".format(k[0],k[4],k[5]))\n",
" for vv in v: \n",
" print(\"index = {0}; energy = {1} \\xb1 {2} keV; T1/2 = {3} \\xb1 {4} {5}\".\n",
" format(vv[0], vv[1], vv[2], vv[3], vv[4], vv[5]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (v) Get all levels, gammas, and associated properties of the daughter nucleus\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_levels_and_gammas)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# Levels and gammas associated with daughter following radioactive decay\n",
"lg = e.get_levels_and_gammas(edata,\"Dy155\",0,mode=\"ECBP\")\n",
"#for i in lg: print(i)\n",
"print(\"Transition: {0} -> {1}; {2} keV -> {3} keV\".format(lg[0][0],lg[0][1],lg[0][2],lg[0][3]))\n",
"print(\"Gamma-ray energy: {0} \\xb1 {1} keV\".format(lg[0][6],lg[0][7]))\n",
"print(\"Gamma-ray multipolarity: {0}\".format(lg[0][10]))\n",
"print(\"Gamma-ray mixing ratio: {0} \\xb1 {1}\".format(lg[0][11],lg[0][12]))\n",
"print(\"Raw gamma-ray intensity: {0} \\xb1 {1}\".format(lg[0][8],lg[0][9]))\n",
"print(\"Total ICC: {0}\".format(lg[0][14]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Atomic subshell information can also be retrieved by passing one of the following keyword arguments to the `get_levels_and_gammas_subshells` method:\n",
"\n",
"```Bash\n",
"subshell = 'calc'\n",
"subshell = 'sumcalc'\n",
"subshell = 'ratio'\n",
"subshell = 'expt'\n",
"subshell = 'electron'\n",
"```\n",
"\n",
"Refer to the docstrings for more information: \n",
"\n",
"```python\n",
">>> help(e.get_levels_and_gammas_subshells)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# Level and gamma-decay information as before, with additional information for the calculated atomic \n",
"# subshell internal conversion coefficients (K to Q shell)\n",
"lgs = e.get_levels_and_gammas_subshells(edata,\"Dy155\",0,mode=\"ECBP\",subshell='calc')\n",
"#for i in lgs: print(i)\n",
"print(\"Gamma-ray energy: {0} \\xb1 {1} keV\".format(lgs[0][6],lgs[0][7]))\n",
"print(\"Total ICC: {0}\".format(lgs[0][14]))\n",
"print(\"K-shell ICC: {0} \\xb1 {1}\".format(lgs[0][16],lgs[0][17]))\n",
"print(\"L-shell ICC: {0} \\xb1 {1}\".format(lgs[0][18],lgs[0][19]))\n",
"print(\"M-shell ICC: {0} \\xb1 {1}\".format(lgs[0][20],lgs[0][21]))\n",
"print(\"N-shell ICC: {0} \\xb1 {1}\".format(lgs[0][22],lgs[0][23]))\n",
"print(\"O-shell ICC: {0} \\xb1 {1}\".format(lgs[0][24],lgs[0][25]))\n",
"print(\"P-shell ICC: {0} \\xb1 {1}\".format(lgs[0][26],lgs[0][27]))\n",
"print(\"Q-shell ICC: {0} \\xb1 {1}\".format(lgs[0][28],lgs[0][29]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## $\\beta^{-}$-decay properties"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (i) Get $\\beta^{-}$-decay information to all states populated in the decay\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_beta_minus)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Properties of states observed following beta-minus decay of 60Co ground state (best halflife units):\n",
"x=e.get_beta_minus(edata, \"Co60\", 0, units='best')\n",
"print(x)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Properties of states observed following beta-minus decay of 60Co ground state (seconds halflife units):\n",
"x=e.get_beta_minus(edata, \"Co60\", 0, units='seconds')\n",
"print(x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (ii) Get log(ft) values from $\\beta^{-}$ decay or $\\epsilon/\\beta^{+}$ decay\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_logft)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Retrieve log(ft) data following beta-minus decay of 60Co g.s.\n",
"e.get_logft(edata,\"Co60\",0,mode='BM')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Retrieve log(ft) data following electron-capture/beta-plus decay of 86Y g.s.\n",
"e.get_logft(edata,\"Y86\",0,mode='ECBP')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (iii) Find nuclides of a given forbiddenness in $\\beta^{-}$ decay and $\\epsilon/\\beta^{+}$ decay\n",
"\n",
"The forbiddenness classification needs to be passed as a string argument in these functions:\n",
"\n",
"```Bash\n",
"'0A': Allowed (S=0)\n",
"'1A' : Allowed (S=1)\n",
"'1F': First forbidden\n",
"'1UF': First-forbidden unique\n",
"'2F': Second forbidden\n",
"'2UF': Second-forbidden unique\n",
"'3F': Third forbidden\n",
"'3UF': Third-forbidden unique\n",
"'4F': Fourth forbidden\n",
"'4UF': Fourth-forbidden unique\n",
"'5F': Fifth forbidden\n",
"'5UF': Fifth-forbidden unique\n",
"```\n",
"\n",
"The callable `find_forbidden` takes either three arguments to scan the entire database, or five arguments to search for a given nucleus. For more information refer to the docstrings:\n",
"\n",
"```python\n",
">>> help(e.find_forbidden)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# To find all '2UF' transitions throughout the ENSDF beta-minus decay data sets\n",
"x=e.find_forbidden(edata,'2UF',mode='ECBP')\n",
"print(x)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# To find all '3F' transitions throughout the ENSDF electron-capture/beta-plus decay data sets\n",
"x=e.find_forbidden(edata,'3F',mode='ECBP')\n",
"print(x)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all '2UF' transitions in 60Co beta-minus decay\n",
"x=e.find_forbidden(edata,\"Co60\",0,'2UF',mode='BM')\n",
"print(x)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Find all '1UF' transitions in 158Tm electron-capture/beta-plus decay\n",
"x=e.find_forbidden(edata,\"Tm158\",0,'1UF',mode='ECBP')\n",
"print(x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## $\\epsilon/\\beta^{+}$-decay properties"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (i) $\\epsilon/\\beta^{+}$-decay properties to all states populated following the decay of the parent nucleus\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_ecbp)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Get electon-capture/beta-plus decay properties from the ground-state decay of 86Y\n",
"#x=e.get_ecbp(edata, \"Y86\", 0, units='best')\n",
"x=e.get_ecbp(edata, \"Dy155\", 0, units='best')\n",
"for k,v in x.items():\n",
" print(v)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### (ii) $\\epsilon$-decay fractions to all states populated following the decat of the parent nucleus\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_ec_fractions)\n",
"```\n",
"\n",
"NB: One of the following keyword arguments is needed for the desired atomic-shell $\\epsilon$ data:\n",
"\n",
"```Bash\n",
"subshell = 'calc'\n",
"subshell = 'sumcalc'\n",
"subshell = 'expt'\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Get calculated electron-capture decay fractions to states populated in 86Sr following the g.s. decay of 86Y\n",
"#x=e.get_ec_fractions(edata, \"Y86\", 0, subshell='calc')\n",
"x=e.get_ec_fractions(edata, \"Dy155\", 0, subshell='calc')\n",
"print(x)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## $\\alpha$-decay properties\n",
"\n",
"The returned quantities are explained in the docstrings:\n",
"\n",
"```python\n",
">>> help(e.get_alpha)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Get alpha-decay properties to all states populated in Rn222 following the ground-state decay of Ra226\n",
"alpha=e.get_alpha(edata, \"Ra226\", 0, units='best')\n",
"print(alpha)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Put alpha intensity and HF data into lists for plotting\n",
"level_energy = []\n",
"IA, dIA = [], []\n",
"HF, dHF = [], []\n",
"for k,v in alpha.items():\n",
" print(\"Daughter = {0}\".format(k[3]))\n",
" for vv in v:\n",
" print(\"level energy = {0}; IA = {1} \\xb1 {2}; HF = {3} \\xb1 {4}\".format(vv[1],vv[9],vv[10],vv[11],vv[12]))\n",
" level_energy.append(vv[1])\n",
" IA.append(vv[9])\n",
" dIA.append(vv[10])\n",
" HF.append(vv[11])\n",
" dHF.append(vv[12])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Plot IA vs. E and IA vs. HF\n",
"%matplotlib notebook\n",
"fig, (ax1,ax2) = plt.subplots(1,2,figsize=(9,6))\n",
"\n",
"ax1.errorbar(level_energy, IA, xerr=None, yerr=dIA, color='b', fmt='o', capsize=5, label=r'$^{226}$Ra $\\rightarrow$ $^{222}$Rn + $\\alpha$')\n",
"ax1.legend(loc='best', fontsize=15)\n",
"ax1.set_xlabel(r'$E$ [keV]', size=20)\n",
"ax1.set_ylabel(r'$I_{\\alpha}$', size=20)\n",
"\n",
"#ax1.set_xscale('log')\n",
"ax1.set_yscale('log')\n",
"\n",
"ax2.errorbar(HF, IA, xerr=dHF, yerr=dIA, color='b', fmt='o', capsize=5, label=r'$^{226}$Ra $\\rightarrow$ $^{222}$Rn + $\\alpha$')\n",
"ax2.legend(loc='best', fontsize=15)\n",
"ax2.set_xlabel(r'$HF$', size=20)\n",
"ax2.set_ylabel(r'$I_{\\alpha}$', size=20)\n",
"\n",
"#ax2.set_xscale('log')\n",
"ax2.set_yscale('log')\n",
"\n",
"ax1.grid()\n",
"ax2.grid()\n",
"\n",
"plt.tight_layout()\n",
"plt.savefig(\"E_hf_plot.png\", dpi=fig.dpi)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"np.corrcoef(np.array(IA), np.array(HF))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Plot IA vs. HF\n",
"%matplotlib notebook\n",
"fig, (ax1,ax2) = plt.subplots(2,figsize=(9,6),sharex=True)\n",
"\n",
"ax2.errorbar(level_energy, IA, xerr=None, yerr=dIA, color='b', fmt='o', capsize=5, label=r'$^{226}$Ra $\\rightarrow$ $^{222}$Rn + $\\alpha$')\n",
"#ax2.legend(loc='best', fontsize=15)\n",
"ax2.set_xlabel(r'$E$ [keV]', size=20)\n",
"ax2.set_ylabel(r'$I_{\\alpha}$', size=20)\n",
"ax2.set_yscale('log')\n",
"\n",
"ax1.errorbar(level_energy, HF, xerr=None, yerr=dHF, color='b', fmt='o', capsize=5, label=r'$^{226}$Ra $\\rightarrow$ $^{222}$Rn + $\\alpha$')\n",
"ax1.legend(loc='best', fontsize=15)\n",
"ax1.set_ylabel(r'$HF$', size=20)\n",
"ax1.set_yscale('log')\n",
"\n",
"ax1.grid()\n",
"ax2.grid()\n",
"\n",
"plt.tight_layout()\n",
"plt.savefig(\"HF_IA_vs_E_plot.png\", dpi=fig.dpi)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Search for superallowed decays in $\\epsilon/\\beta^{+}$ decay"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Superallowed 0+->0+ decays in EC/BP nuclides\n",
"\n",
"superallowed = []\n",
"for k,v, in ecbp_pairs.items():\n",
" decay = e.get_ecbp(edata, str(k[0]), int(k[3]), units='best')\n",
" for k_decay, v_decay in decay.items():\n",
" # Firm J and pi\n",
" if int(k_decay[9])==1 and int(k_decay[11])==1:\n",
" # Find parents with Jpi=0+\n",
" if int(2*k_decay[8])==0 and int(k_decay[10])==1:\n",
" # Find daughter with Jpi=0+\n",
" for daughter in v_decay:\n",
" # Search for ground states only\n",
" #if int(daughter[0])==0:\n",
" # Firm J and pi:\n",
" if int(daughter[2]==1) and int(daughter[4])==1 and int(daughter[6])==1:\n",
" # Find J=0 and pi=+:\n",
" try:\n",
" if int(2*daughter[3])==0 and int(daughter[5])==1 and daughter[17]<4.0:\n",
" print(k[0], k[1], k[2], k[3], k[4], k_decay[3], k_decay[4], \\\n",
" k_decay[5], daughter[0], daughter[1], daughter[3], \\\n",
" daughter[5], daughter[17], daughter[18], daughter[21], \\\n",
" daughter[22], daughter[23])\n",
" superallowed.append([k[0], k[1], k[2], k[3], k[4], k_decay[3], k_decay[4], \\\n",
" k_decay[5], daughter[0], daughter[1], daughter[3], \\\n",
" daughter[5], daughter[17], daughter[18], daughter[21], \\\n",
" daughter[22], daughter[23]])\n",
" except TypeError:\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for l in superallowed: print(l)\n",
"print(len(superallowed))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sa = [i for i in superallowed if i[12] is not None]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(len(sa))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sa_array = np.array(sa)\n",
"A = sa_array[:,2].astype(int)\n",
"logft = sa_array[:,12].astype(float)\n",
"d_logft = sa_array[:,13].astype(float)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib notebook\n",
"fig, ax = plt.subplots(figsize=(9,6))\n",
"\n",
"ax.errorbar(A, logft, yerr=d_logft, color='k', fmt='o', capsize=5, label=r'Superallowed $0^{+} \\rightarrow 0^{+}$')\n",
"#ax.scatter(A, logft, color='k', label=r'Superallowed $0^{+} \\rightarrow 0^{+}$')\n",
"ax.legend(loc='best', fontsize=15)\n",
"ax.set_xlabel(r'$A$', size=20)\n",
"ax.set_ylabel(r'log$(ft)$', size=20)\n",
"\n",
"plt.grid()\n",
"plt.tight_layout()\n",
"plt.savefig(\"superallowed.png\", dpi=fig.dpi)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"x=e.get_ecbp(edata, \"S28\", 0, units=\"best\")\n",
"for k,v in x.items():\n",
" print(k,v)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Search for first-forbidden transitions in $\\beta^{-}$ decay"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"# Find 1st forbidden transitions based on a.m. selection rules and compare logft values\n",
"forbidden_first_list = []\n",
"forbidden_first=e.find_forbidden(edata,'1F',mode='ECBP')\n",
"for k,v in forbidden_first.items():\n",
" for vv in v:\n",
" if vv[7] is not None:\n",
" forbidden_first_list.append([k[11], vv[7], vv[8]])\n",
"\n",
"forbidden_firstu_list = []\n",
"forbidden_firstu=e.find_forbidden(edata,'1UF',mode='ECBP')\n",
"for k,v in forbidden_firstu.items():\n",
" for vv in v:\n",
" if vv[7] is not None:\n",
" forbidden_firstu_list.append([k[11], vv[7], vv[8]])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"first_array = np.array(forbidden_first_list)\n",
"f_A = first_array[:,0].astype(int)\n",
"f_logft = first_array[:,1].astype(float)\n",
"f_dlogft = first_array[:,2].astype(float)\n",
"\n",
"firstu_array = np.array(forbidden_firstu_list)\n",
"fu_A = firstu_array[:,0].astype(int)\n",
"fu_logft = firstu_array[:,1].astype(float)\n",
"fu_dlogft = firstu_array[:,2].astype(float)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"%matplotlib notebook\n",
"fig, ax = plt.subplots(figsize=(9,6))\n",
"\n",
"ax.errorbar(f_A, f_logft, yerr=f_dlogft, color='k', fmt='o', capsize=5, alpha=0.5, label=r'First forbidden')\n",
"ax.errorbar(fu_A, fu_logft, yerr=fu_dlogft, color='r', fmt='o', capsize=5, alpha=0.5, label=r'First forbidden unique')\n",
"ax.legend(loc='best', fontsize=15)\n",
"ax.set_xlabel(r'$A$', size=20)\n",
"ax.set_ylabel(r'log$(ft)$', size=20)\n",
"\n",
"ax.hlines(y=6, xmin=0, xmax=260, linewidth=2, color='b')\n",
"ax.hlines(y=9, xmin=0, xmax=260, linewidth=2, color='b')\n",
"\n",
"plt.grid()\n",
"plt.tight_layout()\n",
"plt.savefig(\"forbidden.png\", dpi=fig.dpi)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}