From 87aab3e6b8c346ea1812c0b2d2c36791a23748ca Mon Sep 17 00:00:00 2001 From: Simon Perkins Date: Fri, 26 Jan 2024 13:35:10 +0200 Subject: [PATCH] Remove dead code --- africanus/averaging/bda_mapping.py | 66 ------------------------------ 1 file changed, 66 deletions(-) diff --git a/africanus/averaging/bda_mapping.py b/africanus/averaging/bda_mapping.py index c1b870a8..e5504c4f 100644 --- a/africanus/averaging/bda_mapping.py +++ b/africanus/averaging/bda_mapping.py @@ -20,72 +20,6 @@ class RowMapperError(Exception): pass -# @njit(nogil=True, cache=True) -# def erf26(x): -# """Implements 7.1.26 erf approximation from Abramowitz and -# Stegun (1972), pg. 299. Accurate for abs(eps(x)) <= 1.5e-7.""" - -# # Constants -# p = 0.3275911 -# a1 = 0.254829592 -# a2 = -0.284496736 -# a3 = 1.421413741 -# a4 = -1.453152027 -# a5 = 1.061405429 -# e = 2.718281828 - -# # t -# t = 1.0/(1.0 + (p * x)) - -# # Erf calculation -# erf = 1.0 - (((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t) -# erf *= e ** -(x ** 2) - -# return -round(erf, 9) if x < 0 else round(erf, 0) - - -# @njit(nogil=True, cache=True) -# def time_decorrelation(u, v, w, max_lm, time_bin_secs, min_wavelength): -# sidereal_rotation_rate = 7.292118516e-5 -# diffraction_limit = min_wavelength / np.sqrt(u**2 + v**2 + w**2) -# term = max_lm * time_bin_secs * sidereal_rotation_rate / diffraction_limit -# return 1.0 - 1.0645 * erf26(0.8326*term) / term - - -# _SERIES_COEFFS = (1./40, 107./67200, 3197./24192000, 49513./3973939200) - - -# @njit(nogil=True, cache=True, inline='always') -# def inv_sinc(sinc_x, tol=1e-12): -# # Invalid input -# if sinc_x > 1.0: -# raise ValueError("sinc_x > 1.0") - -# # Initial guess from reversion of Taylor series -# # https://math.stackexchange.com/questions/3189307/inverse-of-frac-sinxx -# x = t_pow = np.sqrt(6*np.abs((1 - sinc_x))) -# t_squared = t_pow*t_pow - -# for coeff in numba.literal_unroll(_SERIES_COEFFS): -# t_pow *= t_squared -# x += coeff * t_pow - -# # Use Newton Raphson to go the rest of the way -# # https://www.wolframalpha.com/input/?i=simplify+%28sinc%5Bx%5D+-+c%29+%2F+D%5Bsinc%5Bx%5D%2Cx%5D -# while True: -# # evaluate delta between this iteration sinc(x) and original -# sinx = np.sin(x) -# š¯˛“sinc_x = (1.0 if x == 0.0 else sinx/x) - sinc_x - -# # Stop if converged -# if np.abs(š¯˛“sinc_x) < tol: -# break - -# # Next iteration -# x -= (x*x * š¯˛“sinc_x) / (x*np.cos(x) - sinx) - -# return x - @njit(nogil=True, cache=True, inline='always') def factors(n):