|
15 | 15 |
|
16 | 16 | r"""NIST compile function."""
|
17 | 17 |
|
18 |
| -from tempfile import NamedTemporaryFile |
19 |
| - |
20 | 18 | import os
|
21 | 19 |
|
22 | 20 | import numpy as np
|
23 | 21 |
|
| 22 | +from scipy import constants |
| 23 | + |
24 | 24 | import h5py as h5
|
25 | 25 |
|
26 | 26 | import csv
|
@@ -88,6 +88,8 @@ def run(elem, charge, mult, nexc, dataset, datapath):
|
88 | 88 | if not mult == mults[0]:
|
89 | 89 | raise ValueError(f"{elem} with {charge} and multiplicity {mult} not available.")
|
90 | 90 | energy = energy[0]
|
| 91 | + # Convert energy to Hartree from cm^{-1} |
| 92 | + energy *= 2 * constants.centi * constants.Rydberg |
91 | 93 | elif -2 <= charge < 0:
|
92 | 94 | # Anions
|
93 | 95 | # Get the multiplicity (the one with lowest energy) from the corresponding neutral
|
@@ -125,13 +127,16 @@ def run(elem, charge, mult, nexc, dataset, datapath):
|
125 | 127 | table_mus = [row for row in table_mus if len(row[1]) > 0]
|
126 | 128 | table_etas = data[tabid[2] :]
|
127 | 129 | table_etas = [row for row in table_etas if len(row[1]) > 0]
|
128 |
| - # Get property at table(natom, charge) |
| 130 | + # Get property at table(natom, charge); convert to Hartree |
129 | 131 | colid = table_ips[0].index(str(charge))
|
130 | 132 | ip = float(table_ips[natom][colid]) if len(table_ips[natom][colid]) > 1 else None
|
| 133 | + ip *= constants.eV / (2 * constants.Rydberg * constants.h * constants.c) |
131 | 134 | colid = table_mus[0].index(str(charge))
|
132 | 135 | mu = float(table_mus[natom][colid]) if len(table_mus[natom][colid]) > 1 else None
|
| 136 | + mu *= constants.eV / (2 * constants.Rydberg * constants.h * constants.c) |
133 | 137 | colid = table_etas[0].index(str(charge))
|
134 | 138 | eta = float(table_etas[natom][colid]) if len(table_etas[natom][colid]) > 1 else None
|
| 139 | + eta *= constants.eV / (2 * constants.Rydberg * constants.h * constants.c) |
135 | 140 |
|
136 | 141 | # Return Species instance
|
137 | 142 | return atomdb.Species(
|
|
0 commit comments