def force_hdr_to_2D(hdrin):
    """
    A simple function to take in a header and remove items related to 3D or 4D structure -- such as NAXIS3...
    
    Parameters
    ----------
    hdrin : astropy.io.fits.header
        Header object
    
    Returns
    -------
    astropy.io.fits.header
        Output 2D header
    """
    hdr2D = hdrin.copy()
    for item in ['CRVAL3', 'CRPIX3', 'CDELT3', 'CTYPE3', 'CUNIT3', 'NAXIS3',
        'CRVAL4', 'CRPIX4', 'CDELT4', 'CUNIT4', 'CTYPE4', 'NAXIS4',
        'PC03_01', 'PC04_01', 'PC03_02', 'PC04_02', 'PC01_03', 'PC02_03',
        'PC03_03', 'PC04_03', 'PC01_04', 'PC02_04', 'PC03_04', 'PC04_04']:
        try:
            hdr2D.remove(item)
        except:
            pass
        hdr2D['NAXIS'] = 2
    return hdr2D
