Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Oct 28, 2024
1 parent a762b1f commit c1f72c0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions artisatomic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,26 +866,32 @@ def match_hydrogenic_phixs(
mc_squared = 0.5109989461 * 1e6 # electron mass in eV

photoionization_crosssections = np.zeros((len(energy_levels), args.nphixspoints))
photoionization_targetfractions = [[(1, 1.0)] for _ in energy_levels]
photoionization_targetfractions: list = [[] for _ in energy_levels]
photoionization_thresholds_ev = np.zeros(len(energy_levels))
phixstables = {}
for lowerlevelid, level in enumerate(energy_levels[1:], 1):
n = get_n(level.levelname)
if lowerlevelid > 100:
# limit levels with hydrogenic photoionization cross sections
break
en_ev = hc_in_ev_cm * level.energyabovegsinpercm
threshold_ev = ionization_energy_ev - en_ev
photoionization_thresholds_ev[lowerlevelid] = threshold_ev
lambda_angstrom = hc_in_ev_angstrom / threshold_ev
assert lambda_angstrom > 0.0
if lambda_angstrom <= 0.0:
continue

n = get_n(level.levelname)
effective_charge_squared = threshold_ev * 2 * (n**2) / alpha_squared / mc_squared
phixstables[lowerlevelid] = (
readhillierdata.get_hydrogenic_n_phixstable(lambda_angstrom=lambda_angstrom, n=n) / effective_charge_squared
)
photoionization_targetfractions[lowerlevelid] = [(1, 1.0)]

reduced_phixs_dict = reduce_phixs_tables(
phixstables, args.optimaltemperature, args.nphixspoints, args.phixsnuincrement
)
for lowerlevelid, enlevel in enumerate(energy_levels[1:], 1):
photoionization_crosssections[lowerlevelid] = reduced_phixs_dict[lowerlevelid]
for lowerlevelid, reduced_phixs_table in reduced_phixs_dict.items():
photoionization_crosssections[lowerlevelid] = reduced_phixs_table

return photoionization_crosssections, photoionization_targetfractions, photoionization_thresholds_ev

Expand Down

0 comments on commit c1f72c0

Please sign in to comment.