'Returns a dictionary detailing information about the locations
of this HDU within any associated file.  The values are only
valid after a read or write of the associated file with no
intervening changes to the `HDUList`.
Returns
dict or None
The dictionary details information about the locations of
this HDU within an associated file.  Returns `None` when
the HDU is not associated with a file.
Dictionary contents:
Key        Value
file       File object associated with the HDU
filemode   Mode in which the file was opened (readonly, copyonwrite,
update, append, ostream)
hdrLoc     Starting byte location of header in file
datLoc     Starting byte location of data block in file
datSpan    Data size including padding'

def fileinfo(self):

    if (hasattr(self, '_file') and self._file):
        return {'file': self._file, 'filemode': self._file.mode, 'hdrLoc': self._header_offset, 'datLoc': self._data_offset, 'datSpan': self._data_size}
    else:
        return None
