def _get_interpolator_nd(method, **kwargs):
    """helper function to select the appropriate interpolator class

    returns interpolator class and keyword arguments for the class
    """
    valid_methods = ['linear', 'nearest']
    try:
        from scipy import interpolate
    except ImportError:
        raise ImportError('Interpolation with method `%s` requires scipy' %
            method)
    if method in valid_methods:
        kwargs.update(method=method)
        interp_class = interpolate.interpn
    else:
        raise ValueError(
            '%s is not a valid interpolator for interpolating over multiple dimensions.'
             % method)
    return interp_class, kwargs
