Skip to content

Commit

Permalink
Revert "Fix nlte normalization (#920)" (#922)
Browse files Browse the repository at this point in the history
This reverts commit fd57afc.
  • Loading branch information
wkerzendorf authored Apr 29, 2019
1 parent fd57afc commit 6ecdd1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tardis/io/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def _create_collision_coefficient_matrix(self):
C_ul_matrix[level_number_lower, level_number_upper, :] = line.values[2:]
delta_E_matrix[level_number_lower, level_number_upper] = line['delta_e']
#TODO TARDISATOMIC fix change the g_ratio to be the otherway round - I flip them now here.
g_ratio_matrix[level_number_lower, level_number_upper] = 1/line['g_ratio']
g_ratio_matrix[level_number_lower, level_number_upper] = line['g_ratio']
self.C_ul_interpolator[species] = interpolate.interp1d(
self.atom_data.collision_data_temperatures,
C_ul_matrix)
Expand Down
18 changes: 9 additions & 9 deletions tardis/plasma/properties/partition_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __init__(self, plasma_parent):
def _main_nlte_calculation(
self, atomic_data, nlte_data, t_electrons,
j_blues, beta_sobolevs, general_level_boltzmann_factor,
previous_electron_densities, g):
previous_electron_densities):
"""
The core of the NLTE calculation, used with all possible config.
options.
Expand Down Expand Up @@ -189,14 +189,14 @@ def _main_nlte_calculation(
'collision data?')
else:
raise e
general_level_boltzmann_factor[i].ix[species] = \
level_boltzmann_factor * g.loc[species][0] / level_boltzmann_factor[0]
general_level_boltzmann_factor[i].loc[species] = \
level_boltzmann_factor
return general_level_boltzmann_factor

def _calculate_classical_nebular(
self, t_electrons, lines, atomic_data,
nlte_data, general_level_boltzmann_factor, j_blues,
previous_electron_densities, g):
previous_electron_densities):
"""
Performs NLTE calculations using the classical nebular treatment.
All beta sobolev values taken as 1.
Expand All @@ -210,13 +210,13 @@ def _calculate_classical_nebular(
j_blues,
beta_sobolevs,
general_level_boltzmann_factor,
previous_electron_densities, g)
previous_electron_densities)
return general_level_boltzmann_factor

def _calculate_coronal_approximation(
self, t_electrons, lines, atomic_data,
nlte_data, general_level_boltzmann_factor,
previous_electron_densities, g):
previous_electron_densities):
"""
Performs NLTE calculations using the coronal approximation.
All beta sobolev values taken as 1 and j_blues taken as 0.
Expand All @@ -226,13 +226,13 @@ def _calculate_coronal_approximation(
general_level_boltzmann_factor = self._main_nlte_calculation(
atomic_data, nlte_data, t_electrons, j_blues,
beta_sobolevs, general_level_boltzmann_factor,
previous_electron_densities, g)
previous_electron_densities)
return general_level_boltzmann_factor

def _calculate_general(
self, t_electrons, lines, atomic_data, nlte_data,
general_level_boltzmann_factor, j_blues,
previous_beta_sobolev, previous_electron_densities, g):
previous_beta_sobolev, previous_electron_densities):
"""
Full NLTE calculation without approximations.
"""
Expand All @@ -244,7 +244,7 @@ def _calculate_general(
general_level_boltzmann_factor = self._main_nlte_calculation(
atomic_data, nlte_data, t_electrons, j_blues,
beta_sobolevs, general_level_boltzmann_factor,
previous_electron_densities, g)
previous_electron_densities)
return general_level_boltzmann_factor


Expand Down

0 comments on commit 6ecdd1e

Please sign in to comment.