-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hello,
I am looking at the resample_tim function and I can not work out where the formulation comes from.
This is clearly different from the pulsar handbook and Camillo et al 2000
##THIS CODE IS COPIED FROM SIGPYPROC3, https://github.com/FRBs/sigpyproc3/blob/main/sigpyproc/core/kernels.py
@njit("f4[:](f4[:], f4, f4)", cache=True, parallel=True)
def resample_tim(array: np.ndarray, accel: float, tsamp: float) -> np.ndarray:
nsamps = len(array) - 1 if accel > 0 else len(array)
resampled = np.zeros(nsamps, dtype=array.dtype)
partial_calc = (accel * tsamp) / (2 * CONST_C_VAL)
tot_drift = partial_calc * (nsamps // 2) ** 2
last_bin = 0
for ii in prange(nsamps):
index = int(ii + partial_calc * (ii - nsamps // 2) ** 2 - tot_drift)
resampled[index] = array[ii]
if index - last_bin > 1:
resampled[index - 1] = array[ii]
last_bin = index
return resampled
The version in the handbook and Camollo et al 2000 gives the formulation
In saying that, it seems to work. I have used it successfully to de-modulate the orbit of binaries in Ter 5
Metadata
Metadata
Assignees
Labels
No labels