Skip to content

Commit

Permalink
individual error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebe-p committed Aug 23, 2024
1 parent 9218510 commit 4459326
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions rayflare/ray_tracing/rt_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,13 +645,28 @@ 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 np.any(np.isnan(res)):
print(res)
print(ray.d, ray.r_a, mat_index, direction)
raise ValueError("NaNs in res")

Check warning on line 651 in rayflare/ray_tracing/rt_matrix.py

View check run for this annotation

Codecov / codecov/patch

rayflare/ray_tracing/rt_matrix.py#L649-L651

Added lines #L649 - L651 were not covered by tests

if np.any(np.isnan(theta)):
print(theta)
print(ray.d, ray.r_a, mat_index, direction)
raise ValueError("NaNs in theta")

Check warning on line 656 in rayflare/ray_tracing/rt_matrix.py

View check run for this annotation

Codecov / codecov/patch

rayflare/ray_tracing/rt_matrix.py#L654-L656

Added lines #L654 - L656 were not covered by tests

if np.any(np.isnan(phi)):
print(phi)
print(ray.d, ray.r_a, mat_index, direction)
raise ValueError("NaNs in phi")

Check warning on line 661 in rayflare/ray_tracing/rt_matrix.py

View check run for this annotation

Codecov / codecov/patch

rayflare/ray_tracing/rt_matrix.py#L659-L661

Added lines #L659 - L661 were not covered by tests

if np.any(np.isnan(theta_loc)):
print(theta_loc)
print(ray.d, ray.r_a, mat_index, direction)
raise ValueError("NaNs in theta_loc")

Check warning on line 666 in rayflare/ray_tracing/rt_matrix.py

View check run for this annotation

Codecov / codecov/patch

rayflare/ray_tracing/rt_matrix.py#L664-L666

Added lines #L664 - L666 were not covered by tests




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

0 comments on commit 4459326

Please sign in to comment.