Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Jan 26, 2024
1 parent ba32c64 commit 87aab3e
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions africanus/averaging/bda_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 87aab3e

Please sign in to comment.