code: def writeHeaderlet(self,**kwargs):
          
          # Insure filehandle is open and available...
          self.openFile()
  
          pars = kwargs.copy()
          rms_pars = self.fit['rms_keys']
  
          str_kw = ['descrip','history','author','hdrfile']
          for kw in str_kw:
              if pars[kw] == '': pars[kw] = None
  
          # Call function with properly interpreted input parameters
          # Syntax: write_headerlet(filename, hdrname, output, sciext='SCI',
          #                    wcsname=None, wcskey=None, destim=None,
          #                    sipname=None, npolfile=None, d2imfile=None,
          #                    author=None, descrip=None, history=None,
          #                    rms_ra=None, rms_dec=None, nmatch=None, catalog=None,
          #                    attach=True, clobber=False):
          headerlet.write_headerlet(self._im.hdu, pars['hdrname'],
                  output=pars['hdrfile'],
                  wcsname=None, wcskey=self.next_key, destim=None,
                  sipname=None, npolfile=None, d2imfile=None,
                  author=pars['author'], descrip=pars['descrip'],
                  history=pars['history'],
                  nmatch=rms_pars['NMATCH'],catalog=pars['catalog'],
                  attach=pars['attach'], clobber=pars['clobber']
              )
docs: Write and/or attach a headerlet based on update to PRIMARY WCS