Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHls committed Nov 9, 2023
1 parent 05a024b commit a14ed8a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tardis/plasma/properties/nlte_population_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,23 @@ def calculate_delta(


def check_negative_population(ion_number_density, electron_densities):
"""
Checks if negative populations are present in the solution and sets them to zero.
Parameters
----------
ion_number_density : pandas.DataFrame
Number density with NLTE ionization treatment.
electron_densities : Series
Electron density with NLTE ionization treatment.
Returns
-------
ion_number_density : pandas.DataFrame
Number density with NLTE ionization treatment.
electron_densities : Series
Electron density with NLTE ionization treatment.
"""
assert (
np.greater_equal(
ion_number_density, NLTE_POPULATION_NEGATIVE_POPULATION_TOLERANCE
Expand Down

0 comments on commit a14ed8a

Please sign in to comment.