;
;
; SOURCE: spider/docs/techs/recon/newprogs/plotrefres.spi
; Previously named: plotref.spi Jan 2010 ArDean Leith
;
; PURPOSE: Plots FSC resolution curves for each iteration of refinement
; Plots RSC resolution curves for each group at final iteration of refinement
;
; I/O PARAMETERS AND FILES ARE SET HERE:
;
; ------------ Input files ----------------------------------------
[order] = 'input/sel_group' ; Defocus group selection file
[resolution] = 'final/resolutions' ; File with number of iterations
[dres] = 'dres{**[iter]}' ; Iteration resolution curves
[dbpr] = 'dbpr{**[iter]}_{***[grp]}' ; Resolution curves for defocus groups
[combined] = 'dbpr{**[iter]}' ; Combined resolution curve
; --------------- Output files -------------------------------------
[gnuplot_iter] = 'gnuplot_refi' ; Text file of gnuplot commands (iterations)
[gnuplot_dfgr] = 'gnuplot_refd' ; Text file of gnuplot commands (def groups)
; -------------- END BATCH HEADER ----------------------------------
UD N [niter]
[resolution]
VM
\rm -f [gnuplot_iter]
VM
echo set title \"$DATEXT refinement: iterations \" >> [gnuplot_iter]
VM
echo set xlabel \"Frequency\" >> [gnuplot_iter]
VM
echo set data style lines >> [gnuplot_iter]
; Use a black line (color = -1) for the final curve
VM
echo set linestyle 32 lt -1 >> [gnuplot_iter]
VM
echo "f(x) = 0.5" >> [gnuplot_iter]
VM
echo plot \\ >> [gnuplot_iter]
DO [iter] = 2,[niter]
IF ([iter].EQ.[niter]) THEN ; Last curve gets a thick black line (ls 32)
VM
echo \"final/[dres].$DATEXT\" using 3:5 title \"[dres]\" ls 32, \\ >> [gnuplot_iter]
ELSE
VM
echo \"final/[dres].$DATEXT\" using 3:5 title \"[dres]\" , \\ >> [gnuplot_iter]
ENDIF
ENDDO
VM
echo "f(x) notitle" >> [gnuplot_iter]
VM
gnuplot -persist [gnuplot_iter] &
VM
cat [gnuplot_iter] &
; ==================================================================
; [iter] should be final iteration
UD N [ngrp] ; Get the number of defocus groups
[order]
VM
\rm -f [gnuplot_dfgr]
VM
echo set title \"$DATEXT refinement: defocus groups \" >> [gnuplot_dfgr]
VM
echo set xlabel \"Frequency\" >> [gnuplot_dfgr]
VM
echo set data style lines >> [gnuplot_dfgr]
VM ; Use a black line (color = -1) for the combined curve
echo set linestyle 31 lt -1 >> [gnuplot_dfgr]
;VM
;echo "f(x) = 0.5" >> [gnuplot_dfgr]
VM
echo plot \\ >> [gnuplot_dfgr]
DO [grp] = 1,[ngrp]
VM
echo \"final/[dbpr].$DATEXT\" using 3:5 title \"[dbpr]\", \\ >> [gnuplot_dfgr]
ENDDO
; Combined curve, uses linestyle defined above (ls 31)
VM
echo \"final/[combined].$DATEXT\" using 3:5 title \"[combined]\" ls 31 >> [gnuplot_dfgr]
;VM
;echo "f(x) notitle" >> [gnuplot_dfgr]
VM
gnuplot -persist [gnuplot_dfgr] &
VM
cat [gnuplot_dfgr] &
EN
;