xfft



NAME

     xfft - calculate an electron  density  map  or  a  Patterson
     function map by the Fast Fourier Transform method.



USAGE

     xfft phasefile mapfile



DESCRIPTION

     Crystal
          A crystal file is needed with the cell and symm records
          present.   Note that symm records should have centering
          expanded explicitly.  (i.e.,  C2  should  have  8  symm
          operators  not  4  with the last 4 1/2+x,1/2+y,z of the
          first 4.)


     Unit Cell
          This is obtained from the crystal file. However, it can
          be overwritten by manually entering a value.  But there
          is no way to overwrite the symmetry operators.


     Defaults
          A defaults file (hardwired  as  xfft.defaults)  can  be
          saved  or  loaded.   Also,  defaults  can  be  reset to
          startup values.  This is  handy  when  you  recalculate
          maps  often  with  the same parameters.   Note that you
          can save a defaults file and then copy it to a new name
          and  then  copy  it  back at a later date.  In this way
          several standard methods can be saved.


     Direction of Planes
          The output can be in x, y, or z planes.  This  is  only
          necessary  for  possible  use of the output map by non-
          XtalView programs as all XtalView programs can read all
          3 sort orders.


     Map Type
          There are several choices of  map  coefficients  avail-
          able.


     Input File
          This file can  have  several  different  formats.   For
          Fourier maps either the phs format (h,k,l,fo,fc,phi) or
          XPLOR format can be used.  For Pattersons these can  be
          used plus fin and df formats.

     Type Specifies the type of input file.  For Pattersons  with
          df  formats  there  are  three choices for defining the
          difference to be used in computing the Patterson  coef-
          ficients.   Which  you use depends upon what is in each
          of the 4 columns in the df file.  Normally,  columns  1
          and  2  are  native data and its sigma's, and columns 3
          and 4 are isomorphous data (a column is a pair of f and
          sigma(f)).  To make an isomorphous difference Patterson
          map use (3+4) - (1+2) which means the average of 1  and
          2  minus the average of 3 and 4 or FPH - FP.  Note that
          when calculating the average missing  observations  are
          not included.


     Resolution Filter
          Set these values to  your  desired  limits.   Order  is
          unimportant  since  computers  are perfectly capable of
          figuring out which number is the min and which  is  the
          max (the other one).


     Outlier Filter
          This gets rid of outliers when making  Patterson  maps.
          Specifically  if  the absolute value  of the difference
          is greater than x percent of the  average  of  the  two
          observations,  the  reflection  is  rejected.   This is
          important when making Patterson maps so that a few  bad
          apples  don't  spoil  the  whole bunch.  A value of 100
          percent is a  conservative  value  to  use.   Note:  On
          numeric  fields  you  must enter return if you edit the
          data with the keyboard to register the edit.


     Read Phase File
          This button reads in  the  data.   It  is  usually  not
          necessary  to use it since the calculate button (below)
          can figure out if the data needs to be read  in.   How-
          ever,  sometimes  you  may  want  to  find out the grid
          before calculating the map, or you may have changed the
          input  data  file  and want to force a rereading of the
          input data. In any case, after reading  the  data  some
          useful information is printed in the message window for
          you to edit.  Also, if you change any of the data above
          this  button after calculating a map, you must use this
          button to have that change take effect.


     Grid Number in X, Y, Z
          This is the number of points in x, y and z to  be  used
          in  calculating  the FFT.  The FFT method used requires
          these to be multiples of 2,3,5 and 7 and nx to be even.
          The  program  restricts  you to these values if you use
          the little arrows by the grid  values  to  increase  or
          decrease  them.   Usually you do not need to set nx, ny
          and nz directly as explained below.


     OR Percentage of minimum resolution
          This sets the grid to the next largest value that  will
          give  a  grid  spacing  that is equal to the minimum d-
          spacing or resolution times the percentage.  For  exam-
          ple:   if the input data had a minimum d-spacing of 2.0
          and 50% is chosen, the grid will be set as close to 1.0
          Angstroms  as  possible.  If the cell edge was say 48.3
          A, then 48.3 is tried, but since this is not an integer
          it  is rounded up to 49.  An FFT requires that the grid
          be at least 50% of the minimum d-spacing  (actually  it
          is has to be twice the maximum index input but it works
          out to the same thing as the reader can  verify).   The
          map  will  be  smoother  if  33% (the default) is used.
          More than this usually has little benefit in  smoothing
          the  map  and requires much more storage since the size
          of the map goes up as the cube of the grid  size.   Set
          this field to zero to prevent overriding the nx, ny, nz
          fields.


     OR approximate spacing in Angstroms
          If both nx, ny, nz and percent  of  minimum  resolution
          are  0  then  this  field  is used to set nx, ny, nz by
          finding the nx, ny, nz that  gives  the  closest  grid-
          spacing  in  Angstroms  that  is also a valid FFT grid.
          For example if you have a 77.77 E cell edge and ask for
          a 1.0 Angstrom grid then 78 is tried, but since this is
          not a multiple of 2,3,5, or 7,  80 is used.


     Output Map File
          The XtalView convention is to use the  extension  .map.
          This file is in FSFOUR binary FORTRAN format.


     Calculate
          This is the "Apply" button.  When it is pressed the FFT
          is  calculated and the map output.  If the FFT is large
          then it may take several minutes to return.   The  pro-
          gram  tries to ascertain if the data needs to be reread
          if you change various values.  It  usually  decides  to
          reread even when it is strictly unnecessary.



ADVANCED USAGE

     If you want a coefficients type that is not  available,  you
     can  always  precalculate them and put them in the Fo column
     and then make an Fo map.

     Example: to make a 3Fo-2Fc map using awk and xfft:


awk '{print $1,$2,$3,3*$4-2*$5,$6}' input.phs | xfft - output.map


     In XtalView, a dash (-) means use stdin for input  files  or
     stdout for output files.  At other times, a binary file with
     the phases is used.  For example,  to  use  a  Furey  format
     phasit  output  file (fort.31) using dumpphasit which writes
     its output on stdout:

          dumpphasit fort.31 | xfft - output.map

     Unfortunately, if you use stdin or stdout for I/O  then  the
     history  file  will know only that stdin was used but has no
     way of picking up the original file used and so  the  thread
     of data files will be broken at this point.



ACKNOWLEDGEMENTS

     The FFT code was supplied by Lynn Ten Eyck.  Andy  Arvai  is
     partly responsible for the FFT driver routine.



VERSION

     Release 3.0 of XtalView



SEE ALSO

     xtalview(1), dumpphasit(1)