Skip to content

Commit

Permalink
interpolate in log space
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshields committed Jul 18, 2024
1 parent 9d5544c commit 64ba57a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stardis/radiation_field/radiation_field_solvers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def single_theta_trace_parallel(
intensity at each depth point for each frequency in tracing_nus.
"""
# Need to calculate a mean opacity for the traversal between points. Linearly interporlating, but could have a choice for interpolation scheme here.
mean_alphas = (alphas[1:] + alphas[:-1]) * 0.5
mean_alphas = np.exp((np.log(alphas[1:]) + np.log(alphas[:-1])) * 0.5)
taus = (
mean_alphas * geometry_dist_to_next_depth_point.reshape(-1, 1) / np.cos(theta)
)
Expand Down Expand Up @@ -214,8 +214,9 @@ def single_theta_trace(
Array of shape (no_of_depth_points, no_of_frequencies). Output specific
intensity at each depth point for each frequency in tracing_nus.
"""
# Need to calculate a mean opacity for the traversal between points. Linearly interporlating, but could have a choice for interpolation scheme here.
mean_alphas = (alphas[1:] + alphas[:-1]) * 0.5
# Need to calculate a mean opacity for the traversal between points. Linearly interporlating. Van Noort paper suggest interpolating
# alphas in log space. Could have a choice for interpolation scheme here.
mean_alphas = np.exp((np.log(alphas[1:]) + np.log(alphas[:-1])) * 0.5)
taus = (mean_alphas * geometry_dist_to_next_depth_point.reshape(-1, 1))[
:, :, np.newaxis
] / np.cos(thetas)
Expand Down

0 comments on commit 64ba57a

Please sign in to comment.