;*************************************************************************** 
;* SF: IDL routines for calculating atomic scattering factors.             * 
;*                                                                         * 
;*     Replicates the functionality of the original SF program for DOS     * 
;*     that was written by Mark Thomas, Center for X-Ray Optics, Lawrence  * 
;*     Berkeley National Laboratory.                                       * 
;*                                                                         * 
;* WRITTEN BY:                                                             * 
;*      Billy W. Loo, Jr.                                                  * 
;*      Bioengineering Graduate Group, UC San Francisco / UC Berkeley      * 
;*      School of Medicine, UC Davis                                       * 
;*      Ernest Orlando Lawrence Berkeley National Lab                      * 
;*      August, 1996                                                       * 
;*                                                                         * 
;* CONTACT INFO:                                                           * 
;*      BWLoo@lbl.gov                                                      * 
;*                                                                         * 
;*************************************************************************** 
 
;REQUIRED .PRO FILES: 
;  sf.pro 
;  file2string.pro 
;  photon_conv.pro 
;  split_string.pro 
;  string2file.pro 
;  join_string.pro 
;  str_columns.pro 
 
;REQUIRED DATA FILES: 
;  This module requires the scattering factor data files compiled by 
;  B.L. Henke, E.M. Gullikson, and J.C. Davis, available by anonymous 
;  ftp at: 
;    ftp://www-cxro.lbl.gov/pub/sf/sf.tar.Z 
; 
;  In addition, it requires a file containing the abbreviated element 
;  names and atomic weights. Such a file can be generated manually 
;  using the routine SF_GEN_EL_DATA. Just type "SF_GEN_EL_DATA" at the 
;  IDL prompt, and enter the requested information. 
;  It has been included in this package as "elements.dat". 
 
;OPTIONAL DATA FILES: 
;  These files contain molecular formulas for a variety of materials: 
;    compounds.scr 
;    protein.scr 
; 
;  Example: at the IDL prompt, type "@compounds.scr" to create variables 
;           containing the molecular formulas defined in that file. 
; 
;  This file contains examples of lines that can be included in the 
;  local IDL startup file to initialize the SF routines: 
;    idl_sf_startup 
; 
;  Example: at the IDL prompt, type "@idl_sf_startup" to run the script. 
 
;INSTALLATION EXAMPLE: 
;  Follow these instructions to test the package. 
; 
;  First obtain the files sf_pros.tar (this package) and sf.tar.Z (from 
;  the site described above). 
; 
;  At the UNIX prompt: 
;    1> tar xvf sf_pros.tar 
;    2> mkdir sf_pros/sfdata 
;    2> mv sf.tar.Z sf_pros/sfdata 
;    3> cd sf_pros/sfdata 
;    4> uncompress sf.tar.Z 
;    5> tar xvf sf.tar 
;    6> cd .. 
;    7> cp elements.dat sfdata 
 
;USAGE EXAMPLE: 
;  Start IDL in the sf_pros directory, then at the IDL prompt type: 
 
@idl_sf_startup                 ;Initialize routines. 
 
glucose = 'C6H12O6'             ;Define a material. Several definitions are in 
                                ;the file "compounds.scr". 
 
energy = FINDGEN(500) + 100     ;Evaluate at energies from 100 to 599 eV. 
 
abs_coeff = SF(glucose, energy) ;Calculate the mass-dependent absorption 
                                ;coefficients for glucose at the specified 
                                ;energies. 
 
PLOT, energy, abs_coeff         ;Plot the results. 
 
;DOCUMENTATION: 
;  Detailed documentation of all the features of the SF routines can be found 
;  at the beginning of the "sf.pro" file. In addition, each ".pro" file 
;  contains detailed documentation of the functionality of the program(s) 
;  it contains. 
