def _validate_parameters(data, old_start, old_dt, new_start, new_dt, new_npts):
    """
    Validates the parameters for various interpolation functions.

    Returns the old and the new end.
    """
    if new_dt <= 0.0:
        raise ValueError('The time step must be positive.')
    if data.ndim != 1 or not len(data) or not data.shape[-1]:
        raise ValueError('Not a 1D array.')
    old_end = old_start + old_dt * (len(data) - 1)
    new_end = new_start + new_dt * (new_npts - 1)
    if old_start > new_start or old_end < new_end:
        raise ValueError(
            'The new array must be fully contained in the old array. No extrapolation can be performed.'
            )
    return old_end, new_end
