def spherical(lag, range1, sill):  # , nugget=0):
    """
    Spherical variogram model assuming nugget = 0

    Args:
        lag: float or array of lags as # of pixels/cells
        range1 (float): range of spherical model
        sill (float): sill of spherical model

    Returns:
        semivariance as float or array, depending on type(lag)
    """
    nugget = 0.
    range1 = range1 / 1.

    out = nugget + sill * ((1.5 * (lag / range1)) -
                           (0.5 * ((lag / range1) ** 3.0)))
    if isinstance(out, float):
        if lag > range1:
            out = nugget + sill
    else:
        out[lag > range1] = nugget + sill
    return out