code: def addWCSKeywords(wcs,hdr,blot=False,single=False,after=None):
      
      wname = wcs.wcs.name
      if not single:
          wname = 'DRZWCS'
  
      # Update WCS Keywords based on PyDrizzle product's value
      # since 'drizzle' itself doesn't update that keyword.
      hdr['WCSNAME'] = wname
      hdr.set('VAFACTOR', value=1.0, after=after)
      hdr.set('ORIENTAT', value=wcs.orientat, after=after)
  
      # Use of 'after' not needed if these keywords already exist in the header
      if after in WCS_KEYWORDS:
          after = None
  
      if 'CTYPE1' not in hdr:
          hdr.set('CTYPE2', value=wcs.wcs.ctype[1], after=after)
          hdr.set('CTYPE1', value=wcs.wcs.ctype[0], after=after)
      hdr.set('CRPIX2', value=wcs.wcs.crpix[1], after=after)
      hdr.set('CRPIX1', value=wcs.wcs.crpix[0], after=after)
      hdr.set('CRVAL2', value=wcs.wcs.crval[1], after=after)
      hdr.set('CRVAL1', value=wcs.wcs.crval[0], after=after)
      hdr.set('CD2_2', value=wcs.wcs.cd[1][1], after=after)
      hdr.set('CD2_1', value=wcs.wcs.cd[1][0], after=after)
      hdr.set('CD1_2', value=wcs.wcs.cd[0][1], after=after)
      hdr.set('CD1_1', value=wcs.wcs.cd[0][0], after=after)
  
      # delete distortion model related keywords
      deleteDistortionKeywords(hdr)
  
      if not blot:
          blendheaders.remove_distortion_keywords(hdr)
docs: Update input header 'hdr' with WCS keywords.