def get_hdf4_file_metadata(filename):
    """
    This returns a dictionary of file attributes, which often contains metadata information
    about the whole file. The value of each attribute can simply be a big string
    which will often need to be parsed manually thereafter.
    :param filename
    :return: dictionary of string attributes
    """
    try:
        from pyhdf.SD import SD
    except ImportError:
        raise ImportError(
            'HDF support was not installed, please reinstall with pyhdf to read HDF files.'
            )
    return SD(filename).attributes()
