[MAP Logo]

Materials Algorithms Project
Program Library



Program MAP_UTIL_XRD2GP

  1. Provenance of code.
  2. Purpose of code.
  3. Specification.
  4. Description of program's operation.
  5. References.
  6. Parameter descriptions.
  7. Error indicators.
  8. Accuracy estimate.
  9. Any additional information.
  10. Example of code
  11. Auxiliary routines required.
  12. Keywords.
  13. Download source code.
  14. Links.

Provenance of Source Code

Mathew James Peet
Phase Transformations Group,
Department of Materials Science and Metallurgy,
University of Cambridge,
Cambridge CB2 3QZ, U.K.

E-mail: mjp54@cam.ac.uk

Added to MAP: March 2002

Top | Next

Purpose

To convert X-ray diffraction files in .dat format to columns of data suitable for plotting with gnuplot or spreadsheet program.

Top | Next | Prev

Specification

Language: C (ANSI C)
Product form: C, linux binary

Complete program.

Top | Next | Prev

Description

The program takes input in the format of .dat files used for X-ray analysis and converts it to 2 rows of data suitable for plotting.

Since the program has non of its own facilities for dealing with files, it is used with file redirection. For example: ./xrd2gp < input.dat > output.gp

Top | Next | Prev

References

Top | Next | Prev

Parameters

Input parameters

lower_angle, step, upper_angle, angle; char rubbish[30]; int peak_height;
lower_angle - double (double precision floating point)
The angle from which the XRD scan started (degrees).

step - double
The step between angle reported in the dat file (degrees).

upper_angle - double
The angle the XRD scan finished at (degrees).

rubbish - char
Text describing the file in the .dat format, this must be read in to be ignored, the program will core dump if this is longer than 30 characters (unlikely).

angle - double
The angle being read by the file or printed out (degrees).

peak_height - int
The intentsity at that angle (count number).

Output parameters

angle - double
As above.

peak_height - int
As above.

Top | Next | Prev

Error Indicators

At the end of reading in the intensities the program checks it has finished at the expected upper_angle. And prints a warning to the file.

Top | Next | Prev

Accuracy

100% accurate.

Top | Next | Prev

Further Comments

None.

Top | Next | Prev

Example

1. Program text

Complete program.

2. Program data


35.10000  0.20000  109.90000  A1_24h_600
     912     984     980     975    1099    1072     955    1019     945     952
     995    1057    1085    1064    1046    1006    1004    1051    1043    1046
    1019    1067    1141    1216    1204    1199    1188    1284    1149    1100
    1072    1058    1122    1050    1147    1199    1255    1298    1363    1481
    1471    1668    1917    2300    2917    5230   12028   30381   25739    8333
    3625    2164    1650    1560    1278    1085     994     970     898     895
     798     781     796     793     833     844     854     854     892     843
     894     804     782     708     697     688     663     650     707     619
     626     704     692     727     683     671     629     649     642     654
     577     597     596     656     598     610     633     621     566     599
     544     559     522     494     517     529     484     525     495     522
     510     472     557     505     549     511     487     523     457     510
     502     450     475     465     490     442     465     500     443     462
     487     506     487     467     483     500     482     477     490     485
     537     533     576     600     783     994    1453    2234    3887    4267
    2697    1430     911     646     599     546     490     459     504     473
     489     433     427     435     450     416     424     460     429     457
     455     417     419     462     482     472     488     436     501     457
     481     390     452     479     478     453     496     470     439     513
     508     463     449     488     466     484     511     523     511     530
     552     468     540     500     467     496     514     501     559     486
     571     528     576     579     599     635     577     604     563     584
     590     522     608     554     585     543     604     653     679     752
     866    1083    1459    2062    3672    6698    7343    5124    2760    1467
    1074     940     713     635     619     534     484     525     482     515
     496     501     474     485     524     475     466     478     470     425
     425     482     446     451     424     461     419     425     446     386
     384     380     385     344     380     368     403     348     386     351
     374     366     354     340     356     340     352     331     334     326
     370     356     356     362     341     340     352     322     334     352
     354     343     396     357     355     338     336     340     371     375
     418     396     392     452     486     578     780    1203    1861    2053
    1678    1176     750     619     467     455     364     363     402     354
     402     363     379     383     389     356     351     360     342     353
     356     315     349     350     343     335     309     333     328     306
     325     362     315     320     294     324     306     303     342     320
     315     341     324     336     325     330     340     313     344     340
     311     326     331     314     323


3. Program results


35.100000 912 
35.300000 984 
35.500000 980 
35.700000 975 
35.900000 1099 
36.100000 1072 
36.300000 955 
36.500000 1019 
36.700000 945 
36.900000 952 
  .        .
  .        .
  .        .
107.900000 325 
108.100000 330 
108.300000 340 
108.500000 313 
108.700000 344 
108.900000 340 
109.100000 311 
109.300000 326 
109.500000 331 
109.700000 314 
109.900000 323 

Top | Next | Prev

Auxiliary Routines

Top | Next | Prev

Keywords

X-ray, data, plotting

Top | Next | Prev

Download

Download source code

Top | Prev


MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.

MAP Website administration / map@msm.cam.ac.uk

Top | Program Index | MAP Homepage Valid HTML 3.2!