Skip to content

Commit

Permalink
Add some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Jan 14, 2025
1 parent 27aa428 commit 2ea02b2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tardis/plasma/equilibrium/rates/photoionization_strengths.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ def common_prefactor(self):
)

def calculate_photoionization_boltzmann_factor(self, electron_temperature):
"""Calculate the Boltzmann factor at each photoionization frequency
Parameters
----------
electron_temperature : Quantity
Electron temperature in each shell.
Returns
-------
numpy.ndarray
The Boltzmann factor per shell per photoionization frequency.
"""
return np.exp(-self.nu[np.newaxis].T / electron_temperature * (H / K_B))

Check warning on line 56 in tardis/plasma/equilibrium/rates/photoionization_strengths.py

View check run for this annotation

Codecov / codecov/patch

tardis/plasma/equilibrium/rates/photoionization_strengths.py#L56

Added line #L56 was not covered by tests

def solve(self, electron_temperature):
Expand Down Expand Up @@ -100,6 +112,19 @@ def calculate_mean_intensity_photoionization_df(
self,
dilute_blackbody_radiationfield_state,
):
"""Calculates the mean intensity of the radiation field at each photoionization frequency.
Parameters
----------
dilute_blackbody_radiationfield_state : DilutePlanckianRadiationField
The radiation field.
Returns
-------
pandas.DataFrame
DataFrame of mean intensities indexed by photoionization levels and
columns of cells.
"""
mean_intensity = (

Check warning on line 128 in tardis/plasma/equilibrium/rates/photoionization_strengths.py

View check run for this annotation

Codecov / codecov/patch

tardis/plasma/equilibrium/rates/photoionization_strengths.py#L128

Added line #L128 was not covered by tests
dilute_blackbody_radiationfield_state.calculate_mean_intensity(
self.nu
Expand Down

0 comments on commit 2ea02b2

Please sign in to comment.