Skip to content

Commit

Permalink
improve opacities
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshields committed Nov 8, 2023
1 parent 42c8c24 commit 27b346e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions stardis/plasma/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def calculate(

# Truncate to final atomic number
linelist = linelist[
linelist.atomic_number < (atomic_data.selected_atomic_numbers.max() + 1)
linelist.atomic_number <= (atomic_data.selected_atomic_numbers.max())
]

# Calculate degeneracies
Expand All @@ -197,11 +197,6 @@ def calculate(
-linelist.e_low.values * u.eV, 1 / (t_electrons * u.K * const.k_B)
).to(1)
)
# -np.exp(
# np.outer(-linelist.e_up.values * u.eV, 1 / (t_electrons * u.K * const.k_B))
# ).to(
# 1
# ) # This reduction appears in Korg - I'm guessing it's due to spontaneous emission from the upper level - reduces opacity by ~1-3%

# grab densities for n_lower - need to use linelist as the index
linelist_with_densities = linelist.merge(
Expand All @@ -218,7 +213,9 @@ def calculate(
/ linelist_with_densities.g_0.values
)

linelist["f_lu"] = 10**linelist.log_gf * linelist.g_lo / linelist.g_up
linelist["f_lu"] = (
10**linelist.log_gf / linelist.g_lo
) # vald log gf is "oscillator strength f times the statistical weight g of the parent level" see 1995A&AS..112..525P

line_nus = (linelist.wavelength.values * u.AA).to(
u.Hz, equivalencies=u.spectral()
Expand Down

0 comments on commit 27b346e

Please sign in to comment.