Skip to content

Commit

Permalink
Fixed Compton angle sampling, electron radius squared and photoabsorp…
Browse files Browse the repository at this point in the history
…tion opacity
  • Loading branch information
andrewfullard committed Dec 15, 2021
1 parent 10a0b37 commit 41eb63f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tardis/energy_input/calculate_opacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def photoabsorption_opacity_calculation(
* (energy / 100.0) ** -3.0
* ejecta_density
/ MASS_FE
* (1.0 - iron_group_fraction)
* iron_group_fraction
)

return si_opacity + fe_opacity
Expand Down
2 changes: 1 addition & 1 deletion tardis/energy_input/gamma_ray_interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_compton_angle(energy):
z = np.random.random()

# get Compton scattering angle
compton_angle = np.interp(z, theta_angles, theta_distribution)
compton_angle = np.interp(z, theta_distribution, theta_angles)
# Energy calculations
new_energy = energy / (
1.0 + kappa_calculation(energy) * (1.0 - np.cos(compton_angle))
Expand Down
2 changes: 1 addition & 1 deletion tardis/energy_input/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tardis.constants as const
import numpy as np

R_ELECTRON_SQUARED = const.a0.cgs.value * const.alpha.cgs.value ** 2.0
R_ELECTRON_SQUARED = (const.a0.cgs.value * const.alpha.cgs.value ** 2.0) ** 2.0
ELECTRON_MASS_ENERGY_KEV = (const.m_e * const.c ** 2.0).to("keV").value
BOUNDARY_THRESHOLD = 1e-7
KEV2ERG = (1000 * u.eV).to("erg").value
Expand Down

0 comments on commit 41eb63f

Please sign in to comment.