xmerge



NAME

     xmerge - Merge and scale two data files.



USAGE

     xmerge data1.fin data2.fin



DESCRIPTION

     data2.fin is merged and scaled to  data1.fin.  The  data  in
     file  2  is  scaled  to  match  that  in file1.  The data in
     data1.fin is referred to as f1 and that in data2.fin is f2.

               crystal info needed:     cell.



METHOD

     The data is scaled into n bins based on  sin(theta)/lambda2.
     Two  scaling  methods are available: single and anisotropic.
     In single scaling, a single parameter is used to  scale  the
     data in each bin such that

                         sum(f1)=sum(f2)*scale.

     If Bijovet pairs exist, they are averaged for  scaling  pur-
     poses. In anisotropic scaling first single parameter scaling
     is done and then a 6 parameter scaling such that the scaling
     parameter  is a function of the three crystal indices.  This
     helps minimize errors due to differential  absorption,  etc.
     The formula used for the scale factor s at each h,k,l is:

     s = h*h*a11 + k*k*a22 + l*l*a33 + h*k*a12 + h*l*a13 + k*l*a23

     where a is found by a least-squares fitting procedure.   The
     fitting  procedure  may  fail  if too few data are used.  In
     this case you have two choices: decrease the number of  bins
     to  put  more data in each bin or use single parameter scal-
     ing.



OPERATION

     Fin File 1
          The "standard" data set, as  the  second  fin  file  is
          scaled to this one.  Normally use your best native data
          here.


     Fin File 2
          The fine file containing the data to be scaled  to  fin
          file 1.  Normally derivative or mutant data.


     Output File
          The merged and scaled data.  The name  should  indicate
          which  data  was  used to make this file.  (See example
          below.)


     Output type
          You can output your data in either fin  or  df  format.
          fin  format merges f1 and f2 (Bijovet's = f+ and f-) in
          the input fin file so that the output fin file also has
          only two fields.  All fields are preserved in a df file
          so that Bijvoet information is preserved for both input
          files.   Since df files can always be turned into a fin
          file with xdftofin,  this is the more useful of the two
          options.


     Output
          Reflections in common means that reflection must be  in
          both file1 and file2.  All reflections are all of those
          in file 1 and those in common in file2.  If  a  reflec-
          tion  is  in file2 but not in file 1 it is not  used or
          output.


     Number of bins
          The   data   is   divided   into    bins    based    on
          sin(theta)/lambda squared.  This slider sets the number
          of bins with 10 as the default.  Not that  dividing  by
          the  square  does  not put equal numbers of reflections
          into the bins as  would  sin(theta)/lambda  cubed,  but
          provides a better distribution in reciprocal space.  If
          there are too few reflections in a bin  the  number  of
          bins  should  be  decreased  to put more reflections in
          each bin.  For anisotropic scaling  about  500  reflec-
          tions  per  bin  are good with 50 being a good minimum.
          Too many bins will decrease the signal by scaling  away
          any  differences,  and too few may not adequately scale
          the two data sets. Note: On sliders, if  you  edit  the
          number with the keyboard, be sure to hit <CR> to regis-
          ter the new value.


     Sigma Cut
          The data is excluded from the scaling equations if  its
          amplitude  is  less  than sigma cut times  the sigma of
          the  amplitude.    Usually  makes   little   difference
          because these data are weak anyway.


     Scaling type
          Sets  the  scaling  method  used  as  explained  above.
          Anisotropic scaling is actually single scaling followed
          by anisotropic scaling.   If there are too few  reflec-
          tions  for anisotropic scaling you will get errors.  In
          this case decrease the number of  bins  or  use  single
          scaling.


     Graph
          Two results are graphed in the graphics window:  delta,
          the  abs(f1  -  s*f2)  (  dashed line) and the R-factor
          abs(f1 -f2*s)/f1 (solid line) for each  shell.   For  a
          heavy  atom  derivative the delta should start high and
          decrease with resolution.  If it  starts  to  increase,
          this  may  mean  that the derivative is non-isomorphous
          past this resolution.   The  R-factor  should  smoothly
          change with each bin.  If not then use fewer bins.


     History File
          The history file contains in  addition  to  the  normal
          information  a  list  of the scale, r-factor, abs delta
          for each resolution bin.



EXAMPLES

     To scale a native data set to a derivative data set:

             xmerge ccpnat4.fin ccppt1.fin ccpnat4pt1.df

     You can use this file as input to xfft to make  a  patterson
     map which can be contoured with xcontur.


     Advanced Example

     In some instances you may wish to scale data in a single fin
     file  to  itself.  For example, if you wish to scale Bijvoet
     pairs.  In this case, you must first split the file and then
     remerge  and  scale.  For  example, to scale unscaled.fin to
     scaled.fin  (  remember   a   fin   file   is   records   of
     h,k,l,f+,s(f+),f-,s(f-)) you can use the following commands:

  awk '{print $1,$2,$3,$4,$5,$4,$5}' unscaled.fin > unscaled_fp.fin
  awk '{print $1,$2,$3,$6,$7,$6,$7}' unscaled.fin > unscaled_fm.fin
  xmerge unscaled_fp.fin unscaled_fm.fin scaled.fin



VERSION

     Release 3.2 of XtalView




SEE ALSO

     xtalview(1), xcontur(1), xfft(1)