def METHOD_NAME(filename):
    """Load 3D scalar field from file.
    It supports 3D stack HDF5 files and numpy files.
    :param str filename: Name of the file to open
                         and path in file for hdf5 file
    :return: numpy.ndarray with 3 dimensions.
    """
    if not os.path.isfile(filename.split('::')[0]):
        raise IOError('No input file: %s' % filename)
    if h5py.is_hdf5(filename.split('::')[0]):
        if '::' not in filename:
            raise ValueError(
                'HDF5 path not provided: Use <filename>::<path> format')
        filename, path = filename.split('::')
        path, indices = path.split('#')[0], path.split('#')[1:]
        with h5py.File(filename, mode='r') as f:
            data = f[path]
            # Loop through indices along first dimensions
            for index in indices:
                data = data[int(index)]
            data = numpy.array(data, order='C', dtype='float32')
    else:  # Try with numpy
        try:
            data = numpy.METHOD_NAME(filename)
        except IOError:
            raise IOError('Unsupported file format: %s' % filename)
    if data.ndim != 3:
        raise RuntimeError(
            'Unsupported data set dimensions, only supports 3D datasets')
    return data