{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "nbsphinx": "hidden" }, "outputs": [], "source": [ "# Hidden cell (check metadata)\n", "import warnings\n", "warnings.simplefilter('ignore')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Atomic Weights and Isotopic Compositions\n", "\n", "This [database](http://www.nist.gov/pml/data/comp.cfm) provides atomic weights for elements 1 through 118 and isotopic compositions (abundances). Look [here](http://nist.gov/pml/data/comp-notes.cfm#comp) for the detailed description." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import the `NISTWeightsComp` and `NISTIonizationEnergies` classes." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from carsus.io.nist import NISTWeightsComp, NISTIonizationEnergies" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Initialize classes passing the selected atoms as arguments." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading data from the NIST Atomic Weights and Isotopic Compositions database.\n" ] } ], "source": [ "nist_weights = NISTWeightsComp('H-Ne')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading ionization energies from the NIST Atomic Spectra Database\n" ] } ], "source": [ "nist_ioniz = NISTIonizationEnergies('H-Ne')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Data is stored in the `base` attribute." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
symbolnamemass
atomic_number
1HHydrogen1.007975
2HeHelium4.002602
3LiLithium6.967500
4BeBeryllium9.012183
5BBoron10.813500
6CCarbon12.010600
7NNitrogen14.006855
8OOxygen15.999400
9FFluorine18.998403
10NeNeon20.179700
\n", "
" ], "text/plain": [ " symbol name mass\n", "atomic_number \n", "1 H Hydrogen 1.007975\n", "2 He Helium 4.002602\n", "3 Li Lithium 6.967500\n", "4 Be Beryllium 9.012183\n", "5 B Boron 10.813500\n", "6 C Carbon 12.010600\n", "7 N Nitrogen 14.006855\n", "8 O Oxygen 15.999400\n", "9 F Fluorine 18.998403\n", "10 Ne Neon 20.179700" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nist_weights.base" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "atomic_number ion_number\n", "1 1 13.598434\n", "2 1 24.587389\n", " 2 54.417765\n", "3 1 5.391715\n", " 2 75.640096\n", " 3 122.454358\n", "4 1 9.322699\n", " 2 18.211150\n", " 3 153.896203\n", " 4 217.718584\n", "5 1 8.298019\n", " 2 25.154830\n", " 3 37.930580\n", " 4 259.371500\n", " 5 340.226020\n", "6 1 11.260288\n", " 2 24.383154\n", " 3 47.887780\n", " 4 64.493520\n", " 5 392.090515\n", " 6 489.993194\n", "7 1 14.534130\n", " 2 29.601250\n", " 3 47.445300\n", " 4 77.473500\n", " 5 97.890100\n", " 6 552.067320\n", " 7 667.046116\n", "8 1 13.618055\n", " 2 35.121120\n", " 3 54.935540\n", " 4 77.413500\n", " 5 113.899000\n", " 6 138.118900\n", " 7 739.326820\n", " 8 871.409880\n", "9 1 17.422820\n", " 2 34.970810\n", " 3 62.707980\n", " 4 87.175000\n", " 5 114.249000\n", " 6 157.163110\n", " 7 185.186800\n", " 8 953.898040\n", " 9 1103.117470\n", "10 1 21.564540\n", " 2 40.962970\n", " 3 63.423300\n", " 4 97.190000\n", " 5 126.247000\n", " 6 157.934000\n", " 7 207.271000\n", " 8 239.097000\n", " 9 1195.807830\n", " 10 1362.199150\n", "Name: ionization_energy, dtype: float64" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nist_ioniz.base" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Dump the data with the `to_hdf` method." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "nist_weights.to_hdf('test.h5')" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "nist_ioniz.to_hdf('test.h5')" ] } ], "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.6.7" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 1 }