Loading scripts/pyaudio3dtools/EFAP.py +18 −10 Original line number Diff line number Diff line Loading @@ -496,8 +496,11 @@ class EFAP: ) if mod: if not np.isnan(A[0]): A[0] %= mod if not np.isnan(B[0]): B[0] %= mod if not np.isnan(C[0]): C[0] %= mod if self._in_triangle(P, A, B, C): Loading Loading @@ -560,14 +563,16 @@ class EFAP: return True, None # if the azimuth difference is large, perform the 2D check again with azimuths wrapped to (-360, 0] and [0, 360) # RuntimeWarning due to NaNs can be safely ignored, _in_triangle() accounts for them if np.nanmax(azi) - np.nanmin(azi) > 180: for tri in combinations(poly, 3): A = np.array(self._get_azi_ele(tri[0])) B = np.array(self._get_azi_ele(tri[1])) C = np.array(self._get_azi_ele(tri[2])) if not np.isnan(A[0]): A[0] %= 360 if not np.isnan(B[0]): B[0] %= 360 if not np.isnan(C[0]): C[0] %= 360 if self._in_triangle(P, A, B, C): return True, 360 Loading @@ -576,8 +581,11 @@ class EFAP: A = np.array(self._get_azi_ele(tri[0])) B = np.array(self._get_azi_ele(tri[1])) C = np.array(self._get_azi_ele(tri[2])) if not np.isnan(A[0]): A[0] %= -360 if not np.isnan(B[0]): B[0] %= -360 if not np.isnan(C[0]): C[0] %= -360 if self._in_triangle(P, A, B, C): return True, -360 Loading Loading
scripts/pyaudio3dtools/EFAP.py +18 −10 Original line number Diff line number Diff line Loading @@ -496,8 +496,11 @@ class EFAP: ) if mod: if not np.isnan(A[0]): A[0] %= mod if not np.isnan(B[0]): B[0] %= mod if not np.isnan(C[0]): C[0] %= mod if self._in_triangle(P, A, B, C): Loading Loading @@ -560,14 +563,16 @@ class EFAP: return True, None # if the azimuth difference is large, perform the 2D check again with azimuths wrapped to (-360, 0] and [0, 360) # RuntimeWarning due to NaNs can be safely ignored, _in_triangle() accounts for them if np.nanmax(azi) - np.nanmin(azi) > 180: for tri in combinations(poly, 3): A = np.array(self._get_azi_ele(tri[0])) B = np.array(self._get_azi_ele(tri[1])) C = np.array(self._get_azi_ele(tri[2])) if not np.isnan(A[0]): A[0] %= 360 if not np.isnan(B[0]): B[0] %= 360 if not np.isnan(C[0]): C[0] %= 360 if self._in_triangle(P, A, B, C): return True, 360 Loading @@ -576,8 +581,11 @@ class EFAP: A = np.array(self._get_azi_ele(tri[0])) B = np.array(self._get_azi_ele(tri[1])) C = np.array(self._get_azi_ele(tri[2])) if not np.isnan(A[0]): A[0] %= -360 if not np.isnan(B[0]): B[0] %= -360 if not np.isnan(C[0]): C[0] %= -360 if self._in_triangle(P, A, B, C): return True, -360 Loading