def fixHerschelHeader(header):
    """ 
    Fix nonstandard use of HIERARCH in a Herschel header.
    
    Parameters:
    -----------
    header: astropy.io.fits.header Header object
    
    Returns:
    --------
    hdr: modified copy of the input header
    """
    hdr = header.copy()
    for keywd, value in hdr.items():
        if (keywd[:4] == 'key.'):
            inkey = keywd[4:]
            if (inkey.upper() != value.upper()):
                try:
                    hdr.rename_keyword(inkey, value)
                except ValueError:
                    pass
    return(hdr)