Package: nist-asd
# nist-asdBasically a class which parses the NIST Atomic Spectra Database for energy levels and lines and saves the data to a dictionary on HDD.- You can pass a matplotlib.axis, and the emission lines will be plotted with an optional normalization factor- You can plot the data directly- You can print the emission line data and access it- You can print the energy level data and access itExample usage:```python>>> pip install nist-asdfrom nistasd import NISTLines, NISTASDimport matplotlib.pyplot as pltif __name__ == '__main__':import pandas as pdnist = NISTLines(spectrum='N')energy_levels = nist.get_energy_levels()for ion_stage in energy_levels:print("Number of levels: {0} for {1}".format(len(energy_levels[ion_stage]), ion_stage))df = pd.DataFrame(energy_levels[ion_stage])print(df)breaknist = NISTLines(spectrum='O', lower_wavelength=2., upper_wavelength=50., order=1)# plotting to existing axis with scaling parameterplt.figure()ax = plt.gca()nist.plot_nist_lines_to_axis(ax, normalize_max=10.)plt.grid()# plotting lines to new windownist.plot_lines()plt.savefig('nist-asd-example-plot.pdf')plt.show()# printing informationnist = NISTLines(spectrum='O', lower_wavelength=17.20, upper_wavelength=17.35, order=1)lines = nist.get_lines()print("Number of lines: ", len(lines))lines_within_range = nist.get_lines_wavelength_range()print("Number of lines within range: ", len(lines_within_range))print("Line data within range:")nist.pprint()```Results in:[Plot result](examples/nist-asd-example-plot.pdf)```Number of energy levels: 366 for N IJ  configuration        ...         term  uncertainty (eV)0    1.5         2s22p3        ...          4SÂ°               NaN1    2.5         2s22p3        ...          2DÂ°               NaN2    1.5         2s22p3        ...          2DÂ°               NaN3    0.5         2s22p3        ...          2PÂ°               NaN4    1.5         2s22p3        ...          2PÂ°               NaN5    0.5   2s22p2(3P)3s        ...           4P               NaN6    1.5   2s22p2(3P)3s        ...           4P               NaN7    2.5   2s22p2(3P)3s        ...           4P               NaN8    0.5   2s22p2(3P)3s        ...           2P               NaN9    1.5   2s22p2(3P)3s        ...           2P               NaN10   2.5          2s2p4        ...           4P               NaN11   1.5          2s2p4        ...           4P               NaN12   0.5          2s2p4        ...           4P               NaN13   0.5   2s22p2(3P)3p        ...          2SÂ°               NaN14   0.5   2s22p2(3P)3p        ...          4DÂ°               NaN15   1.5   2s22p2(3P)3p        ...          4DÂ°               NaN16   2.5   2s22p2(3P)3p        ...          4DÂ°               NaN17   3.5   2s22p2(3P)3p        ...          4DÂ°               NaN18   0.5   2s22p2(3P)3p        ...          4PÂ°               NaN19   1.5   2s22p2(3P)3p        ...          4PÂ°               NaN20   2.5   2s22p2(3P)3p        ...          4PÂ°               NaN21   1.5   2s22p2(3P)3p        ...          4SÂ°               NaN22   1.5   2s22p2(3P)3p        ...          2DÂ°               NaN23   2.5   2s22p2(3P)3p        ...          2DÂ°               NaN24   0.5   2s22p2(3P)3p        ...          2PÂ°               NaN25   1.5   2s22p2(3P)3p        ...          2PÂ°               NaN26   2.5   2s22p2(1D)3s        ...           2D               NaN27   1.5   2s22p2(1D)3s        ...           2D               NaN28   0.5   2s22p2(3P)4s        ...           4P               NaN29   1.5   2s22p2(3P)4s        ...           4P               NaN..   ...            ...        ...          ...               ...336  0.5   2s2p3(5SÂ°)5p        ...           4P               NaN337  1.5   2s2p3(5SÂ°)5p        ...           4P               NaN338  2.5   2s2p3(5SÂ°)5p        ...           4P               NaN339  0.5   2s2p3(5SÂ°)6p        ...           4P               NaN340  1.5   2s2p3(5SÂ°)6p        ...           4P               NaN341  2.5   2s2p3(5SÂ°)6p        ...           4P               NaN342  0.5   2s2p3(5SÂ°)7p        ...           4P             0.012343  1.5   2s2p3(5SÂ°)7p        ...           4P             0.012344  2.5   2s2p3(5SÂ°)7p        ...           4P             0.012345  0.5   2s2p3(5SÂ°)8p        ...           4P               NaN346  1.5   2s2p3(5SÂ°)8p        ...           4P               NaN347  2.5   2s2p3(5SÂ°)8p        ...           4P               NaN348  0.5   2s2p3(5SÂ°)9p        ...           4P               NaN349  1.5   2s2p3(5SÂ°)9p        ...           4P               NaN350  2.5   2s2p3(5SÂ°)9p        ...           4P               NaN351  0.5  2s2p3(5SÂ°)10p        ...           4P             0.012352  1.5  2s2p3(5SÂ°)10p        ...           4P             0.012353  2.5  2s2p3(5SÂ°)10p        ...           4P             0.012354  0.5  2s2p3(5SÂ°)11p        ...           4P               NaN355  1.5  2s2p3(5SÂ°)11p        ...           4P               NaN356  2.5  2s2p3(5SÂ°)11p        ...           4P               NaN357  0.5  2s2p3(5SÂ°)12p        ...           4P               NaN358  1.5  2s2p3(5SÂ°)12p        ...           4P               NaN359  2.5  2s2p3(5SÂ°)12p        ...           4P               NaN360  0.5  2s2p3(5SÂ°)13p        ...           4P               NaN361  1.5  2s2p3(5SÂ°)13p        ...           4P               NaN362  2.5  2s2p3(5SÂ°)13p        ...           4P               NaN363  0.5  2s2p3(5SÂ°)14p        ...           4P               NaN364  1.5  2s2p3(5SÂ°)14p        ...           4P               NaN365  2.5  2s2p3(5SÂ°)14p        ...           4P               NaN[366 rows x 7 columns]Number of lines:  5829Number of lines within range:  20Line data within range:{'Acc': 'B','Aki': 29400000000.0,'Ei': 0.0,'Ek': 72.01311,'gi': 1.0,'gk': 3.0,'lower_J': '0','lower_conf': '1s2.2s2','lower_term': '1S','rel_int': 450.0,'rel_int_com': '','section': 0,'spectrum': 'O ''V','type': '','upper_J': '1','upper_conf': '1s2.2s.3p','upper_term': '1P*','wave': 17.2169,'wave_obs': 17.2169,'wave_ritz': 17.2169}{'Acc': 'A','Aki': 73300000000.0,'Ei': 11.94898,'Ek': 83.64293,'gi': 2.0,'gk': 4.0,'lower_J': '1/2','lower_conf': '1s2.2p','lower_term': '2P*','rel_int': nan,'rel_int_com': '','section': 0,'spectrum': 'O ''VI','type': '','upper_J': '3/2','upper_conf': '1s2.3d','upper_term': '2D','wave': 17.2935,'wave_obs': nan,'wave_ritz': 17.2935}```