From 78391bcc3b3b19927bff956d838047518c7d0ae5 Mon Sep 17 00:00:00 2001 From: Christian Glaser Date: Fri, 5 Jul 2019 22:23:16 +0000 Subject: [PATCH 1/3] fix sign error in r_p coefficient. Return 0 for transmission coefficients for TIR cases --- NuRadioReco/utilities/geometryUtilities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NuRadioReco/utilities/geometryUtilities.py b/NuRadioReco/utilities/geometryUtilities.py index 634bd9ef..4f9d52c6 100644 --- a/NuRadioReco/utilities/geometryUtilities.py +++ b/NuRadioReco/utilities/geometryUtilities.py @@ -109,6 +109,8 @@ def get_fresnel_t_p(zenith_incoming, n_2=1.3, n_1=1.): of the incoming radiation." """ zenith_outgoing = get_fresnel_angle(zenith_incoming, n_2, n_1) + if(zenith_outgoing is None): + return 0 t = 2 * n_1 * np.cos(zenith_incoming) / (n_1 * np.cos(zenith_outgoing) + n_2 * np.cos(zenith_incoming)) return t @@ -124,6 +126,8 @@ def get_fresnel_t_s(zenith_incoming, n_2=1.3, n_1=1.): of the incoming radiation." """ zenith_outgoing = get_fresnel_angle(zenith_incoming, n_2, n_1) + if(zenith_outgoing is None): + return 0 t = 2 * n_1 * np.cos(zenith_incoming) / (n_1 * np.cos(zenith_incoming) + n_2 * np.cos(zenith_outgoing)) return t @@ -139,7 +143,7 @@ def get_fresnel_r_p(zenith_incoming, n_2=1.3, n_1=1.): of the incoming radiation." """ n = n_2/n_1 - return (-n**2 * np.cos(zenith_incoming) + SM.sqrt(n**2 - np.sin(zenith_incoming)**2)) / \ + return (n**2 * np.cos(zenith_incoming) - SM.sqrt(n**2 - np.sin(zenith_incoming)**2)) / \ (n**2 * np.cos(zenith_incoming) + SM.sqrt(n**2 - np.sin(zenith_incoming)**2)) From 9e8f8d3aecac91154c8c326b404489c46f93d56a Mon Sep 17 00:00:00 2001 From: Christian Glaser Date: Fri, 5 Jul 2019 22:29:53 +0000 Subject: [PATCH 2/3] add link to documentation --- NuRadioReco/utilities/geometryUtilities.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NuRadioReco/utilities/geometryUtilities.py b/NuRadioReco/utilities/geometryUtilities.py index 4f9d52c6..95e8199e 100644 --- a/NuRadioReco/utilities/geometryUtilities.py +++ b/NuRadioReco/utilities/geometryUtilities.py @@ -141,6 +141,8 @@ def get_fresnel_r_p(zenith_incoming, n_2=1.3, n_1=1.): to the 'plane of incident' which is defindes as: "the plane of incidence is the plane which contains the surface normal and the propagation vector of the incoming radiation." + + see https://github.com/nu-radio/NuRadioReco/pull/97 for a derivation of the equation """ n = n_2/n_1 return (n**2 * np.cos(zenith_incoming) - SM.sqrt(n**2 - np.sin(zenith_incoming)**2)) / \ @@ -156,6 +158,8 @@ def get_fresnel_r_s(zenith_incoming, n_2=1.3, n_1=1.): to the 'plane of incident' which is defindes as: "the plane of incidence is the plane which contains the surface normal and the propagation vector of the incoming radiation." + + see https://github.com/nu-radio/NuRadioReco/pull/97 for a derivation of the equation """ n = n_2/n_1 return (np.cos(zenith_incoming) - SM.sqrt(n**2 - np.sin(zenith_incoming)**2)) / \ From cc5abf06af821af2d09e473c42862bd252635328 Mon Sep 17 00:00:00 2001 From: Christian Glaser Date: Fri, 12 Jul 2019 19:04:42 +0000 Subject: [PATCH 3/3] implement alternative function --- NuRadioReco/utilities/geometryUtilities.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NuRadioReco/utilities/geometryUtilities.py b/NuRadioReco/utilities/geometryUtilities.py index 95e8199e..79bfdf76 100644 --- a/NuRadioReco/utilities/geometryUtilities.py +++ b/NuRadioReco/utilities/geometryUtilities.py @@ -147,6 +147,12 @@ def get_fresnel_r_p(zenith_incoming, n_2=1.3, n_1=1.): n = n_2/n_1 return (n**2 * np.cos(zenith_incoming) - SM.sqrt(n**2 - np.sin(zenith_incoming)**2)) / \ (n**2 * np.cos(zenith_incoming) + SM.sqrt(n**2 - np.sin(zenith_incoming)**2)) + + +def get_fresnel_r_p2(zenith_incoming, n_2=1.3, n_1=1.): + n = n_1/n_2 + return (np.cos(zenith_incoming) - 1j * n *(n**2 * np.sin(zenith_incoming) - 1) ** 0.5) / \ + (np.cos(zenith_incoming) + 1j * n *(n**2 * np.sin(zenith_incoming) - 1) ** 0.5) def get_fresnel_r_s(zenith_incoming, n_2=1.3, n_1=1.):