code: def removeAllAltWCS(hdulist,extlist):
      
      original_logging_level = log.level
      log.setLevel(logutil.logging.WARNING)
  
      try:
          hdr = hdulist[extlist[0]].header
          wkeys = altwcs.wcskeys(hdr)
          if ' ' in wkeys:
              wkeys.remove(' ')
          for extn in extlist:
              for wkey in wkeys:
                  if wkey == 'O':
                      continue
                  altwcs.deleteWCS(hdulist,extn,wkey)
  
              # Forcibly remove OPUS WCS Keywords, since deleteWCS will not do it
              hwcs = readAltWCS(hdulist,extn,wcskey='O')
  
              if hwcs is None:
                  continue
  
              for k in hwcs.keys():
                  if k not in ['DATE-OBS','MJD-OBS'] and k in hdr:
                      try:
                          del hdr[k]
                      except KeyError:
                          pass
      except:
          raise
  
      finally:
          log.setLevel(original_logging_level)
docs: Removes all alternate WCS solutions from the header