Skip to content

Commit

Permalink
Generate Image Maps script moved to end of merging scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sthennin committed Feb 28, 2014
1 parent 00a2d6c commit 603474a
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 18 deletions.
8 changes: 8 additions & 0 deletions kernel/2dx_merge/scripts-custom/2dx_mergeCustom.script
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# DISPLAY: MergeNCYCLS
# DISPLAY: MergeMPRINT
# DISPLAY: MergeAK
# DISPLAY: AMP_Scale_Factor
# DISPLAY: MergeIWF
# DISPLAY: MergeIWP
# DISPLAY: max_amp_correction
Expand Down Expand Up @@ -84,6 +85,7 @@ set MergeBINSIZ = ""
set MergeNCYCLS = ""
set MergeMPRINT = ""
set MergeAK = ""
set AMP_Scale_Factor = ""
set MergeIWF = ""
set MergeIWP = ""
set max_amp_correction = ""
Expand Down Expand Up @@ -131,6 +133,12 @@ if ( `echo ${RESMIN} ${RESMAX} | awk '{ if ( $1 < $2 ) { s = 1 } else { s = 0 }}
echo "set RESMAX = ${RESMAX}" >> LOGS/${scriptname}.results
endif
#
if ( ${AMP_Scale_Factor}x == ‘x’ ) then
set AMP_Scale_Factor = 0.001
echo "set AMP_Scale_Factor = ${AMP_Scale_Factor}" >> LOGS/${scriptname}.results
${proc_2dx}/linblock "WARNING: AMP_Scale_Factor corrected to ${AMP_Scale_Factor}"
endif
#
if ( ${MergeAK}x == 'x' ) then
set MergeAK = "10"
echo "set MergeAK = ${MergeAK}" >> LOGS/${scriptname}.results
Expand Down
8 changes: 8 additions & 0 deletions kernel/2dx_merge/scripts-standard/2dx_finalmerge.script
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
# DISPLAY: scalimamp3d_rref
# DISPLAY: scalimamp3d_BXYMINMAX
# DISPLAY: scalimamp3d_BZMINMAX
# DISPLAY: AMP_Scale_Factor
# DISPLAY: scalimamp3d_BEXTRA
#
#$end_local_vars
Expand Down Expand Up @@ -104,6 +105,7 @@ set MergeIWP = ""
set MergeLatLine_MaxAmpFactor = ""
set MergeLatLine_REDUCAC = ""
set max_amp_correction = ""
set AMP_Scale_Factor = ""
set merge_ML_data = ""
set plotres_rings = ""
set lattice = ""
Expand Down Expand Up @@ -159,6 +161,12 @@ if ( `echo ${RESMIN} ${RESMAX} | awk '{ if ( $1 < $2 ) { s = 1 } else { s = 0 }}
echo "set RESMAX = ${RESMAX}" >> LOGS/${scriptname}.results
endif
#
if ( ${AMP_Scale_Factor}x == ‘x’ ) then
set AMP_Scale_Factor = 0.001
echo "set AMP_Scale_Factor = ${AMP_Scale_Factor}" >> LOGS/${scriptname}.results
${proc_2dx}/linblock "WARNING: AMP_Scale_Factor corrected to ${AMP_Scale_Factor}"
endif
#
if ( ${MergeAK}x == 'x' ) then
set MergeAK = "10"
echo "set MergeAK = ${MergeAK}" >> LOGS/${scriptname}.results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# #
#############################################################################
#
# SORTORDER: 70
# SORTORDER: 92
#
# MANUAL: This script makes use of MRC and CCP4 commands to generate the projection maps of all selected images, using the latest phase origin settings.
#
Expand Down
8 changes: 8 additions & 0 deletions kernel/2dx_merge/scripts-standard/2dx_merge.script
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
# DISPLAY: Merge_Reference_HKMAX
# DISPLAY: MergeAK
# DISPLAY: MergeIWF
# DISPLAY: AMP_Scale_Factor
# DISPLAY: MergeIWP
# DISPLAY: MergeLatLine_MaxAmpFactor
# DISPLAY: MergeLatLine_REDUCAC
Expand Down Expand Up @@ -84,6 +85,7 @@ set realang = ""
set ALAT = ""
set SYM = ""
set merge_ref_num = ""
set AMP_Scale_Factor = ""
set avrgamphsNUMBER = ""
set avrgamphsRESOL = ""
set ILIST = ""
Expand Down Expand Up @@ -244,6 +246,12 @@ endif
#
echo "<<@progress: 5>>"
#
if ( ${AMP_Scale_Factor}x == ‘x’ ) then
set AMP_Scale_Factor = 0.001
echo "set AMP_Scale_Factor = ${AMP_Scale_Factor}" >> LOGS/${scriptname}.results
${proc_2dx}/linblock "WARNING: AMP_Scale_Factor corrected to ${AMP_Scale_Factor}"
endif
#
if ( ${MergeAK}x == 'x' ) then
set MergeAK = "10"
echo "set MergeAK = ${MergeAK}" >> LOGS/${scriptname}.results
Expand Down
8 changes: 8 additions & 0 deletions kernel/2dx_merge/scripts-standard/2dx_mergeRefine.script
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# DISPLAY: MergeHKMAX
# DISPLAY: Merge_Reference_HKMAX
# DISPLAY: MergeLatLine_REDUCAC
# DISPLAY: AMP_Scale_Factor
# DISPLAY: ILIST
# DISPLAY: MergeIPAT
# DISPLAY: MergeDELPLT
Expand Down Expand Up @@ -107,6 +108,7 @@ set realang = ""
set ALAT = ""
set MergeStepSize = ""
set IBOXPHS = ""
set AMP_Scale_Factor = ""
set SYM = ""
set avrgamphsNUMBER = ""
set avrgamphsRESOL = ""
Expand Down Expand Up @@ -221,6 +223,12 @@ if ( `echo ${RESMIN} ${RESMAX} | awk '{ if ( $1 < $2 ) { s = 1 } else { s = 0 }}
echo "set RESMAX = ${RESMAX}" >> LOGS/${scriptname}.results
endif
#
if ( ${AMP_Scale_Factor}x == ‘x’ ) then
set AMP_Scale_Factor = 0.001
echo "set AMP_Scale_Factor = ${AMP_Scale_Factor}" >> LOGS/${scriptname}.results
${proc_2dx}/linblock "WARNING: AMP_Scale_Factor corrected to ${AMP_Scale_Factor}"
endif
#
if ( ${MergeAK}x == 'x' ) then
set MergeAK = "10"
echo "set MergeAK = ${MergeAK}" >> LOGS/${scriptname}.results
Expand Down
12 changes: 12 additions & 0 deletions kernel/config/2dx_master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2821,6 +2821,18 @@ set Merge_Reference_HKMAX = "20"
# USERLEVEL: SIMPLE
set ILIST = "y"
#
# LABEL: AMP_Scale_Factor
# LEGEND: Defines a down-scaling factor to reduce the AMPLITUDES and also the BACKGROUND measurements in the dataset. This may be needed to make sure the values for SIGF stay below 999.0, which is the signal for invalid measurements. You could use a AMP_Scale_Factor value of 0.001.
# EXAMPLE: AMP_Scale_Factor = 0.001
# HELP: http://2dx.org/documentation/2dx-software/parameters/Merging
# TYPE: Float "MIN=0.0;MAX=1.0;DEFAULT=0.001"
# LOCKED: YES
# INHERITABLE_UPON_INIT: YES
# SYNC_WITH_UPPER_LEVEL: NO
# USERLEVEL: ADVANCED
# ISWRONG: YES
set AMP_Scale_Factor = "0.001"
#
# LABEL: MergeAK
# LEGEND: Defines the relative weights for phases with respect to amplitudes, for lattice line generation. If your Defocus is determined very precisely, then the Thon rings are well placed and the amplitudes are more reliable. In that case, you can use a smaller value (e.g. 2.0). If the defocus values are not too reliable, then a larger value of 3.0 or 4.0 might work better.
# EXAMPLE: MergeAK = 3.0
Expand Down
47 changes: 31 additions & 16 deletions kernel/mrc/source/2dx_latlinek.for
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,17 @@ C
FMERIT = ABS(COS(AMIN1(ABS(SIGPHI(J)),90.0)/CNV))
if(FMERIT.lt.0.00001)FMERIT=0.0

if(SIGF(J).gt.99998)then
CHEN>
C if(FMERIT.lt.0.5 .or. NOBS.le.8 .or.abs(SIGF(J)).gt.99998.0)then
C F=0.0
C FOUT(J)=0.0
C SIGF=0.0
C SIGF(J)=0.0
C FMERIT=0.0
C SIGOUT=100.0
C endif
CHEN<
if(abs(SIGF(J)).gt.99998)then
FMERIT=0.0
SIGOUT=100.0
endif
Expand Down Expand Up @@ -709,28 +719,34 @@ CHENN>
C95 WRITE(6,4000) NPRO,NPROMX
95 WRITE(6,4000) NPROF,NPROMX
CHENN<
GOTO 99
GOTO 991
96 WRITE(6,4100) NOBS,NOBSMX
GOTO 99
GOTO 991
97 WRITE(6,4200) NCALC,NCALMX
GOTO 99
GOTO 991
98 WRITE(6,4300) NPLT,NPLTMX
4000 FORMAT(/,/,' TOO MANY POINTS IN PROFILE!! FOUND= ',I8,
GOTO 991
4000 FORMAT(/,/,':: TOO MANY POINTS IN PROFILE!! FOUND= ',I8,
. ' MAX= ',I8)
4100 FORMAT(/,/,' TOO MANY OBSERVED DATA POINTS!! FOUND= ',I8,
4100 FORMAT(/,/,':: TOO MANY OBSERVED DATA POINTS!! FOUND= ',I8,
. ' MAX= ',I8)
4200 FORMAT(/,/,' TOO MANY LATTICE POINTS!! FOUND= ',I8,
4200 FORMAT(/,/,':: TOO MANY LATTICE POINTS!! FOUND= ',I8,
. ' MAX= ',I8)
4300 FORMAT(/,/,' TOO MANY POINTS TO PLOT!! FOUND= ',I8,
4300 FORMAT(/,/,':: TOO MANY POINTS TO PLOT!! FOUND= ',I8,
. ' MAX= ',I8)

C Output of overall statistics
99 WRITE(6,4400) NFSUM,NPSUM,RFSUM/NFSUM,RMSPSUM/NPSUM,
. WRFSUM/WSUMSUM,SQRT(WRMSPSUM/WNPSUM)
CHENN>
99 continue
OPEN(UNIT=17,FILE='latline.statistics',STATUS='NEW')
WRITE(17,4400) NFSUM,NPSUM,100.0*RFSUM/NFSUM,RMSPSUM/NPSUM,
. 100.0*WRFSUM/WSUMSUM,SQRT(WRMSPSUM/WNPSUM)
CLOSE(17)
991 continue
C-------Skip writing the above latline.statistics file,
C-------to produce a crash to notice the problem in this program.
WRITE(6,4400) NFSUM,NPSUM,RFSUM/NFSUM,RMSPSUM/NPSUM,
. WRFSUM/WSUMSUM,SQRT(WRMSPSUM/WNPSUM)
CHENN<
4400 FORMAT(/,' Overall statistics :',/,
. ' Number of amplitudes observed==========',I8,/,
Expand Down Expand Up @@ -1043,7 +1059,11 @@ C
1001 FORMAT(' Scale factor= ',G14.5,/)
C
IF (IFLAG.EQ.0) GOTO 90
IF (D .LT. 1.E-30) WRITE(6,2002)
CHEN>
if (D .LT. 1.E-30) then
WRITE(6,2002)
endif
CHEN<
2002 FORMAT(/,' ********** WARNING DETERMINANT NEAR ZERO : ',
.' SIGMAS CALCULATED FOR THIS LINE, BUT SUSPECT !!! *****')

Expand Down Expand Up @@ -2030,10 +2050,6 @@ C
CHEN>
ZMM=ZRANG*ZMAG
ZMAGlocal=ZMAG
write(6,'(''XPLTSIZ='',F12.3)')XPLTSIZ
write(6,'(''YPLTSIZ='',F12.3)')YPLTSIZ
write(6,'(''ZMIN,ZMAX='',2F12.3)')ZMIN,ZMAX
write(6,'(''ZMM,ZMAG='',2F12.3)')ZMM,ZMAG
6 continue
ZMMlocal=ZRANG*ZMAGlocal
IF (ZMMlocal .GT. 75.0) GOTO 7
Expand All @@ -2043,7 +2059,6 @@ CHEN>
CHEN<
7 continue
ZERO=-ZMIN*ZMAG
write(6,'(''ZERO='',F12.3)')ZERO
C
C DRAW AXES FOR AMPLITUDE BOX
C
Expand Down
13 changes: 13 additions & 0 deletions kernel/mrc/source/2dx_latlinprescal.for
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ C
RMAXVAL=1.0
write(*,'(''This is corrected to= '',F12.1)')RMAXVAL
endif
C
write(*,'(/,''Give Scale Factor to downscale AMP and BCK (e.g. 0.001):'')')
READ(5,*)RSCALEFAC
if(RSCALEFAC.lt.0.000001)RSCALEFAC=0.001
if(RSCALEFAC.gt.1.0)RSCALEFAC=1.0
write(*,'(''Scale Factor for AMPlitudes and BACKground values is '',F16.9)')
write(*,'(''Use this to make sure that the SIGF values stay below 999.0'')')
write(*,'(''so that errors can be encoded with that number'')')
C
NPASS=0
NOUT=0
Expand All @@ -98,6 +106,11 @@ C
READ(czeile,*,ERR=18)
1 IHM,IKM,ZM,AMP,PHASE,IFILM,IQ,WTFACTOR,BCK,CTF
C
CHEN>
RSCALEFAC=0.0001
AMP=AMP*RSCALEFAC
BCK=BCK*RSCALEFAC
CHEN<
C write(*,'('' read: '',2I,3F,2I,3F)')
C 1 IHM,IKM,ZM,AMP,PHASE,IFILM,IQ,WTFACTOR,BCK,CTF
C
Expand Down
4 changes: 3 additions & 1 deletion kernel/proc/2dx_merge_latline_sub.com
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,17 @@ eot
echo "1001,${zminmax} ! NSER,ZMIN,ZMAX " >> LOGS/latlinprescal.log
echo "${MergeIQMAX} ! IQMAX " >> LOGS/latlinprescal.log
echo "${max_amp_correction} ! Max_Amp_Correction" >> LOGS/latlinprescal.log
echo "${AMP_Scale_Factor} ! AMP_Background_Scale Factor" >> LOGS/latlinprescal.log
echo "eot " >> LOGS/latlinprescal.log
echo " " >> LOGS/latlinprescal.log
echo "Running: " >> LOGS/latlinprescal.log
echo "======== " >> LOGS/latlinprescal.log
#
#
${bin_2dx}/2dx_latlinprescal.exe << eot >> LOGS/latlinprescal.log
1001,${zminmax} ! NSER,ZMIN,ZMAX
${MergeIQMAX} ! IQMAX
${max_amp_correction} ! Max_Amp_Correction
${AMP_Scale_Factor} ! AMP_Background_Scale Factor
eot
#
\rm -f fort.1
Expand Down Expand Up @@ -206,6 +207,7 @@ echo "${MergeIGUESS},${MergeBINSIZ} # IGUESS,BINSIZ"
echo "${MergeNCYCLS},${MergeMPRINT} # NCYCLS,MPRINT"
echo "${idoh},${idok} # H,K indices to plot. 0 0 = all."
echo "${IAQP2},${iplterr},${imaxIQplot} # IAQP2: 1=y,0=n, iplterr=1:errbar in PHS, maxIQ for PSplot"
echo "${RMAXAMP}"
echo " "
#
${bin_2dx}/2dx_latlinek.exe << eot > LOGS/2dx_latlinek.log
Expand Down

0 comments on commit 603474a

Please sign in to comment.