Skip to content

Commit

Permalink
Merge d0e9e23 into 70fcf0b
Browse files Browse the repository at this point in the history
  • Loading branch information
Knights-Templars authored Oct 9, 2023
2 parents 70fcf0b + d0e9e23 commit 05ce224
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tardis/energy_input/gamma_ray_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,27 @@ def initialize_packets(
)


def calculate_shell_masses(model):

Check warning on line 263 in tardis/energy_input/gamma_ray_transport.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_transport.py#L263

Added line #L263 was not covered by tests

"""Function to calculate shell masses
Parameters
----------
model : tardis.Radial1DModel
The tardis model to calculate gamma ray propagation through
Returns
-------
numpy.ndarray
shell masses in units of g
"""

ejecta_density = model.density.to("g/cm^3").value
ejecta_volume = model.volume.to("cm^3").value
shell_masses = ejecta_volume * ejecta_density

Check warning on line 279 in tardis/energy_input/gamma_ray_transport.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_transport.py#L277-L279

Added lines #L277 - L279 were not covered by tests

return shell_masses

Check warning on line 281 in tardis/energy_input/gamma_ray_transport.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_transport.py#L281

Added line #L281 was not covered by tests


def main_gamma_ray_loop(
num_decays,
model,
Expand Down Expand Up @@ -346,7 +367,7 @@ def main_gamma_ray_loop(
by=["atomic_number", "mass_number"], ascending=False
)

shell_masses = ejecta_volume * ejecta_density
shell_masses = calculate_shell_masses(model)

Check warning on line 370 in tardis/energy_input/gamma_ray_transport.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_transport.py#L370

Added line #L370 was not covered by tests

time_start = time_explosion
time_end *= u.d.to(u.s)
Expand Down

0 comments on commit 05ce224

Please sign in to comment.