Users' instructions for program locscl ------ ------------ --- ------- ------ c c Robert H. Blessing c Hauptman-Woodward Institute c 73 High St. c Buffalo, NY 14203, USA c Tel. 716-856-9600, ext. 335 c blessing@hwi.buffalo.edu c c Scaling by least-squares fitted local scale factors c c q = c c to improve the accuracy of structure factor magnitude differences c c Delta(F) = F1 - q*F2 c c for SIR F1(native)/F2(derivative) or SAS F1(+h+k+l)/F2(-h-k-l) pairs. c c The local scale factors are evaluated in approximately equidimensional c local blocks of c c n = {[2*m(h) + 1] X [2*m(k) + 1] X [2*m(l) + 1]} - 1 c c reciprocal lattice points surrounding, but excluding, each point hkl. c c B.W. Matthews and E.W. Czerwinski (1975). Local Scaling: a Method to c Reduce Systematic Errors in Isomorphous Replacement and Anomalous c Scattering Measurements. Acta Cryst. A31, 480-497. c c W.A. Hendrickson (1988). Structural Analysis by the Method of c Multiwavelength Anomalous Diffraction. In "Crystallographic c Computing 4", edited by N.W. Isaacs and M.R. Taylor, pp. 97-108. c Oxford: Oxford Univ. Press. And references cited therein. c . . . character atime*8,adate*9,title*72,type*3,ptgp*5, & file1*40,file2*40,form1*11,form2*11 . . . dimension cell(6),ginv(3,3) data ptgp,itype1,itype2,cutoff,cell,mh,mk,ml,i012,zlimit & /' ',14*0/ . . . c c Read control data file "locscl.dat". c io1=10 io2=20 io3=30 ilp=60 open (unit=io1,file='locscl.dat',status='old') read (io1,'(a)') title read (io1,'(a)') type if (type.eq.'sir') type='SIR' if (type.eq.'sas') type='SAS' read (io1,'(a)') file1 if (type.eq.'SIR') read (io1,'(a)') file2 read (io1,*,end=1) itype1 if (type.eq.'SIR') read (io1,*,end=1) itype2 read (io1,*) cutoff read (io1,'(a)') ptgp read (io1,*) (cell(i),i=1,6) read (io1,*,end=1) mh,mk,ml read (io1,*,end=1) i012 read (io1,*,end=1) zlimit 1 close (unit=io1,status='keep') . . . if (cutoff.eq.0) cutoff=3 if (cutoff.lt.0) cutoff=0 . . . c----------------------------------------------------------------------- c c Control data: c ------------ c c title = Job title/crystal name c c type = SAS or SIR = Type of data set pair c c file1 = Name of SAS reflections file OR SIR Native reflections file c (file2 = Name of SIR Derivative reflections file) c c itype1 = File type (see below) of file1 c (itype2 = File type of file2) c c Input reflection data files: c --------------------------- c c For SAS data, one file: c ------------------ c file1 containing both F(+h+k+l) and F(-h-k-l) in separate reflection c records, in any order. c c For SIR data, two files: c ------------------- c file1 for the native data, and c file2 for the derivative data. In both files the reflection records c may be in any order, and the two files need not be of the same type. c c c The files are read in subroutine "read1" according to the values of c itype1 and itype2: c ------ ------ c c itype = 0 ASCII, formatted h,k,l,Fsq,sigFsq,F,sigF,E,sigE c 1 " " h,k,l,Fsq,sigFsq,F,sigF c 2 " " h,k,l,Fsq,sigFsq c 3 " " h,k,l, F,sigF,E,sigE c 4 " " h,k,l, F,sigF c 5 Binary, unformatted h,k,l,Fsq,sigFsq,F,sigF,E,sigE c 6 " " h,k,l,Fsq,sigFsq,F,sigF c 7 " " h,k,l,Fsq,sigFsq c 8 " " h,k,l, F,sigF,E,sigE c 9 " " h,k,l, F,sigF c c c cutoff = minimum F/sigma(F) threshold for input data to be included in c the scaling calculations and the locally scaled output files. c c Default is cutoff = 3. To apply cutoff = 0, enter c cutoff .lt. 0. c c ptgp = Point group symbol c c Must be one of the following case-sensitive character values. c c Tricl. Monocl. Ortho. Tetrag. Trig. Rhomb. Cub. c ------ ------- ------ ------- ----- ------ ---- c 1 2 222 4 3 R3 23 c -1 m mm2 -4 -3 R-3 m3 c 2/m mmm 4/m c 312 R32 432 c 422 321 R3m -43m c 4mm 31m R-3m m3m c -42m 3m1 c -4m2 -31m c 4/mmm -3m1 c c Hexag. c ------ c 6 c -6 c 6/m c c 622 c 6mm c -6m2 c -62m c 6/mmm c c cell = lattice parameters (a, b, c, alpha, beta, gamma) c c mh,mk,ml = semidimensions m(h), m(k), m(l) if fixed semidimensions c are desired for the moving local block of c c n = [2*m(h) + 1]*[2*m(k) + 1]*[2*m(l) + 1] - 1 c c reciprocal lattice points surrounding, but excluding, each c point hkl. c c The default (mh = mk = ml = 0) is to automatically vary and c statistically optimize the semidimensions. c c To bypass the local scale factor fitting and apply constant c local scale factors of unity, supply mh = mk = ml = -1. c c If fixed semidimensions are chosen, choose c mh, mk, ml .le. 12. c c i012 = 0 Keep constant the mean of F1 and F2. c 1 " " " value of F1. c 2 " " " " " F2. c c The default i012 = 0 is recommended. c c zlimit = limiting value of c c abs(Delta) abs(Delta) c ---------- = ----------------------- c sigma 1.25*median[abs(Delta)] c c abs[F1 - F2 - median(F1 - F2)] c = ------------------------------------------- , c 1.25*median{abs[F1 - F2 - median(F1 - F2)]} c c for reflection pairs to be accepted for the output file. c The variable zlimit is used to exclude data with unreliably c large values of abs(F1 - F2) in the tails of the data-set c Delta(F) distribution. c c The zlimit test assumes that the data-set c z = Delta/sigma distribution should approximate a c zero-mean, unit-variance normal distribution, for which c values of z .lt. -zlimit or z .gt. +zlimit are c extremely improbable. c c With the default zlimit = 0 , the zlimit exclusion is not c applied. A recommended trial value is zlimit = 6. c c----------------------------------------------------------------------- subroutine read1 (itype,iunit,iend,h,k,l,f,sigf,e,sige) c c itype = 0 ASCII, formatted h,k,l,Fsq,sigFsq,F,sigF,E,sigE c 1 " " h,k,l,Fsq,sigFsq,F,sigF c 2 " " h,k,l,Fsq,sigFsq c 3 " " h,k,l, F,sigF,E,sigE c 4 " " h,k,l, F,sigF c 5 Binary, unformatted h,k,l,Fsq,sigFsq,F,sigF,E,sigE c 6 " " h,k,l,Fsq,sigFsq,F,sigF c 7 " " h,k,l,Fsq,sigFsq c 8 " " h,k,l, F,sigF,E,sigE c 9 " " h,k,l, F,sigF c integer h e=0 sige=0 1 if (itype.eq.0) read (iunit,*,end=9) h,k,l,y,sigy,f,sigf,e,sige if (itype.eq.1) read (iunit,*,end=9) h,k,l,y,sigy,f,sigf if (itype.eq.2) read (iunit,*,end=9) h,k,l,y,sigy if (itype.eq.3) read (iunit,*,end=9) h,k,l, f,sigf,e,sige if (itype.eq.4) read (iunit,*,end=9) h,k,l, f,sigf if (itype.eq.5) read (iunit, end=9) h,k,l,y,sigy,f,sigf,e,sige if (itype.eq.6) read (iunit, end=9) h,k,l,y,sigy,f,sigf if (itype.eq.7) read (iunit, end=9) h,k,l,y,sigy if (itype.eq.8) read (iunit, end=9) h,k,l, f,sigf,e,sige if (itype.eq.9) read (iunit, end=9) h,k,l, f,sigf if (itype.eq.2.or.itype.eq.7) then if (sigy.le.0) go to 1 call fsqtof (y,sigy,f,sigf) end if if (sigf.le.0) go to 1 return 9 iend=1 return end c----------------------------------------------------------------------- subroutine fsqtof (fsq,sigfsq,f,sigf) if (fsq.lt.0) then f=0 else f=sqrt(fsq) end if if (fsq.le.sigfsq) then sigf=0.5*sqrt(sigfsq) else sigf=0.5*sigfsq/f end if return end c----------------------------------------------------------------------- c c The program prints various data-set and scale-fitting statistics to a c "locscl.lp" output file. c c Output Reflection Files are ASCII, formatted files. c ----------------------- c c The "data.locscl" output file is sorted on the Laue-group unique c ------------- c indices. c The file contains header records that label the data records: c h,k,l,F1,sigma(F1),F2,sigma(F2),E1,sigma(E1),E2,sigma(E2), c where c 1 designates the Native SIR or the +h+k+l SAS data set, and c 2 " " Derivative " " " -h-k-l " " " . c c c The "sort.locscl" output file is sorted on c ------------- c c abs[delta(E)] abs(E1 - E2) c abs[z(E)] = ------------- = --------------------------------- c sigma(delta) sqrt[sigma(E1)**2 + sigma(E2)**2] c c or, in the absence of E values, the analogous z(F). c The file contains header records that label the data records: c h,k,l,F1,sigma(F1),F2,sigma(F2),E1,sigma(E1),E2,sigma(E2),z(E or F). c c c For SAS data the program also writes an "hphn.locscl" output file with c ------------- c separate, adjacent records for the +h+k+l and -h-k-l reflections. c The file contains header records that label the data records: c +h,+k,+l,F1,sigma(F1),E1,sigma(E1); c -h,-k,-l,F2,sigma(F2),E2,sigma(E2). c c-----------------------------------------------------------------------