enterprise/signals/utils.py
def linear_interp_basis(toas, dt=30 * 86400):
    """Provides a basis for linear interpolation.

    :param toas: Pulsar TOAs in seconds
    :param dt: Linear interpolation step size in seconds.

    :returns: Linear interpolation basis and nodes
    """

    # evenly spaced points
    x = np.arange(toas.min(), toas.max() + dt, dt)
    M = np.zeros((len(toas), len(x)))

    # make linear interpolation basis
    for ii in range(len(x) - 1):
        idx = np.logical_and(toas >= x[ii], toas <= x[ii + 1])
        M[idx, ii] = (toas[idx] - x[ii + 1]) / (x[ii] - x[ii + 1])
        M[idx, ii + 1] = (toas[idx] - x[ii]) / (x[ii + 1] - x[ii])

    # only return non-zero columns
    idx = M.sum(axis=0) != 0

    return M[:, idx], x[idx]
Provides a basis for linear interpolation.

    :param toas: Pulsar TOAs in seconds
    :param dt: Linear interpolation step size in seconds.

    :returns: Linear interpolation basis and nodes
    
Provides a basis for linear interpolation.
Provides a basis for linear interpolation .
def linear_interp_basis(toas, dt=30 * 86400):
    x = np.arange(toas.min(), toas.max() + dt, dt)
    M = np.zeros((len(toas), len(x)))
    for ii in range(len(x) - 1):
        idx = np.logical_and(toas >= x[ii], toas <= x[ii + 1])
        M[idx, ii] = (toas[idx] - x[ii + 1]) / (x[ii] - x[ii + 1])
        M[idx, ii + 1] = (toas[idx] - x[ii]) / (x[ii + 1] - x[ii])
    idx = M.sum(axis=0) != 0
    return M[:, idx], x[idx]
def linear_interp_basis ( toas , dt = 30 * 86400 ) : x = np . arange ( toas . min ( ) , toas . max ( ) + dt , dt ) M = np . zeros ( ( len ( toas ) , len ( x ) ) ) for ii in range ( len ( x ) - 1 ) : idx = np . logical_and ( toas >= x [ ii ] , toas <= x [ ii + 1 ] ) M [ idx , ii ] = ( toas [ idx ] - x [ ii + 1 ] ) / ( x [ ii ] - x [ ii + 1 ] ) M [ idx , ii + 1 ] = ( toas [ idx ] - x [ ii ] ) / ( x [ ii + 1 ] - x [ ii ] ) idx = M . sum ( axis = 0 ) != 0 return M [ : , idx ] , x [ idx ]
Provides a basis for linear interpolation.
Provides a basis for linear interpolation .
"""Provides a basis for linear interpolation.

    :param toas: Pulsar TOAs in seconds
    :param dt: Linear interpolation step size in seconds.

    :returns: Linear interpolation basis and nodes
    """ # evenly spaced points # make linear interpolation basis # only return non-zero columns
Linear interpolation basis and nodes
Linear interpolation basis and nodes
toas
Pulsar TOAs in seconds
Pulsar TOAs in seconds
dt
Linear interpolation step size in seconds.
Linear interpolation step size in seconds .