docs: def _cleanstarlog(file_in):
      """
      cleaning history.data or star.log file, e.g. to take care of
      repetitive restarts.
  
      private, should not be called by user directly
  
      Parameters
      ----------
      file_in : string
          Typically the filename of the mesa output history.data or
          star.log file, creates a clean file called history.datasa or
          star.logsa.
  
      (thanks to Raphael for providing this tool)
  
      """
  
      file_out=file_in+'sa'
      f = open(file_in)
      lignes = f.readlines()
      f.close()
  
      nb    = np.array([],dtype=int)   # model number
      nb    = np.concatenate((nb    ,[  int(lignes[len(lignes)-1].split()[ 0])]))
      nbremove = np.array([],dtype=int)   # model number
      i=-1
  
      for i in np.arange(len(lignes)-1,0,-1):
          line = lignes[i-1]
  
          if i > 6 and line != "" :
              if int(line.split()[ 0])>=nb[-1]:
                  nbremove = np.concatenate((nbremove,[i-1]))
              else:
                  nb = np.concatenate((nb    ,[  int(line.split()[ 0])]))
      i=-1
      for j in nbremove:
          lignes.remove(lignes[j])
  
      fout = open(file_out,'w')
      for j in np.arange(len(lignes)):
          fout.write(lignes[j])
      fout.close()