[Ifeffit] Carlo's problem with wurtzite

Bruce Ravel ravel at phys.washington.edu
Thu Nov 6 16:27:09 CST 2003


Hi folks,

Last week Carlo posted a problem he was having with a hexagonal space
group.  He was getting different results when entering data directly
into TkAtoms than when he saved the input data and reread it into
TkAtoms.

I finally found the source of the problem.  All output files in
TkAtoms are formatted according to "template files".  The reason these
template files exist is to make it easy for the user to tweak the
appearence and content of the files Atoms writes out.  Unfortunately
there is a bug in the template that is used to save the input data to
an atoms.inp file.

In Carlo's example, one of the atoms was at the position (1/3,2/3,0).
When Atoms save the data, it saved that position as (0.3333,0.3333,0),
i.e. with four digits of precision.  It turns out that Atoms considers
*five* digits of precision, so it was not recognizing that 0.3333 was
meant to represent 1/3.  This lead directly to the problem that Carlo
reported.

Eventually Carlo was able to explain this to me in a way that made it
into my very dense skull! ;-)

This problem will be fixed in the next release of Atoms.  Anyone who
wants to fix this problem beforehand, here are the simple
instructions:

unix people:
   1. Copy the atoms.atp file to your ~/.atoms/ directory.  (Create it
      if it does not already exist.)  The atoms.atp file will be found
      in someplace like /usr/lib/perl5/site_perl/5.8.0/Xray/atp/
   2. Edit ~/.atoms/atoms.atp and change the precision in the first
      non-comment line from 8.4 to 9.5.
   3. Save the file and fire up TkAtoms.  Should work now.

windows people:
   1. Using WordPad or NotePad, edit the file
      C:\Program Files\Ifeffit\perl\Xray\atp\atoms.atp
   2. Change the precision in the first non-comment line from 8.4 to
      9.5.
   3. Save the file and fire up TkAtoms.  Should work now.


There is a moral to this story.  Atoms handles numerical precision in
a quirky manner.  If it is possible to use a factional representation
of a number, do so.  (I.e. always use "1/3" rather than 0.33, 0.333,
0.3333, or 0.33333 -- even though the last one will, in fact, work
correctly.) 
   
Thanks to Carlo for finding this problem and to Peter for a valient
if unsuccessful stab at solving the problem.  Thanks guys!

B



	
-- 
 Bruce Ravel  ----------------------------------- ravel at phys.washington.edu
 Code 6134, Building 3, Room 222
 Naval Research Laboratory                          phone: (1) 202 767 5947
 Washington DC 20375, USA                             fax: (1) 202 767 1697

 NRL Synchrotron Radiation Consortium (NRL-SRC)
 Beamlines X11a, X11b, X23b
 National Synchrotron Light Source
 Brookhaven National Laboratory, Upton, NY 11973

 My homepage:    http://feff.phys.washington.edu/~ravel 
 EXAFS software: http://feff.phys.washington.edu/~ravel/software/exafs/



More information about the Ifeffit mailing list