ILL-SANS Treated data formats

R. Ghosh, March 1998

Version 1.0 - for comments/ additional parameters etc.

Note: not all parameters have been correctly set yet either in raw or treated data


Standard data files are read or written by access routines which are held in the library libsLgfa etc. One important feature of these files is that they each contain some history of the previous data treatment step. It is hence easy to trace the origins back to the original raw data components. This is very helpful in finding anomalous results, e.g. noise introduced by a poorly measured background run.

Data files from regrouped treatment

The generic filenames are derived from nnn, the run number, and eee, the extension, or version number resulting in the name


                      gnnnnnn.eee

e.g.                  g006215.000       (from first regrouping)
                      g006215.001       (from further treatment...)      

The first 5 lines of the file are always present and contain information on the internal layout. To simplify use by other packages, the number of Q values and the number of lines to be skipped before the simple table of Q, S(Q) errS(Q) values are found are written in the first line.

To allow programs, e.g. SPOLLY to annotate the components used in the treated spectra additional text lines may be included. Similarly there is provision for users to develop their own programs, and store additional real parameters in a supplementary region of the file.

The overall layout of the file is in sections as follows:

   1/   - Title line
   2/   - Key line (identifying the originating instrument)
   3/   - Indexing for remainder of file
   4/   - identification of program, date of recording
   5/   - additional text lines (usually creation history)
   6/   - parameters
   7/   - user's additional parameters (maximum 20)
   8/   - PDH parameters
   9/   - lines of Q, S(Q) and errS(Q) 
The following truncated example shows these numbered sections where present.
  |--------------------------- Data  File ---------------------------------------->|
1/ Sample - d corrs    TEST prot/deutr. ellipt. chs  44 lines+(Q, I(Q), errI(Q))
2/  ILL  SANS D11
3/        8303         1        37         1        42        38
3/           1         4        32         0         3         1
4/  spol 20-Oct-1995  9:16:09
5/   AvA1 0.0000E+00 AsA2 9.5000E-01 XvA3 1.0000E+00 XsA4 1.0000E+00 XfA5 0.0000E+00
5/  S...  8303  0  1.00E+00 P100 0.5% 221   Sbak  8309  0  2.00E+00 Blank523 193      
5/  V...  8301  0  1.00E+00 Hhaps 911                                            
5/                                                                                
6/    0.0000 ! Theta-0 Detector offset angle 
6/   32.5000 ! X0 cms Beam centre            
6/   32.5000 ! Y0 cms Beam centre            
6/    1.0000 ! Delta-R cms regrouping step   
6/    2.5000 ! SD m Sample-detector distance 
6/   10.5400 ! Angstroms incident wavelength 
6/    5.6000 ! m collimation distance        
6/    1.0000 ! concentration                 
6/       -3. ! ISUM central window sum       
6/        1. ! flux monitor counts           
6/  180.0000 ! degrees detector sector width 
6/    0.0000 ! degrees sector orientation    
6/   10.0000 ! % wavelength spread           
6/   20.0000 ! mm source slit width x        
6/    0.0000 ! mm source slit height y       
6/   10.0000 ! mm sample width x             
6/    0.0000 ! mm sample height y            
6/   10.0000 ! mm detector x pixel size      
6/   10.0000 ! mm detector y pixel size      
6/    0.0000 ! degrees sample normal/beam    
6/    0.0000 ! K sample temperature          
6/    0.0000 ! sample transmission           
6/    1.0000 ! mm sample thickness           
6/  900.0000 ! secs counting time                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
8/         37         0         0         0         0         0         0         6
8/    0.100000E+01   0.250000E+03   0.000000E+00   0.100000E+01   0.105400E+01
8/    0.000000E+00   0.000000E+00   0.000000E+00   0.000000E+00   0.000000E+00
9/    0.000000E+00   0.000000E+00   0.000000E+00
9/    2.194656E-03   3.442688E-01   8.329221E-02
9/    5.466116E-03   3.000000E-01   5.008947E-02
9/    8.480323E-03   3.877941E-01   4.232426E-02
9/    1.189216E-02   6.498784E-01   1.519078E-02
9/    1.497785E-02   7.493181E-01   1.173622E-02
9/    1.802907E-02   8.019943E-01   1.021966E-02
9/    2.128347E-02   8.117417E-01   8.385011E-03
9/    2.433197E-02   8.423974E-01   8.750222E-03
9/    2.744053E-02   8.300668E-01   7.543748E-03
9/    3.045397E-02   7.987967E-01   7.683866E-03
9/    3.403699E-02   7.619627E-01   5.949513E-03
9/    3.740020E-02   7.112669E-01   6.774296E-03
   plus additional Q, S(Q), errS(Q) triplets, 37 in all


Details of file format

1/ Title line:

titles  short title (20 characters), long title (60 characters)

2/ Key line: 16( A4, 1X ) Keys

The first three keys denote ILL SANS data formats are in use, and contain the instrument name.

3/ Indexing for the remainder of the file

  IRUN EXT NDATA1 NDATA2 NSKIP NSKIPP 
  I10, I10,  I10,    I10,  I10,   I10
IRUN	run number
EXT     extension number
NDATA1  number of Q,S(Q),errS(Q) data
NDATA2  dimensionality (see ungrouped data below)
NSKIP	the number of lines preceding the Q,S(Q),errS(Q) data from here
NSKIPP  the number of lines to skip after this record to find PDF data

IVERS NTXT NPAR NPARX NPDFX IERRS
  I10, I10, I10,  I10,  I10,  I10
IVERS	version of this data
NTXT    number of lines of text in section 5/
NPAR    number of parameters in section 6/ (format F10.x) 
NPARX	number of extra parameters in section 7/ (max=20, format E16.8)
NPDFX   number of lines of PDF data
IERRS	(for ungrouped data) 0=no errors included, 1=error array follows
         data

