Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 124 additions & 92 deletions ChargedParticle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@
"`NE`\n",
": The number of energies in the grid\n",
"\n",
"`Emin`\n",
": The smallest tabulated energy\n",
"\n",
"`Emax`\n",
": The highest tabulated energy"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -67,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -99,6 +102,7 @@
" <th>T(K)</th>\n",
" <th>Date</th>\n",
" <th>NE</th>\n",
" <th>Emin</th>\n",
" <th>Emax</th>\n",
" </tr>\n",
" </thead>\n",
Expand All @@ -113,103 +117,99 @@
" <td>0.0</td>\n",
" <td>2020-09-04</td>\n",
" <td>94</td>\n",
" <td>10277.4</td>\n",
" <td>0.1</td>\n",
" <td>20.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>2004.00o</td>\n",
" <td>3.967130</td>\n",
" <th>1</th>\n",
" <td>3006.00a</td>\n",
" <td>5.963449</td>\n",
" <td>CP2020</td>\n",
" <td>CP2020/2004.00o</td>\n",
" <td>2004</td>\n",
" <td>CP2020/3006.00a</td>\n",
" <td>3006</td>\n",
" <td>0.0</td>\n",
" <td>2020-09-04</td>\n",
" <td>109</td>\n",
" <td>72517.8</td>\n",
" <td>2020-09-10</td>\n",
" <td>209</td>\n",
" <td>0.0</td>\n",
" <td>200.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>2004.00s</td>\n",
" <td>3.967130</td>\n",
" <th>2</th>\n",
" <td>3007.00a</td>\n",
" <td>6.955734</td>\n",
" <td>CP2020</td>\n",
" <td>CP2020/2004.00s</td>\n",
" <td>2004</td>\n",
" <td>CP2020/3007.00a</td>\n",
" <td>3007</td>\n",
" <td>0.0</td>\n",
" <td>2020-09-04</td>\n",
" <td>147</td>\n",
" <td>98672.9</td>\n",
" <td>2020-09-10</td>\n",
" <td>215</td>\n",
" <td>0.0</td>\n",
" <td>200.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>2004.00h</td>\n",
" <td>3.968219</td>\n",
" <th>3</th>\n",
" <td>1002.00o</td>\n",
" <td>1.996256</td>\n",
" <td>CP2020</td>\n",
" <td>CP2020/2004.00h</td>\n",
" <td>2004</td>\n",
" <td>CP2020/1002.00o</td>\n",
" <td>1002</td>\n",
" <td>0.0</td>\n",
" <td>2020-09-04</td>\n",
" <td>538</td>\n",
" <td>12569.6</td>\n",
" <td>101</td>\n",
" <td>0.0</td>\n",
" <td>10.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>2004.00r</td>\n",
" <td>3.968219</td>\n",
" <th>4</th>\n",
" <td>1003.00o</td>\n",
" <td>2.989596</td>\n",
" <td>CP2020</td>\n",
" <td>CP2020/2004.00r</td>\n",
" <td>2004</td>\n",
" <td>CP2020/1003.00o</td>\n",
" <td>1003</td>\n",
" <td>0.0</td>\n",
" <td>2020-09-04</td>\n",
" <td>200</td>\n",
" <td>986.7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12042</th>\n",
" <td>2004.70a</td>\n",
" <td>3.967130</td>\n",
" <td>CP2011</td>\n",
" <td>CP2011/alpha/2004.70a</td>\n",
" <td>2004</td>\n",
" <td>167</td>\n",
" <td>0.0</td>\n",
" <td>2013-05-23</td>\n",
" <td>94</td>\n",
" <td>10237.0</td>\n",
" <td>10.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12048</th>\n",
" <td>2004.70o</td>\n",
" <td>3.967130</td>\n",
" <td>CP2011</td>\n",
" <td>CP2011/deuteron/2004.70o</td>\n",
" <td>2004</td>\n",
" <td>0.0</td>\n",
" <td>2012-09-14</td>\n",
" <td>109</td>\n",
" <td>72517.8</td>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12052</th>\n",
" <td>2004.70s</td>\n",
" <td>3.967130</td>\n",
" <th>12062</th>\n",
" <td>1003.70r</td>\n",
" <td>2.989596</td>\n",
" <td>CP2011</td>\n",
" <td>CP2011/helium3/2004.70s</td>\n",
" <td>2004</td>\n",
" <td>CP2011/triton/1003.70r</td>\n",
" <td>1003</td>\n",
" <td>0.0</td>\n",
" <td>2011-08-30</td>\n",
" <td>147</td>\n",
" <td>98673.0</td>\n",
" <td>75</td>\n",
" <td>0.0</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12059</th>\n",
" <td>2004.71h</td>\n",
" <td>3.967130</td>\n",
" <th>12063</th>\n",
" <td>2003.70r</td>\n",
" <td>2.989032</td>\n",
" <td>CP2011</td>\n",
" <td>CP2011/proton/2004.71h</td>\n",
" <td>2004</td>\n",
" <td>CP2011/triton/2003.70r</td>\n",
" <td>2003</td>\n",
" <td>0.0</td>\n",
" <td>2011-08-30</td>\n",
" <td>110</td>\n",
" <td>12571.0</td>\n",
" <td>81</td>\n",
" <td>0.0</td>\n",
" <td>3.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12064</th>\n",
Expand All @@ -221,36 +221,68 @@
" <td>0.0</td>\n",
" <td>2011-08-30</td>\n",
" <td>201</td>\n",
" <td>986.9</td>\n",
" <td>0.1</td>\n",
" <td>14.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12065</th>\n",
" <td>3006.70r</td>\n",
" <td>5.961817</td>\n",
" <td>CP2011</td>\n",
" <td>CP2011/triton/3006.70r</td>\n",
" <td>3006</td>\n",
" <td>0.0</td>\n",
" <td>2011-08-30</td>\n",
" <td>45</td>\n",
" <td>0.0</td>\n",
" <td>20.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12066</th>\n",
" <td>3007.70r</td>\n",
" <td>6.955734</td>\n",
" <td>CP2011</td>\n",
" <td>CP2011/triton/3007.70r</td>\n",
" <td>3007</td>\n",
" <td>0.0</td>\n",
" <td>2011-07-07</td>\n",
" <td>205</td>\n",
" <td>0.0</td>\n",
" <td>200.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>138 rows × 10 columns</p>\n",
"</div>"
],
"text/plain": [
" ZAID AWR library path ZA T(K) \\\n",
"0 2004.00a 3.967130 CP2020 CP2020/2004.00a 2004 0.0 \n",
"6 2004.00o 3.967130 CP2020 CP2020/2004.00o 2004 0.0 \n",
"10 2004.00s 3.967130 CP2020 CP2020/2004.00s 2004 0.0 \n",
"17 2004.00h 3.968219 CP2020 CP2020/2004.00h 2004 0.0 \n",
"22 2004.00r 3.968219 CP2020 CP2020/2004.00r 2004 0.0 \n",
"12042 2004.70a 3.967130 CP2011 CP2011/alpha/2004.70a 2004 0.0 \n",
"12048 2004.70o 3.967130 CP2011 CP2011/deuteron/2004.70o 2004 0.0 \n",
"12052 2004.70s 3.967130 CP2011 CP2011/helium3/2004.70s 2004 0.0 \n",
"12059 2004.71h 3.967130 CP2011 CP2011/proton/2004.71h 2004 0.0 \n",
"12064 2004.70r 3.967130 CP2011 CP2011/triton/2004.70r 2004 0.0 \n",
" ZAID AWR library path ZA T(K) \\\n",
"0 2004.00a 3.967130 CP2020 CP2020/2004.00a 2004 0.0 \n",
"1 3006.00a 5.963449 CP2020 CP2020/3006.00a 3006 0.0 \n",
"2 3007.00a 6.955734 CP2020 CP2020/3007.00a 3007 0.0 \n",
"3 1002.00o 1.996256 CP2020 CP2020/1002.00o 1002 0.0 \n",
"4 1003.00o 2.989596 CP2020 CP2020/1003.00o 1003 0.0 \n",
"... ... ... ... ... ... ... \n",
"12062 1003.70r 2.989596 CP2011 CP2011/triton/1003.70r 1003 0.0 \n",
"12063 2003.70r 2.989032 CP2011 CP2011/triton/2003.70r 2003 0.0 \n",
"12064 2004.70r 3.967130 CP2011 CP2011/triton/2004.70r 2004 0.0 \n",
"12065 3006.70r 5.961817 CP2011 CP2011/triton/3006.70r 3006 0.0 \n",
"12066 3007.70r 6.955734 CP2011 CP2011/triton/3007.70r 3007 0.0 \n",
"\n",
" Date NE Emin Emax \n",
"0 2020-09-04 94 0.1 20.0 \n",
"1 2020-09-10 209 0.0 200.0 \n",
"2 2020-09-10 215 0.0 200.0 \n",
"3 2020-09-04 101 0.0 10.0 \n",
"4 2020-09-04 167 0.0 10.0 \n",
"... ... ... ... ... \n",
"12062 2011-08-30 75 0.0 2.0 \n",
"12063 2011-08-30 81 0.0 3.0 \n",
"12064 2011-08-30 201 0.1 14.0 \n",
"12065 2011-08-30 45 0.0 20.0 \n",
"12066 2011-07-07 205 0.0 200.0 \n",
"\n",
" Date NE Emax \n",
"0 2020-09-04 94 10277.4 \n",
"6 2020-09-04 109 72517.8 \n",
"10 2020-09-04 147 98672.9 \n",
"17 2020-09-04 538 12569.6 \n",
"22 2020-09-04 200 986.7 \n",
"12042 2013-05-23 94 10237.0 \n",
"12048 2012-09-14 109 72517.8 \n",
"12052 2011-08-30 147 98673.0 \n",
"12059 2011-08-30 110 12571.0 \n",
"12064 2011-08-30 201 986.9 "
"[138 rows x 10 columns]"
]
},
"metadata": {},
Expand All @@ -259,7 +291,7 @@
],
"source": [
"ZA = 2004\n",
"display(ZA)"
"display()"
]
}
],
Expand Down
23 changes: 19 additions & 4 deletions GettingStarted.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,23 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reading from xsdir at: /Users/jlconlin/Documents/Data/type1/xsdir\n",
"Reading xsdir using 15 parallel threads.\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ca15c5cc674d4b078a599c5b6b8e2038",
"model_id": "0f6bb15845e64492ad34e2fb087a183f",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -54,12 +62,19 @@
"import os\n",
"import pathlib\n",
"import listing\n",
"import multiprocessing as mp\n",
"\n",
"xsdirName = 'xsdir'\n",
"datapath = pathlib.Path(os.environ['DATAPATH'], xsdirName)\n",
"print(\"Reading from xsdir at: {}\".format(datapath))\n",
"# If your XSDIR file is not called `xsdir` you will need to change the \n",
"# xsdirName variable obove to match the name of your file\n",
"listing.generateJSON(datapath, 20)"
"# xsdirName variable above to match the name of your file\n",
"\n",
"# The variable N is how many parallel threads are used\n",
"# By default, it uses all but one of the available CPUs\n",
"N = max(1, mp.cpu_count()-1)\n",
"print(\"Reading xsdir using {} parallel threads.\".format(N))\n",
"listing.generateJSON(datapath,N)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _fastNeutron(self, entry, ACE):
meta = {}
NE = int(ACE.NXS[3])
meta[ 'NE'] = NE
meta[ 'Emax'] = round(ACE.XSS[NE], 1)
meta[ 'Emax'] = round(ACE.XSS[NE-1], 1)
if (ACE.JXS[12] != 0) or (ACE.JXS[13] != 0):
meta[ 'GPD'] = True
else:
Expand Down Expand Up @@ -117,7 +117,7 @@ def _chargedParticle(self, entry, ACE):
meta['target'] = entry.ZA
meta['NE'] = NE
meta['Emin'] = round(ACE.XSS[0], 1)
meta['Emax'] = round(ACE.XSS[NE], 1)
meta['Emax'] = round(ACE.XSS[NE-1], 1)
return meta

def _default(self, entry, ACE):
Expand Down