scipy/signal/bsplines.py
def qspline1d_eval(cj, newx, dx=1.0, x0=0):
    """Evaluate a quadratic spline at the new set of points.

    `dx` is the old sample-spacing while `x0` was the old origin.  In
    other-words the old-sample points (knot-points) for which the `cj`
    represent spline coefficients were at equally-spaced points of::

      oldx = x0 + j*dx  j=0...N-1, with N=len(cj)

    Edges are handled using mirror-symmetric boundary conditions.

    """
    newx = (asarray(newx) - x0) / dx
    res = zeros_like(newx)
    if res.size == 0:
        return res
    N = len(cj)
    cond1 = newx < 0
    cond2 = newx > (N - 1)
    cond3 = ~(cond1 | cond2)
    # handle general mirror-symmetry
    res[cond1] = qspline1d_eval(cj, -newx[cond1])
    res[cond2] = qspline1d_eval(cj, 2 * (N - 1) - newx[cond2])
    newx = newx[cond3]
    if newx.size == 0:
        return res
    result = zeros_like(newx)
    jlower = floor(newx - 1.5).astype(int) + 1
    for i in range(3):
        thisj = jlower + i
        indj = thisj.clip(0, N - 1)  # handle edge cases
        result += cj[indj] * quadratic(newx - thisj)
    res[cond3] = result
    return res
Evaluate a quadratic spline at the new set of points.

    `dx` is the old sample-spacing while `x0` was the old origin.  In
    other-words the old-sample points (knot-points) for which the `cj`
    represent spline coefficients were at equally-spaced points of::

      oldx = x0 + j*dx  j=0...N-1, with N=len(cj)

    Edges are handled using mirror-symmetric boundary conditions.

    
Evaluate a quadratic spline at the new set of points.
`dx` is the old sample-spacing while `x0` was the old origin.  In
other-words the old-sample points (knot-points) for which the `cj`
represent spline coefficients were at equally-spaced points of:.



Edges are handled using mirror-symmetric boundary conditions.
Evaluate a quadratic spline at the new set of points . ` dx ` is the old sample - spacing while ` x0 ` was the old origin . In other - words the old - sample points ( knot - points ) for which the ` cj ` represent spline coefficients were at equally - spaced points of : . Edges are handled using mirror - symmetric boundary conditions .
def qspline1d_eval(cj, newx, dx=1.0, x0=0):
    newx = (asarray(newx) - x0) / dx
    res = zeros_like(newx)
    if res.size == 0:
        return res
    N = len(cj)
    cond1 = newx < 0
    cond2 = newx > (N - 1)
    cond3 = ~(cond1 | cond2)
    res[cond1] = qspline1d_eval(cj, -newx[cond1])
    res[cond2] = qspline1d_eval(cj, 2 * (N - 1) - newx[cond2])
    newx = newx[cond3]
    if newx.size == 0:
        return res
    result = zeros_like(newx)
    jlower = floor(newx - 1.5).astype(int) + 1
    for i in range(3):
        thisj = jlower + i
        indj = thisj.clip(0, N - 1)  
        result += cj[indj] * quadratic(newx - thisj)
    res[cond3] = result
    return res
def qspline1d_eval ( cj , newx , dx = 1.0 , x0 = 0 ) : newx = ( asarray ( newx ) - x0 ) / dx res = zeros_like ( newx ) if res . size == 0 : return res N = len ( cj ) cond1 = newx < 0 cond2 = newx > ( N - 1 ) cond3 = ~ ( cond1 | cond2 ) res [ cond1 ] = qspline1d_eval ( cj , - newx [ cond1 ] ) res [ cond2 ] = qspline1d_eval ( cj , 2 * ( N - 1 ) - newx [ cond2 ] ) newx = newx [ cond3 ] if newx . size == 0 : return res result = zeros_like ( newx ) jlower = floor ( newx - 1.5 ) . astype ( int ) + 1 for i in range ( 3 ) : thisj = jlower + i indj = thisj . clip ( 0 , N - 1 ) result += cj [ indj ] * quadratic ( newx - thisj ) res [ cond3 ] = result return res
Evaluate a quadratic spline at the new set of points.
Evaluate a quadratic spline at the new set of points .
"""Evaluate a quadratic spline at the new set of points.

    `dx` is the old sample-spacing while `x0` was the old origin.  In
    other-words the old-sample points (knot-points) for which the `cj`
    represent spline coefficients were at equally-spaced points of::

      oldx = x0 + j*dx  j=0...N-1, with N=len(cj)

    Edges are handled using mirror-symmetric boundary conditions.

    """ # handle general mirror-symmetry # handle edge cases
cj
newx
dx
x0