4/ Identification of originating program

PNAM DATE
  A4, 1X, A20
Creating program and date and time of file creation

5/ Additional text

Up to 10 lines of additional text may be placed in the data file. In the above case of spolly this contains details of the components used in the corrections: four lines are used hence NTXT=4.

6/ Standard Parameters

One value is given per line (F10), followed by a space, an exclamation mark and a commentary describing the parameter. When circular diaphragms are in use only the widths (x) are non-zero.

7/ Additional parameters

Up to 20 parameters may be placed here in the file. They are stored using the format 5E16.8.

8/ PDH parameters

These three lines contain values which are similar to those used by PDH SAXS data treatment suites.

Integer constants:
8(I9,1x)
I1	number of data points in file
Real Constants
5(E14.6,1X)
R1	concentration
R2	sample-detector distance (cm)
R3	gamma (SAXS)
R4	data scaling multiplier (following=original x  R4)
R5	wavelength (nm)

R6      temperature of sample 
9/ DATA

NDATA triplets of Q, S(Q) and the statistical error (standard deviation) in S(Q) then follow. Each line has a format 3(E14.6,1X)

Data files for Anisotropic Analysis

The generic filenames are derived from nnn, the run number, and eee, the extension, or version number resulting in the name


		      tnnnnnn.eee

e.g.                  t006215.001       (from first treatment)
		      t006215.002       (from further treatment...)
The layout of the data file follows closely that of the regrouped data. The variables NDATA1 and NDATA2 are used to denote the numbers of x and y cells respectively. The PDH section is absent, hence NPDFX is set to zero. If IERRS is set to 0 then no array of erros is produced (this occurs when the environment variable SAS_ERROR is set to "none"). The format for the data arrays is 8(E10.3,1X). Thus, even when negative values arise, there is always "white space" between data. As a consequence these lines exceed 80 characters, which has been used as a guide elsewhere to enable files to be printed and, if necessary, edited; this need is not a likely to arise with the full data arrays.

The array ordering is that of successive rows of values,

D(x=1,y=1),D(x=2,y=1),D(x=3,y=1).....D(x=NDAT1,y=1),D(x=1,y=2)...
.....    D(x=NDAT1,y=NDAT2)
an example follows:

  |--------------------------- Data  File ------------------------------------------------>|
1/ Sample - d corrs    TEST prot/deutr. ellipt. chs  40 lines+(Q, I(Q), errI(Q))
2/  ILL  SANS D11
3/        8303         1        64        64        38         0
3/           2         4        32         0         0         1
4/  apol 20-Oct-1995 11:41:13
5/   AvA1 0.0000E+00 AsA2 9.5000E-01 XvA3 1.0000E+00 XsA4 1.0000E+00 XfA5 0.0000E+00
5/  S...  8303  0  1.00E+00 P100 0.5% 221   Sbak  8309  0  2.00E+00 Blank523 193      
5/  V...  8301  0  1.00E+00 Hhaps 911                                            
5/                                                                                 
6/    0.0000 ! Theta-0 Detector offset angle 
6/   32.5000 ! X0 cms Beam centre            
6/   32.5000 ! Y0 cms Beam centre            
6/    1.0000 ! Delta-R cms regrouping step   
6/    2.5000 ! SD m Sample-detector distance 
6/   10.5400 ! Angstroms incident wavelength 
6/    5.6000 ! m collimation distance        
6/    1.0000 ! concentration                 
6/       -3. ! ISUM central window sum       
6/        1. ! flux monitor counts           
6/  180.0000 ! degrees detector sector width 
6/    0.0000 ! degrees sector orientation    
6/   10.0000 ! % wavelength spread           
6/   20.0000 ! mm source slit width x        
6/    0.0000 ! mm source slit height y       
6/   10.0000 ! mm sample width x             
6/    0.0000 ! mm sample height y            
6/   10.0000 ! mm detector x pixel size      
6/   10.0000 ! mm detector y pixel size      
6/    0.0000 ! degrees sample normal/beam    
6/    0.0000 ! K sample temperature          
6/    0.0000 ! sample transmission           
6/    1.0000 ! mm sample thickness           
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
6/    0.0000 ! reserved                      
9/    0.000E+00  6.833E-01 -2.375E-01  2.625E-01  2.000E-01  0.000E+00  1.000E+00  1.750E-01
9/    0.000E+00  1.000E+00  1.667E-02  1.000E+00  1.150E-01  8.434E-02  6.612E-02  1.373E-01
9/    1.475E-01  9.699E-02  1.472E-01  9.640E-02  1.129E-01  1.792E-01  1.801E-01  1.757E-01
9/    1.384E-01  1.271E-01  2.322E-01  1.743E-01  1.313E-01  1.671E-01  1.757E-01  1.733E-01
9/    1.583E-01  1.632E-01  1.868E-01  1.901E-01  1.880E-01  1.982E-01  1.326E-01  1.559E-01
9/    1.374E-01  1.922E-01  1.093E-01  1.762E-01  1.415E-01  1.772E-01  1.526E-01  1.466E-01
9/    1.016E-01  1.033E-01  8.145E-02 -2.375E-01  2.929E-01  0.000E+00  1.000E+00  5.250E-01
9/   -1.188E-01  0.000E+00 -1.417E-01  2.100E-01  7.875E-01 -2.850E-01  1.429E-02 -1.288E-01
9/    1.917E-01 -4.750E-01  5.250E-01  0.000E+00  0.000E+00  0.000E+00  0.000E+00  0.000E+00

     a total of 64 x 64 values of intensity, followed by the same number of error values