code: def first_up(ofile, Rec, file_type):
      
      keylist = []
      pmag_out = open(ofile, 'a')
      outstring = "tab \t" + file_type + "\n"
      pmag_out.write(outstring)
      keystring = ""
      for key in list(Rec.keys()):
          keystring = keystring + '\t' + key
          keylist.append(key)
      keystring = keystring + '\n'
      pmag_out.write(keystring[1:])
      pmag_out.close()
      return keylist
docs: writes the header for a MagIC template file