(x65,x66,x76) ; Copy angles into header
;
; cpangdo.pam
;
; MASTER COPY: /net/bali/usr1/spider/docs/techs/recon/programs/
;
; CALLED FROM: refine & pub_refine refine.pam & pub_refine.pam
;
; I/O REGISTERS AND FILES ARE SET IN: refine settings refine settings.pam.pam); INPUT REGISTERS:
;
; INPUT REGISTERS (SET ABOVE):
;    x65                          Starting defocus group selector
;    x66                          Ending defocus group selector
;
; INPUT FILES:
;    input/order_select             [order_select]        Image ID doc. fil
;    input/order_select_sort        [sorted_order_select] Input file
;    input/dala{**x76}_{***x77}     [aligned_images]  (overwritten!!)
;
; OUTPUT FILES:
;   input/dala{**x76}_{***x77}      [aligned_images]  (overwritten!!)
;
; CALLS:
;    cpang           cpang.pam
;    publish         publish.perl
;

DO LB5 x78=x65,x66                          ; Loop over defocus group set 
   UD S,x78,x77                             ; Get defocus group number
   [sorted_order_select]

   ; Use pub_refine_start to create parallel cpang for each defocus group   
   VM
   publish './spider pam/$DATEXT @pub_refine_start {**x77} x10=-1 x76={**x76} x77={***x77}' 
     
LB5

;  Wait for all subscribers to finish grploop, returns x47
@pub_refine_wait(x10,x47,x65,x66,x76)

UD ICE                      ; Finished with this doc file 
[order_select]


RE
;