Skip to content

Commit

Permalink
Added ToDo notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Knights-Templars committed Aug 26, 2024
1 parent bc5c0c6 commit 9f83760
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions tardis/energy_input/gamma_ray_packet_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ def create_packets(
sampled_times = sampled_packets_df.index.get_level_values("time") * (

Check warning on line 781 in tardis/energy_input/gamma_ray_packet_source.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_packet_source.py#L781

Added line #L781 was not covered by tests
u.d
).to(u.s)

# TODO: Rewrite this without for loop. This is expensive
# get the time step index of the packets
decay_time_indices = []
Expand Down Expand Up @@ -868,6 +869,7 @@ def calculate_positron_fraction(self, isotopes, number_of_packets):
"energy_per_channel_keV"
].sum()
# Find the total energy released from gamma-ray per isotope from the dataframe
# TODO: Can be tested with total energy released from all radiation types
gamma_energy_per_isotope = gamma_decay_df.groupby("isotope")[

Check warning on line 873 in tardis/energy_input/gamma_ray_packet_source.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_packet_source.py#L873

Added line #L873 was not covered by tests
"energy_per_channel_keV"
].sum()
Expand Down
14 changes: 6 additions & 8 deletions tardis/energy_input/main_gamma_ray_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def run_gamma_ray_loop(
seed,
positronium_fraction,
spectrum_bins,
time_steps,
grey_opacity,
photoabsorption_opacity="tardis",
pair_creation_opacity="tardis",
Expand Down Expand Up @@ -93,8 +92,6 @@ def run_gamma_ray_loop(
Fraction of positronium.
spectrum_bins : int
Number of spectrum bins.
time_steps : int
Number of time steps.
grey_opacity : float
Grey opacity.
photoabsorption_opacity : str
Expand All @@ -121,6 +118,7 @@ def run_gamma_ray_loop(
ejecta_volume = model.volume.to("cm^3").value
shell_masses = model.volume * model.density
number_of_shells = len(shell_masses)

Check warning on line 120 in tardis/energy_input/main_gamma_ray_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/main_gamma_ray_loop.py#L120

Added line #L120 was not covered by tests
# TODO: decaying upto times[0]. raw_isotope_abundance is possibly not the best name
raw_isotope_abundance = model.composition.raw_isotope_abundance.sort_values(
by=["atomic_number", "mass_number"], ascending=False
)
Expand Down Expand Up @@ -209,9 +207,9 @@ def run_gamma_ray_loop(
]

energy_bins = np.logspace(2, 3.8, spectrum_bins)
energy_out = np.zeros((len(energy_bins - 1), time_steps))
energy_deposited = np.zeros((number_of_shells, time_steps))
positron_energy = np.zeros((number_of_shells, time_steps))
energy_out = np.zeros((len(energy_bins - 1), len(times) - 1))
energy_deposited = np.zeros((number_of_shells, len(times) - 1))
positron_energy = np.zeros((number_of_shells, len(times) - 1))

Check warning on line 212 in tardis/energy_input/main_gamma_ray_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/main_gamma_ray_loop.py#L210-L212

Added lines #L210 - L212 were not covered by tests
packets_info_array = np.zeros((int(num_decays), 8))
iron_group_fraction = iron_group_fraction_per_shell(model)

Check warning on line 214 in tardis/energy_input/main_gamma_ray_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/main_gamma_ray_loop.py#L214

Added line #L214 was not covered by tests

Expand Down Expand Up @@ -270,11 +268,11 @@ def run_gamma_ray_loop(
data=energy_out, columns=effective_time_array, index=energy_bins
)

# deposited energy in ergs
# deposited energy by gamma-rays in ergs
deposited_energy = pd.DataFrame(

Check warning on line 272 in tardis/energy_input/main_gamma_ray_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/main_gamma_ray_loop.py#L272

Added line #L272 was not covered by tests
data=energy_deposited_gamma, columns=times[:-1]
)
# positron energy in ergs
# deposited energy by positrons in ergs
positron_energy = pd.DataFrame(

Check warning on line 276 in tardis/energy_input/main_gamma_ray_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/main_gamma_ray_loop.py#L276

Added line #L276 was not covered by tests
data=energy_deposited_positron, columns=times[:-1]
)
Expand Down

0 comments on commit 9f83760

Please sign in to comment.