Skip to content
ttrainor edited this page Jan 8, 2012 · 1 revision

Interface for processing XRF files

`attachment:xrfgui.png`_

Data

  • You need to have your xrf data read into an 'Xrf' class object, or list of objects. You can select this variable name using 'Xrf Name' pull down.
  • If the xrf data was read in with a script, it may have been put into a group (see `tdl/Pds/Shell`_). If so selecting the group name will show the possible data that reside in it.
  • If you read in the data using the Spec Gui or the reader, make sure you have converted med data to xrf already. Then in the 'Xrf Name' field select the scandata instance (the variable name is 'tmp' in the above example) and then type onto the end of it 'tmp.xrf'. Make sure you hit enter after selecting. If successful you should see a plot of the first spectrum.
  • You can also read in a set of xrf data from the file menu. Just select one or more of the xrf files and read. Note this is not recommended since this method cant compute deadtime corrections.
  • If you are working on scan data then the spectrum for a given scan point can be selected from the 'Scan Index' pull down.

Save Parameters

  • Here you can specify a variable name to hold the xrf parameters (lines, energy shift, background params etc...)
  • Select or enter a variable name and hit save to save the current parameters to the specified variable.
  • Select a variable and hit restore to restore previously saved parameters.
  • Note this is a convenient way to set initial paramters. E.g. if you get one spectrum fit you can save the parameters, then select the 'Set Params From Save' check box. Every time you re-read a new spectrum it will automatically have these parameters assigned to it. However, be careful to uncheck this box after fitting! ie when you do a fit as described below the results stick with the xrf object, but if this check obx is selected, the nice fit results will be replaced....

Plot Parameters

  • Here you can chose how to plot the data. You can play with the options to see how they work. Note if 'Auto Update' is selected then a new plot will be generated when anything changes.

Extract Results

  • After fitting a scan (or even a single spectrum) you can select or enter a variable name to hold the integrated peak intensities for a selected line.

Fit Parameters

BgrParams

  • Bottom Width --> Background bottom width

    bottom_width      = 4.0
    
  • Top Width --> Background top width

    top_width         = 0.0
    
  • Exponent --> Background exponent

    exponent          = 2
    
  • Tangent --> Flag to use tangent slopes

    tangent           = False
    
  • Compress --> Compression factor during background determination

    compress          = 4
    
  • Bottom width fixed --> Flag to optimize bottom width (see below note regarding optimizing background parameters)

    bottom_width_flag = 0
       0 = Optimize
       1 = Fixed
    
  • Top Width Fixed --> Flag to optimize top width (see below note regarding optimizing background parameters)

    top_width_flag    = 0
        0 = Optimize
        1 = Fixed
    

PeakParams

  • 'Label' -> give peak a name

    label          = ""
    
  • 'Energy' -> Peak energy

    energy         = 0.
    
  • 'Amplitude' -> Peak amplitude

    ampl           = 0.
    
  • 'FWHM' -> Peak full width half maximum

    fwhm           = 0.
    
  • 'Energy Fixed' --> Flag for fitting energy

    energy_flag    = 1
       0 = Optimize energy
       1 = Fix energy
    
  • 'FWHM Fixed' --> Flag for fitting FWHM

    fwhm_flag      = 1
      0 = Optimize FWHM
      1 = Fix FWHM to global curve
      2 = Fix FWHM to input value
    
  • Amplitude Factor --> Fixed amplitude ratio to previous peak

    ampl_factor    = 0.
       0.  = Optimize amplitude of this peak
       >0. = Fix amplitude to this value relative
             to amplitude of previous free peak
      -1.0 = Fix amplitude at 0.0
    
  • 'Ignore' -> Don't fit peak

    ignore         = False
    

FitParams

  • Energy Offset -> Global energy calibration offset (keV)

    energy_offset         =  0.
    
  • Energy Slope --> Global energy calibration slope

    energy_slope          =  1.
    
  • Energy Fixed --> Global energy calibration optimization option

    energy_flag           =  0
       0 = Optimize energy calibration coefficients
       1 = Fix energy calibration coefficients
    
  • FWHM Offset --> Global FWHM model offset (keV)

    fwhm_offset           =  0.15
    
  • FWHM Slope --> Global FWHM model slope

    fwhm_slope            =  0.
    
  • FWHM Fixed --> Global FWHM optimization flag

    fwhm_flag             =  0
       0 = Optimize FWHM coefficients
       1 = Fix FWHM coefficients
    
  • Chi Exponent --> Exponent of data for fitting weights (w = 1/y**chi_exp)

    chi_exp   =  0.
        0.0 = ones
        0.5 = sqrt (poisson stats)
    
  • Guess check box. Use this to make an initial guess at peak amplitudes from the data. works when calc or fit.

  • Fit Background check box. Use this to optimize background parameters. In general this should not be checked - ie chose background parameters that appear good, and do not optimize.

Fit Scan

  • Fits all the xrf objects in the scan list
  • Use Previous :
    • If selected then use index-1 as seed parameters for fitting index, ie use the results of the previous fit to seed the next fit.
  • Initialize:
    • This is the index of the first scan in the list to fit. It will then be used as the seed value for fitting all the xrf objects restarting at index zero.
    • If Initialize > -1 and 'Use Previous' is checked then the initial fit will only be used as the seed for fitting the first index. Then the results will be copied forward.

Clone this wiki locally