([freq],[iter],[grp],[spfreq]) ; Records resolution in doc file
;
; SOURCE: spider/docs/techs/recon/newprogs/saveresp.pam  
;                       New:               Nov 2003 ArDean Leith
;                       Rewrite            Jun 2004 ArDean Leith 
;                       Rewrite            Jan 2005 ArDean Leith 
;                       Output changed     Feb 2006 ArDean Leith 
;                       Echo               Nov 2010 ArDean Leith 
;
; PURPOSE:  Records resolution where the Fourier shell correlation 
;    drops below threshold (0.5), and  corresponding
;    spatial frequency in a document file.   
;    Resolution = pixel size / spatial frequency
;
; I/O PARAMETERS AND FILES ARE SET HERE:
;
; ------------- Input Registers (Sent on command line) --------------
;
; [freq]        Nyquist frequency                         
; [iter]        Iteration                             
; [grp]         Group                                 
; [spfreq]      Interpolated spatial freq.                
;
; -------------------------- Input files ----------------------------
;
; -------------------------- Output files ---------------------------
;
; -------------------------------------------------------------------

; Read output file name from caller
FR                                     
?Resolution output file?[resol_file]   ; Resolution file (output)

;IF ([iter] .EQ. 1) THEN
;   IF ([grp] .EQ. 1) THEN
;      SD /    Iteration  group   resolution
;      [resol_file]
;   ENDIF
;ENDIF

; Compute resolution
[res] = 0.5 / ([freq]*[spfreq])  ; Resolution = pixel size / spatial freq.

SD [iter], [iter],[grp],[res]    ; Save in doc file
[resol_file]                     ; Resolution file (output)

IF ([grp] .EQ. 0) THEN
   VM
   echo " Iteration: {**[iter]}  Resolution:  {%f6.2%[res]}" 
ENDIF

RE
;