def fitsheader2dict(hdr, ext=0):
    """
    Convert a fits header object into a dict.  A dict provides more expected
    interface to the data but cannot be written back to a fits file without
    transformation.
    """
    hdict = {}
    for key in hdr:
        hdict[key.lower()] = hdr[key]
    return hdict
