Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a function to calculate shell masses #2434

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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):

"""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

return shell_masses


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)

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