([num-grps],[grp-rank]) ;;;EXAMPLE OF USAGE: ;; wait for previous defocus-group ;@pub_refine_wait([num-grps],[grp-rank]) ;x77 ; INPUT REGISTER: defocus-group number ;[sorted_order_select] ; INPUT: defocus-group list ;; Output registers ;; [num-grps] number of defocus-groups ;; [grp-rank] rank of current defocus group ;;;THE FOLLOWING IS NEEDED AFTER COPYING THE ALIGNED IMAGES INTO MEMORY ;; If not last-ranked defocus-group, create temporary file ;if([grp-rank].ne.[num-grps]) then ; vm ; touch jnkdocwait{***x77}.$DATEXT ;endif ; GET GLOBAL INFO @realign-settings(x41,x42,x43,x44,[max-wait]) ; ----------------------- Parameter ----------------------- ; [max-wait] ; maximum headstart for copying stacks before next defocus group starts ; ------------------------ Output ------------------------ ; [dummy_wait_file] ; dummy file created when defocus-group done copying ; -------------------- END BATCH HEADER -------------------- ; GET INFO FROM CALLING BATCH FILE ; get defocus-group number rr x77 ?defocus-group number? ; get defocus-group list fr ?defocus-group sequence?[order_defgrps] ; FIGURE OUT PREVIOUS DEFOCUS-GROUP# ; initialize previous-group# x26=0 ; if previous iteration's head start was used up, jnkdoc will exist de [dummy_wait_file]x77 ; Get #defocus-groups ud n [num-grps] [order_defgrps] ; Loop through defocus-groups do lb1 x20=1,[num-grps] ; Get group# ud ic,x20,x27 [order_defgrps] ; If group# equals current group, exit loop if(x27.eq.x77) then [grp-rank] = x20 ; rank (to trap for >1) goto lb2 endif ; Update previous group# x26=x27 lb1 ; End group-loop lb2 ; jump here when current group found ; close doc ud ice [order_defgrps] ; If not first group if([grp-rank].gt.1) then ; wait for previous group to finish my fl iq sync x29 [dummy_wait_file]x26 (3,-[max-wait]) ; delay, maximum-wait iq fi x18 [dummy_wait_file]x26 if(x18.eq.1) then de [dummy_wait_file]x26 vm echo "Group #{***x77} ({***[grp-rank]}th out of {***[num-grps]}) waited {***x29} seconds for group #{***x26}"; date else vm echo "Group #{***x77} ({***[grp-rank]}th out of {***[num-grps]}) not waiting for group #{***x26} any more"; date endif endif re