<* $Id: xnd_tut.html,v 1.1.1.1 2000/09/11 12:30:00 berar Exp $ *> Tutorial for xnd beginners.

Tutorial for xnd beginners.


xnd top Next file Previous file

How to get started

The easiest way to start with xnd is to start using example files. In the following lines, examples will use some unix commands. But they can easily be adapted to an other system.

Preliminaries

The first thing is to get a binary, some are soon compiled in the archive or on xnd ftp site. If it is not the case, you have to compile the program using the make command, which works on many system.
If you get the program by ftp, ensure that you can execute it, giving it the right permissions : chmod ugo+x on unix system and checking the PATH environnement variable if necessary. MSWindows users the program xnd.w95 has to be renamed to xnd.exe

You can ensure that xnd works issuing the command : xnd xnd_1 inside the demo directory.

Neutron user : xnd_2.k

We will start using the xnd_2.k file, and before check if the installation run : xnd xnd_2. Typically the program will end on such lines :
  #3 CYCLE #4 #0 d2mat2 Fri Apr  7 16:44:27 2000
 Rwp=0.0900  Rp=0.0684  Rwp_c=0.3212  GoF=1.02  (Rwp_b=0.1949 Rp_b=0.1869)
 Minimised_Sum =  5615.065
 Overall  R_Bragg=0.1167 (139 hkl, S_I=  4.7e+03)   Rw_B=0.1075 (S_wI= 7.54e+04)
          Rf=0.1004     (137 hkl, Sf= 3.52e+03)   Rwf=0.0573 (S_wF= 3.52e+03)
 
 Duree 21s STOP 3, Fri Apr  7 16:44:29 2000

 CPU usage :
     total=18.35s    reading=0.55s    printing=1.74s
 inverting=0.01s     min_li=3.22s   cal_deriv=12.71s

Preparing the input data

Start copying the demo xnd_2.new file into your test.k file and open the file in an editor. The file may be splitted in 4 parts according :
1st part headers
 Example of input file for xnd (neutron data)
................. 
2nd part experimental data
 @EXPER  TITLE = 'ILL P V PB O  ( X=0.75, P=1 BAR )' ; NATURE = 1 ; FILE = 11 ; BGROUND = 8
................. 
3rd part sample data
 @PHASE  TITLE = 'PV-PB   X=0.75' ; NATURE = 0 ; ORIG = 250.000000
................. 
4th part end of file
#   3 5615.065430 on Fri Apr  7 16:44:27 2000
# 10964   Minimized sum of previous demo for xnd_2.k 

Headers

There is only one parameter to modify in the header change the line @XND CYCLE = 4 into @XND CYCLE = 0 to ensure that no refinement will occurs before the data are well understood. If you whish, the title on the first line may also be changed.
title and comments
Example of input file for xnd (neutron data)
# data file to be used with xnd_1.20... see xnd_2_11.k for xnd_1.10 data file
# atomic position x and y have been inverted after 1.14 with respect to ITC
# anisotropic thermal factors B12, B13 and B23 have been modified in 1.17 
number of cycles
@XND CYCLE=0; 
classical parametersdon't change at beginning
@MODES  STOP = 0.3; PROF = 0.5 ; RELAX=0.85 ; ASYM = 2

@OUTPUT NEW=2

@OTHERS  VALID = 1 

We can check that no damage occurs by running xnd test.

Experimental part

Before going into physical matters, one of the first things is to identify your data file and make it readable by xnd. Many neutron data file are build in similar way. The following example use an ILL D1B recorded in 1999.
experiment headerlook at your data file type
@EXPER  TITLE = 'ILL P V PB O  ( X=0.75, P=1 BAR )' ; NATURE = 1 ; FILE = 11
@EXPER  BGROUND = 8 ; ORIG = 250.000000

@DATA  TEMP = 250.000000 ; SIZE = 5400 ; FILE = xnd_2.dat 
set also the number of points used for background
wavelengthjust set the right wavelength
# the wavelength block
@LAMBDA  
        1.596   0         1    0
            0   0      0.25    1 
backgroundto be set when the data have been read once
# background
@BGROUND  
   12.000              65   0
   22.000              61   0
   23.000              68   0
   26.000              76   0
   38.000              69   0
   80.000              99   0
  140.000             112   0
  157.000             130   0 
alignement characteristicsreset zero to 0.0 instead of 0.31
# alignement characteristics
@SETTING
     0.3134    1       0   0
        0.6    1       0   0 
intrumental width and asymhere is the width at zero 2theta

# intrumental width
@INSTRU
            0   0     0.413967   1
            0   0            0   0 
# intrumental assym, these are strongly correlated with the zero 
@ASYM
         0.5   1       -0.1   1
           0   0        0.1   1
       -0.05   1          0   0

Chemical part

phase headernature=0 stand for ordinary crystalline phase
@PHASE  TITLE = 'PV-PB   X=0.75' ; NATURE = 0 ; ORIG = 250.000000

# scale factor block

@SCALE  
      0.001305    1                           0   0         
the scale factor can be set to a more reasonable value when data have been read
crystal symmetry ....set the number of independant atoms in the cell
@CRYSTAL  SYMGRP = R-3MH ; ATOM = 6 ; ORIEN = 1
only few space groups have been tabulated, if not you have to introduce a table in the header
cell
# cell parameters block
@CELL  
            0   0
      5.595   11 1.000000
      5.595   11 1.000000
      20.35   1
           90   0
           90   0
          120   0

# cell parameters block
@CELL  
centering parameter    
A        variation is coupled with B
B   
C    
Alpha
Beta 
Gamma

prefered orientationreset the -0.45 to 0.0 and its codeword to -1
# prefered orientation definition
 1
# prefered orientation block

@ORIEN  
         -0.45  1
            0   0
            0   0
# if required line width and assym

atomsthe number of atoms is defined above in @CRYSTAL
# one block for each atom
# atomic position 

@ATOM  NAME = PB1 ; CHEM = PB ; CASE = 1

@COORD  
            0   0
            0   0
            0   0
          0.5   0
         0.03   14 1.000000
         0.03   14 1.000000
        0.001   -1
            0   0 
            0   0
            0   0

@ATOM  NAME = PB2 ; CHEM = PB ; CASE = 1
.....................
# comments
NAME : identifier for the listing
CHEM : used to search the scattering table
CASE = 1     CASE=0
anisotropic  isotropic
@COORD  
X            X
Y            Y
Z            Z
Occ.         Occ.
B11          Biso
B22         
B33 
B12   
B13 
B23 

@ATOM  
.....................
On unix run it with xnd test then look at the pattern using xmgr -nxy test.plg

X-ray user : xnd_3.k

We will start using the xnd_3.k file, and before check if the installation run : xnd xnd_3.
xnd top Next file Previous file

JFB Apr 7th, 2000