Skip to content

Commit

Permalink
try to fix nan issue in Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebe-p committed Aug 23, 2024
1 parent 2b7314f commit 9218510
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rayflare/ray_tracing/rt_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,14 @@ def single_ray_interface(
lookuptable,
)

if np.any(np.isnan([res, theta, phi, theta_loc])):
print("results:", res, theta, phi, theta_loc)
print("info:", ray.r_a, ray.d, mat_index,
surf_index, surf.Lx, surf.Ly,
direction, surf.zcov,
d_theta, 0, wl, Fr_or_TMM, lookuptable)
raise ValueError("NaN value encountered in single_interface_check")

if res == 0: # reflection
direction = -direction # changing direction due to reflection

Expand Down

0 comments on commit 9218510

Please sign in to comment.