([iter],[iter-end],[grp],[s],[bp-type], [prj-rad]) ; Calculate a subset reconstruction for this group
 ;
 ; SOURCE: spider/docs/techs/recon1/Procs/refine-bp.spi   
 ;         For gold standard reconstruction              ArDean Leith  May 2014
 ;
 ; PURPOSE: Calculate a subset reconstruction for this group
 ;          (Note: If large images give memory problems with 'BP CG' switch to: 'BP 3F').  
 ;
 ; INPUT PARMETERS FROM CALLING LINE:   
 ;          [iter]:     Iteration
 ;          [grp]:      Group
 ;          [s]:        Volume Subset
 ;          [bp-type]:  Backprojection method wanted
 ;          [prj-rad]:  Projection radius used
 ;   
 ; '##' denotes iteration, '##+' denotes next iteration, '@' denotes subset,  '***' denotes group
 ; INPUT FILES:
 ;    [sel_parts_s]         input/sel_parts_***_s@   Group particle selection file   (one for this invocation)
 ;    [next_group_align_s]  final/align##+_***_s@    Alignment parameter doc file    (one for this invocation)    
 ;    [temp_out_images]     work/dala_***@ or _8@    Current aligned images template (one for this invocation)
 ;
 ; OUTPUT FILES:
 ;    [group_vol]           work/vol_##+_***_s@      Reconstructed volume            (one from this invocation)
 ;
 ; PARAMETERS:      Set seldom altered parameters here
 [rp-lam]    = 0.2e-7;  0.2e-5           ; BP RP: lambda
 [rp-cor]    = 0.0                       ; BP RP: correction limit
 [rp-iter]   = 50                        ; BP RP: iteration limit
 [rp-mode]   = 0                         ; BP RP: mode
 [rp-min]    = 0.5                       ; BP RP: minimum    (not used in mode 0)
 [rp-max]    = 0.5                       ; BP RP: maximum    (not used in mode 0)
 [rp-smooth] = 0.5                       ; BP RP: smoothing  (not used in mode 0)

 [cg-err]    = 1.0E-5                    ; BP CG: error limit, chi^2 limit
 [cg-chi]    = 0.0                       ; BP CG: chi^2 limit (none)
 [cg-iter]   = 25                        ; BP CG: iteration limit
 [cg-mode]   = 1                         ; BP CG: mode
 [cg-lam]    = 2000                      ; BP CG: weighting

 ; ------------------------------- END BATCH HEADER -------------------------------------------

 MY FL                         ; Flush results file
  
 ; If large images give problems allocating memory in 'BP CG' substitute 
 ;   operation 'BP 3F' for 'BP CG'.  

 [next-iter] = [iter] + 1

 ; Switch to 'BP CG' on last iteration if not already
 [bp-typet] = [bp-type]     ; 
 IF ( [iter] == [iter-end] ) THEN
   [bp-typet] = 1              ; Switch to 'BP CG' 
 ENDIF

 IF ( [bp-typet] == 1 ) THEN

   SYS                         ; Echo progress
     echo -n '  Back projecting with 'BP CG',  Iteration: {%I0%[iter]} Group:{%I3%[grp]}  On: ' ; hostname
   MY FL                       ; Flush results file

   ; Create volume using 'BP CG'  -----------------------------------------
   BP CG                       ; Back Projection - CG
     [temp_out_images]******   ; Current aligned images template     (input)
     [sel_parts_s]             ; Group particle selection doc file   (input)
     [prj-rad]                 ; Radius of restored object
     [next_group_align_s]      ; Alignment parameters doc file       (input)
     L ;  F too slow if big        ; Fourier-based spline interpolation
     [next_group_vol_s]        ; Reconstructed volume                (output)
     [cg-err],[cg-chi]         ; Error limit, chi^2 limit
     [cg-iter],[cg-mode]       ; Iteration limit, mode
     [cg-lam]                  ; Weighting

 ELSEIF ( [bp-typet] == 2 ) THEN

   ; Create volume using 'BP 3F' -----------------------------------------

   SYS                         ; Echo progress
     echo "  Back projecting with 'BP 3F',  Iteration: {%I0%[iter]} Group:{%I3%[grp]}"
   MY FL                       ; Flush results file

   BP 3F                       ; Back Projection - 3D Fourier
     [temp_out_images]******   ; Current aligned images template     (input)
     [sel_parts_s]             ; Group particle selection doc file   (input)
     [next_group_align_s]      ; Alignment parameters doc file       (input)
     [symmetry_doc]            ; Symmetries doc file (* = none)      (input)
     [next_group_vol_s]        ; Reconstructed volume                (output)

 ELSEIF ( [bp-typet] == 3 ) THEN

   ; Create volume using 'BP RP' -----------------------------------------

   SYS                         ; Echo progress
     echo "  Back projecting with 'BP RP',  Iteration: {%I0%[iter]} Group:{%I3%[grp]}"
   MY FL                       ; Flush results file

   BP RP   [niter]             ; [niter] returns # iterations used
     [temp_out_images]******   ; Current aligned images template     (input)
     [sel_parts_s]             ; Group particle selection doc file   (input)
     [prj-rad]                 ; Radius of restored object
     [next_group_align_s]      ; Alignment parameters doc file       (input)
     [symmetry_doc]            ; Symmetries doc file (* = none)      (input)
     [next_group_vol_s]        ; Reconstructed volume                (output)
     [rp-lam],[rp-cor]         ; Lambda, correction limit
     [rp-iter], [rp-mode]      ; Iteration limit, mode
     [rp-min],[rp-max]         ; Minimum, maximum 
     [rp-smooth]               ; Smoothing constant

 ELSEIF ( [bp-typet] ==  4 ) THEN
   
   ; Create volume using 'BP 3N' -----------------------------------------

   SYS                         ; Echo progress
     echo "  Back projecting with 'BP 3N',  Iteration: {%I0%[iter]} Group:{%I3%[grp]}"
   MY FL                       ; Flush results file

   BP 3N
     [temp_out_images]******   ; Current aligned images template     (input)
     [sel_parts_s]             ; Group particle selection doc file   (input)
     [next_group_align_s]      ; Alignment parameters doc file       (input)
     [symmetry_doc]            ; Symmetries doc file (* = none)      (input)
     [next_group_vol_s]        ; Reconstructed volume                (output)

 ENDIF

 MY FL                         ; Flush results file

 RE

 ;