;
Enhanced CTFFIND power spectra
;
; SOURCE: spider/docs/techs/recon/newprogs/enhancepowmrc.spi
;
; PURPOSE : Cut and paste the Spider-generated power spectrum
; onto the model file generated by ctffind
; ----------- Input files ---------------
[sel_mic] = '../sel_micrograph' ; Micrograph selection doc file
[input_dir] = 'power' ; Dir. for input files
[mrc] = [input_dir]'/powchk{****[num]}' ; Power spectrum file from ctffind
[spi] = [input_dir]'/pw_avg{****[num]}' ; Power spectrum file from Spider
; ----------- Output files --------------
[output_dir] = 'power' ; Dir. for output files
[out] = [output_dir]'/powchk-enh{****[num]}' ; SPIDER PS file
; -------------------- END BATCH HEADER -----------------------
DO ; Loop over all files
UD NEXT [key],[num] ; Get micrograph number from sel. file
[sel_mic] ; [num] is now the micrograph file number
IF ([key] .LE. 0) EXIT ; End of images in selection doc file
FI H [nsam],[nrow] ; Get SPIDER PS image size
[spi] ; Spider PS (input)
NSAM,NROW
[nsamd2] = ([nsam]/2)
; Estimate background and subtract it from
; the power spectrum for better visualization
FQ ; Quick filter
[spi] ; Spider PS (input)
_2
(7) ; Filter type (BW LP)
(0.002,0.025) ; Passband, stopband
SU ; Subtract
[spi] ; Spider PS (input)
_2 ; (input)
_3 ; (output)
*
MA ; Mask
_3 ; Filtered file (input)
_4 ; Filt file center masked (output)
(0.0,35) ; Radius of central dot
D ; Disk
E ; External background
(0.0) ; Center coord.
([nsamd2]+1,[nsamd2]+1)
; Resize and recale the background -subtracted spider image
FI H [nsam],[nrow] ; Get image size
[mrc] ; MRC PS (input)
NSAM,NROW ; Header locs
[xc] = ([nsam]/2) + 1 ; Image center
[yc] = ([nrow]/2) + 1
IP ; Rescale image
_4 ; (input)
_1 ; (output)
[nsam],[nrow] ; Scaling factor
WI ; Extract left half of mrc image
[mrc] ; MRC PS (input)
_5
([nsam]/2, [nrow]) ; Dimensions
1,1 ; Upper left coordinates
FS [fmax],[fmin] ; Get max & min values
_5 ; (input)
WI ; Extract right half of spider image
_1 ; (input)
_2 ; (output)
([nsam]/2, [nrow]) ; Dimensions
[xc],1 ; Upper left coordinates
[v40]=[fmax]- [fmin] ; Range of values
[v41]=[fmax]+ ([v40]/2) ; Rescaled max
[v42]=[fmin]- ([v40]/2) ; Rescaled min
AR SCA ; Rescale the spider window
_2 ; (input)
_3 ; Rescaled file (output)
[v42],[v41]
CP ; Copy
[mrc] ; MRC PS (input)
[out] ; Enhanced PS (output)
IN ; Insert image
_3 ; Rescaled file (input)
[out] ; Enhanced PS (output)
([xc],1)
VM
echo ' ' ; echo " Created [out].$DATEXT"
ENDDO
VM
echo ' '
EN