; list_att
;
; list all peak entries to a file
set tmp = ('tmp' // int(1000000*$random))
open $tmp
fprint $tmp ("# Experiment :"; $cur_exp)
fprint $tmp "# F1    F2   Spin1  Spin2   Amplitude Peak# (Note)"
initinprogress $att["LARGEST"]   set i = 1
foreach pid in att
  inprogress $i  set i = (%+1)
  if ($pid s! "LARGEST") then
	set pk = ($att[$pid])
	set f1 = (head($pk))  set pk = (tail($pk))
	set f2 = (head($pk))  set pk = (tail($pk))
	set amp = (head($pk))  set pk = (tail($pk))
	set sp1 = (head($pk))  set pk = (tail($pk))
	set sp2 = (head($pk))  set pk = (tail($pk))
	if ($sp1 s! "unk") then
	  set sp1 = (tail($spin[$sp1]))
	  set sp1 = (head($sp1) // "-" // head(tail($sp1)))
	endif
	if ($sp2 s! "unk") then
	  set sp2 = (tail($spin[$sp2]))
	  set sp2 = (head($sp2) // "-" // head(tail($sp2)))
	endif
	fprintf $tmp "%6.3f %6.3f %5s %5s %10.0f %4d%s" $f1 $f2 $sp1 $sp2 $amp $pk $pid *
  endif
endfor
close $tmp
inprogress $att["LARGEST"]
sh ("sort"; $tmp; "> peak_list")
formbox "List of Peaks" DO_NOTHING 'File is peak_list' message peak_list text *
sh ("/bin/rm -f";$tmp)
