Skip to content

Commit

Permalink
update nist partition function, more complete levels
Browse files Browse the repository at this point in the history
  • Loading branch information
sigrimm committed Dec 4, 2020
1 parent 7278da4 commit 44ce2b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/helios_k/nist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This step can be done either manually or by using a script.
Step 2, Generate the partition functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Run ``python3 nist_partition.py - -Z <z> -I <i>``. This script will read
Run ``python3 nist_partition.py -Z <z> -I <i>``. This script will read
the previously produces file ``NIST_ELevels<Z><I>.dat``, and writes a ``*.pf`` file.


Expand Down
24 changes: 15 additions & 9 deletions nist_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,21 @@ def partition(z, I):
for i in range(len(g)):

try:
if(Term[i] != '' or z > 1):
gf = float(g[i])
Ef = float(E[i])
#exp(-h c E /(k_B T))
z = gf * np.exp(-1.4387770 * Ef/T)
if(t == 0):
print(i, gf, Ef, Z, z)

Z += gf * np.exp(-1.4387770 * Ef/T)
if((Conf[i].isnumeric() == True or Conf[i] == '1s') or z > 1):
#print(Conf[i], Term[i], J[i], '|',g[i],'|',E[i],'|')
if(g[i] != '' and E[i] != '' and E[i] != ' '):
# remove '[' and ']' from Energy
E[i] = E[i].replace('[', '')
E[i] = E[i].replace(']', '')
#print(Conf[i], Term[i], J[i], g[i], E[i])
gf = float(g[i])
Ef = float(E[i])
#exp(-h c E /(k_B T))
z0 = gf * np.exp(-1.4387770 * Ef/T)
if(t == 0):
print(i, gf, Ef, Z, z0)

Z += gf * np.exp(-1.4387770 * Ef/T)
except:
continue

Expand Down

0 comments on commit 44ce2b2

Please sign in to comment.