def hdr3Dtohdr2D(hdr3D,verbose=True):
    """
    Removing the wavelength component of a hdr, i.e., converting
    the WCS from 3D (lambda,ra,dec) to 2D (ra,dec)

    --- INPUT ---
    hdr3D       The 3D hdr to remove wavelength components from
    verbose     Toggle verbosity

    """
    hdr2D = hdr3D
    for key in list(hdr2D.keys()):
        if '3' in key:
            del hdr2D[key]

    hdr2D['WCSAXES'] = 2
    return hdr2D