def METHOD_NAME(spatial_grad):
    """Compute energy contribution due to penalized gradient, in TV-L1 model.
    Parameters
    ----------
    spatial_grad : ndarray, shape (4, nx, ny, nx)
       precomputed "gradient + id" array
    Returns
    -------
    out : float
        Energy contribution due to penalized gradient.
    """
    tv_term = np.sum(
        np.sqrt(np.sum(spatial_grad[:-1] * spatial_grad[:-1], axis=0))
    )
    l1_term = np.abs(spatial_grad[-1]).sum()
    return l1_term + tv_term