Applications for Synchrotrons.
Sam's Interface for XAS Package, or SIXPACK for short, is the unification of the previously named SamXAS and SamView programs into a single analysis package. Thus the package can guide the user through data averaging and calibration, background removal, and many aspects of fitting. The interface builds on Matt Newville's IFEFFIT engine. It contains six basic modules:
SamView - an interface for averaging, calibrating, and deadtime correcting raw data
Background subtraction of data to create normalized mu(E) and chi(k) functions
A FEFF periodic table interface to create single scattering phase and amplitude paths - Now compatible with FEFF6 through FEFF8.
A GUI for the fitting of experimental EXAFS to theoretically derived phase and amplitude files
A GUI for linear combination fitting of EXAFS or XANES to experimentally obtained reference spectra
A principal component analysis routine that decomposes data into a set of orthogonal components. Also features a target transformation feature to check if potential reference spectra are in the component space defined by the samples.
The SamView module is a general purpose XAS data preprocessing program. It reads raw data collected from a beamline and allows the user to view raw data, average scans, calibrate energy, and perform deadtime corrections for solid state detectors. Current data formats supported at this time are:
SSRL XAScollect binaries
SSRL XAScollect ASCII files
X-ray Data Interchange (XDI) format
DND-CAT quick-scanning XAS binary files
DND-CAT ASCII files from step XAS scans
DND-CAT ASCII files from multi-element detectors
GSE-CARS single and multi-element detectors
PNC-CAT simple format
SRC multi-element detector format
ALS beamline 10.3.2
NSLS beamlines X-11A, X-23A2 and X-23B
NSLS BSIF binary format for X26A 1-D data
Generic ASCII format for other formats
Future ability to include other formats is planned, including possible plug-in type support. A generic ASCII file loader is provided to accommodate other file formats. The background subtraction module adds the ability to perform the subtraction of gaussian type pre-edge removal to the standard complements of background removal and spline fitting. The gaussian method is a useful approach to remove the scattering contributions of low concentration samples collected with solid-state detectors. A special feature of the XANES fitting routine is the ability to make corrections for self-absorbance to spectra obtained using fluorescence yield detectors (i.e. Lytle cells or Ge solid state arrays). The program is still in its mid-life stage of development, but all questions and particularly comments for improvement are welcomed.
Documentation has now arrived! It is still in a early draft. Any comments to improve clarity are welcomed.
View the HTML documentation (SSRL wiki).
Download HTML documentation in a .zip file.
Coming Soon: Tutorials! New documentation to reflect recent improvements (badly needed)!
At this point downloads of SMAK are in the form of Win32/64 executables (tested through Win7) and now MacOSX (via Wine Support).
If you have a Mac -- PLEASE READ THIS!
With the advent of High Sierra, the Mac DMG installations are no longer working. As an effective workaround, all future releases of SMAK will utilize compatibility with the Wine package for running Windows executables on MacOS and Linux too. For the Mac, you will need to install the latest stable version of WineHQ as well as a recent version of Xquartz from Apple. Once installed you should be able to run SMAK natively as the Windows executable. Note that some installations may only be able to run the Win32 version. We are also working on a stable Python source distribution, but that will come in time!
For Mac installation (with no Wine installation for OS X before High Sierra), please open the dmg file and drag the application bundle to you "Applications" folder. It will not run from the .dmg file or any other location on your filesystem. There may still be issues with running the application - if it crashes because it cannot find "tile", download this zip file and install the folder to your "/System/Library/Tcl" directory. On some Macs the directory may also be "/Library/Tcl". You will likely need Administrator privs to do this. If you have MacOS > 10.6 (i.e. Mountain Lion or Mavericks) you may also need to install the new Apple flavor of X11, xQuartz. This should install into your Applications-Utilities folder. Many users have reported that they need to duplicate this program to also be titled X11 (so... select "xQuartz" in a Finder window, copy/paste, rename the new file to "X11").
Starting with Mac OSX 10.11 (El Capitan), Apple has started using "System Integretity Protection". If you have this, you will NOT be able to follow the directions above to install the "tile" folder and SIXPACK will not be able to run. However, if you choose, you may disable the SIP to perfrom the "tile" installation, and then enable SIP again afterwards. This link describes the proces that you need to follow.
If you have found that SIXPACK has suddenly stopped working or fails to run after all of this... You may have upgraded your system as of late. There is a known apparent error (that manifests itself as a "gestalt" version error in the console) with upgrading the Apple OS. While it is unclear what the best way to resolve this, some Google rumors suggest reinstalling your OS. From my personal experience of updating from Mavericks to Sierra, I was able to get everything working by (1) reinstalling the OS, (2) reinstalling the Tcl Tile package (as noted above), (3) installing or reinstalling xQuartz. Please let me know if these things work or don't work.
The old source code in Python source for Linux, Mac or Unix machines will be posted to the new site soon. As of now, it is still relatively untested on non-win platforms. Any feedback on the use of the code on other platforms is greatly appreciated.
Download v1.40 Windows executable in .zip file.
Download v1.40 MacOSX disk image in .dmg file.
Archives of previous versions
Download v1.30 Windows executable in .zip file.
Download v1.30 MacOSX disk image in .dmg file.
Download v1.20 Windows executable in .zip file.
Download v1.20 MacOSX disk image in .dmg file.
Download v1.10 Windows executable in .zip file.
Download v1.10 MacOSX disk image in .dmg file.
Download v1.00 Windows executable in .zip file.
Download v1.00 MacOSX disk image in .dmg file.
Download v0.68 Windows executable in .zip file.
A nice installer for the IFEFFIT package is given at Matt Newville's site. If this installation route is chosen, copy the executable from the above zip file over the IFEFFIT installed version to update to the latest version.
Versions from 8/02/02 to 12/31/02 will also need to place the xbm folder, mnexafsfit.iff and sixpack.gif files inside the sixpack folder in the IFEFFIT directory in order to run properly. This fix should not be needed with versions after 0.33. New files to include while updating since the last IFEFFIT installer was created include _socket.pyd and test.inp. These should both be in the same directory as the executable.
SixPACK is Open Source Software. See a copy of the license here.
The interface portions of SixPACK and the SamView module were developed by Sam Webb at SSRL, the Stanford Synchrotron Radiation Laboratory. IFEFFIT was developed by Matt Newville at CARS, the Consortium for Advanced Radiation Sources, at the University of Chicago. Special credit also belongs to Bruce Ravel for his "Ravelware" programs, many of which have inspired some of the look and feel of the SixPACK modules. EXAFS self-absorption correction routines based on code from Corwin Booth.
8/12/16: Version 1.40: Minor updates. Fixed a few other XDI bugs. Added a "red dot" to the active file in PCA score plots. Fixed some bugs with constant error windows popping up in various places, so it should be a lot nicer. Also made legends work again in the plots, for better or worse.
3/28/16: Version 1.30: Minor updates. Fixed bug in the XDI formats that prevented beam line data to be transferred to averagd and processed data files. Increased the ability of SSRL data formats to read up to six SCAs.
2/29/16: Version 1.20: Major release. Fixes bugs that have plagued that previous veriosm. Major bux fix that prevented Lytle only data from SSRL to be loaded. Support now added for the X-ray Data interchange format. Additioanlly, all save files will include a "standard" SIXPACK text file, as well as an XDI file. The parameters for background subtraction will be saved in the XDI metadata. Aslo updated the PCA routine so that the previous limit of the number of data files that could be analyzed at a single PCA run was increased. THe number will still depend on the range of data and the density of data points, but the limit is increased form approxiately 30 to around 100. Added support to read text files universally between Mac/Unix and Windows text formats.
7/25/14: Version 1.10: Major re-release to fix many bugs from the 1.0x verions. Fixed screen sizing, viewing and editing of raw data. Can plot/average custom columns so that you are not restricted to the default data types. Can view scatter plots of PCA scores in PCA module, including 3-D plots. Can also choose which samples to plot in PCA. There's a lot of other nasty things that were fixed, so hopfully I got them all.
7/14/12: Version 1.01: Quick bug-fixes. Plotter in the viewer does not plot too many multiples now. Least squares fitter is fixed for fitting routines. Connections to IFEFFIT libraries is fixed - caused blank sceens on startup. Fixed copy-paste of graph data from PCA module.
7/9/12: Version 1.00: Major re-release! Now with Windows specific codes removed and released in both Windows and MacOSX flavors! Graphics now rely on the matplotlib library rather than the out of support BLT graphics libraries, so navigation is new. Continued support for better handling of multiple files - can do save all for background subtraction modules. WARNING: The FEFF6L support for the Mac version is still untested and likely to be broken. I will be working on fixing this soon!
10/28/10: Version 0.68: Minor tweaks. Added a proper r-value for the linear combination fitting. In the data viewer, can now select to average data in groups. This is best used when wanting to average a ton of data files quickly (i.e. from a lot of microXANES points). Any files that have the same root (filename before the last underscore "_") in the name will be average together. This way one can load all the XANES points (including multiple scans of each point) and all the data will average in groups properly. Saves time over adding two files, averaging, clearing, loading, etc...
2/19/10: Version 0.67: Added a “cycle” fit preliminary routine in the least squares fitting. This option will do a set of LC fits for each standard that is NOT checked, and force all standards that are selected to be included in the fit. The quality of fit is reported for each fit. The thought (from Chris Kim) is that with a library of standards, the most important component can be added progressively as each cycle fit is done. Also added options to turn of the legend display in the PCA and SamView plot windows – needed for showing large numbers of graph traces.
8/28/09: Version 0.66: Missed a few numbers there in versions in the official release. Few updates: Added an r-factor for least squares fitting. It is simply the sum of the square of the residuals divided by the sum of the squares of the dataset. Updated file import formats that needed new versions. Added a “MatrixFit” least squares fitting – will calculate the least squares fit of all possible permutations of the selected component list. Returns a new window with a list of the fit permutations and their r-factor quality of fit. Added a “check all” and “check none” option in the background subtraction routine. Default in PCA is now to NOT select all the components after the calculation. SamView has option to save each file opened as an individual average file – good for large numbers of microprobe XANES data.
3/07/08: Version 0.63: Minor update to correct some errors with Tix file windows crashing the plotter.
10/29/07: Version 0.62: Minor update to correct comment format for new SSRL ASCII files.
9/08/07: Version 0.61: Minor update to correct auto-format reader for NSLS multi-element detectors. Removed links to old defunct websites on startup to shorten the delay on starting the program.
6/14/07: Version 0.60: Minor update to correct for PC based SSRL data files. Also updated the version of Tix parameters os that the screen sizes and widgets are smaller.
1/30/07: Version 0.59: Minor update to properly read most current file formats from GSE-CARS at APS.
1/24/07: Version 0.58: Added a support of the new PC based SSRL binary format. Better selection of multiple SCAs in some data formats. Indicator bar in the FEFF fitting routine to show when FEFFIT is working. Added a pulldown menu for selecting files to plot in the background subtraction routine.
5/24/06: Version 0.57: Fixed a few minor bugs in the startup sequence and fixed an error in the plotter routines which cause an error to be raised.
5/22/06: Version 0.56: Fixed a few bugs found in Linux installations from the source code. Added a few improvements to the data importer of SamView for several data formats. Added a few missing files that were vacant from the last release.
2/27/06: Version 0.55: Fixed bug from IFEFFIT upgrade and missing .dll from very latest update. Many changes since I've been so slow on updating. Highlights include… Upgraded the IFEFFIT version to 1.2.8. Added upper and lower limits on deadtime regions, fixed problems with averaging/truncating files with different lengths, added gain adjustment for averaging files under different amplifier conditions. Reads recent changes to SSRL file formats correctly. Background removal now passes all pred-edge and post-edge variables correctly to IFEFFIT. Added capability to set variables in EXAFS fitting as restraint variables (toggle switch). Command line interface to IFEFFIT added under Help menus.
8/26/04: Version 0.52: Bugfix in EXAFS fitting module regarding calculation of residuals. Also completed the save components menubar item in PCA.
8/24/04: Version 0.51: Note logo changes to splash screen and icons. Upgraded IFEFFIT version distributed with Sixpack to 1.2.6. Added the NSLS BSIF binary 1-D format for beamline X26A. SamView now supports averaging files of different lengths, with option for truncation or merging of entire data lengths. Files must still have the same initial energy spacings to work properly. Users with small screens may double click on cursor readout to raise a popup cursor position window. Background subtraction routine has mu option to shift energy positions. PCA routine now has 5 significant digits in the IND function display. EXAFS fitting routine has option to display the k-space residuals in the plot window.
3/24/04: Version 0.50: Fixed 'apply to all' bug in the auto-read of multiple fluorescence detectors in the SSRL data format readers. Added menu item to apply current selected active fluorescence channels to all data files. Added a results summary window in the background subtraction routine to permit easy copying of parameters to word prcessors for note taking.
3/7/04: Version 0.49: Added auto-read formats for PNC-CAT and SRC beamlines. Upgraded IFEFFIT version distributed with Sixpack to 1.2.5.
12/16/03: Version 0.48: Added capability to perform self-absorption corrections to EXAFS data, given a known sample composition. This functionality was based from the code of Corwin Booth. Also included in the source code distribution is a Python native version of mucal. Additional changes made to the quick-XAS loading format from DND-CAT to more easily support variable data formats.
8/20/03: Version 0.47: Upgraded the SixPACK distribution to version 1.2.1 of IFEFFIT. NEW: Added ability to cut data from any graph in SixPACK and paste it as tab delimited text onto the clipboard. This text can then be pasted into any spreadsheet or graphing utility. Greatly enhances data transfer out of SixPACK. Added "Plot Paths" in the EXAFS fitting module which allows the user to plot the contributions from all of the FEFF paths in the fit. Added sort capability to enable reorder of the fit variables. Also fixed a few aesthetic issues.
7/27/03: Version 0.46: Fixed a few errors and added features. Fixed the stack problem with the remove variable button and fixed errors in the e0 finder. Added an error checker in the SSRL format to trap from binary files that have been corrupted by ASCII transfers. Added a computation for step height in the background subtraction routine. Updated the least-squares report page to contain all pertinent values. Added a default text in the "label" category in EXAFS fitting to prevent IFEFFIT hangups.
7/20/03: Version 0.452: Small change to add compatibility for changes in GSE-CARS format
7/14/03: Version 0.451: Small change to fix a text error in the varimax routine.
7/12/03: Version 0.45: MANY new changes. Thanks to all of those who have added valuable input!
Fitting reports both chi-square and reduced chi-square
Added "remove variable" option in EXAFS fitter
Fixed error in log function in least squares fitting routine
Added a global search and replace for FEFF paths to facilitate modifying path definitions. Useful when transftering workspaces between computers
Fixed broken library in PCA routine
Added varimax rotation to PCA routine
Report after performing target transforms on library in PCA is properly formatted
Default directories can be chosen in 'File' menus
Background subtraction routine has a linear post edge fitting option for L-edge spectroscopy
Added functionality to plot FT window parameters in k-space with data
Added ability to control number of spline knots in background subtraction
Fixed improper file name convention warnings
Added ability to apply ROI/detector choices to all files loaded in a series
Adjusted GSECARS auto-format to recognize non-adjacent ROIs. Also fixed error that occured with slight alterations in the file format
3/21/03: Version 0.43: Added arctan function to the least squares fitting module. Background subtraction routine now allows saving a first derivative of the normalized mu. Added warnings for characters in filenames that may be incompatible with IFEFFIT. Also fixed the GSE-CARS format to allow more general input with multiple ROIs.
2/13/03: Version 0.42: Fixed a few bugs in the FEFF fitting routines to allow path degeneracies to be handled better.
2/08/03: Version 0.41: Made a permanent fix for the input problems for recent files at SSRL BL 11-2. Fixed the occansional occurrence of the chi plots not plotting. Made a hack fix for some of the data scrambling that occurred when changing spline ranges in the background subtraction routine. Be sure to update Sixpack with _socket.pyd file and ensure that test.inp is in the same directory as the executable.
2/05/03: Version 0.40: Fixed a file input problem with recent files collected at SSRL BL 11-2. Also fixed a small plotting error.
2/04/03: Version 0.39: Added a version checker to the program. A status bar at the bottom of the main screen lets the user know if they have the most recent version of Sixpack or if they need to update. Also fixed some file storage errors in the least squares fitting routines. Added a library function to PCA. Users can define libraries of standard compounds. After PCA is performed, all of the files in the library will be "target transformed" to see if they fit in the vector space defined by the samples.
2/02/03: Version 0.38: Fixed minor error in fitting routine which would not plot all components of a fit in the waterfall plotting function. Also added a "self-absorption" cycle which will run the routines 10 times so you don't get excessively tired clicking the fit buttons.
1/24/03: Version 0.37: Incorporated the new IFEFFIT 1.0076. Added higher compatibility with GSE-CARS formats. Allowed user selection of Lytle vs. Ge detectors in SSRL data files that contain both sets of data. Also added a "history" function to the generic file loader so the options and column assignments are remembered between file inputs.
1/23/03: Version 0.36: Added additional auto-read formats for ALS and NSLS for single fluorescence detectors. Made the SSRL auto format more general to support varied detector formats. Abandoned use of PGPLOT to plot graphics and results. New plotter interface native with Tkinter to provide more effective cursor readouts and zoom functions. Also allows the plot window to be closed and further graphs to be created without crashing main program. Users can no longer cut and paste graphs from clipboard. However, graphs can be dumped to a gif file and imported into the document of choice. All plot interfaces in modules have a zoom history. Left click to drag new zoom view and right click to previous view. Documentation is now severely outdated!
1/21/03: Version 0.35: Many changes. Added a deglitching panel to the background subtraction panel due to popular demand. This allows basic editing of glitches. Fixed problems with changes in plot parameters not taking effect in this module as well. Added a GSE-CARS auto-read format for SamView (still preliminary). Added a zoom history to the SamView and PCA modules. Left click controls zooming in, and a right click goes back to the last zoom. Also changed least-squares fitting routine to auto-fill the x-limits if none are provided. Fixed a small error in the self-absorption correction routine that didn't work in the upgrade of the module in version 0.33. Cleaned up some of the source code as well. A new zip for the source is now present.
1/16/03: Version 0.34: Fixed memory leakage bug when calculating mu in the background subtraction routine. Also added an option to turn off grid interpolation in the least squares fitting routine. A necessary option when attempting to fit non-XAS data.
1/02/03: Version 0.33: About screen now shows proper version! Added dialog to show comments from SSRL files. Also changed the look and feel of the least-squares fitting routine. Can now use an unlimited number of component and function files. Added many functions other a simple linear function. Can allow variables in the functional expressions to be guessed or fixed. The GUI now matches the look and feel of the other modules. Fixed the install problems when used with the IFEFFIT installer. Documentation and screenshots to be updated soon!
12/15/02: Version 0.32: Fixed some minor bugs. Changed the weighting distribution on the PCA routine and added evaluation functions from Malinkowski's papers. Added a few SSRL detector specific corrections.
10/23/02: Version 0.31: Fixed minor bug to display fitting correlations in EXAFS fitting module. Documentation and screenshots are now available!
10/16/02: Version 0.30: Changes in this list now in reverse chronological order. Another major update! Main feature is addition of PCA routine. It's pretty handy. Also added scrollable windows for the SamView and PCA module for those who have smaller screens. Thanks to Francois Farges for pointing this out a while ago - I finally got to fixing it. Added a row of null radiobuttons in the generic loader so you don't need to start over if you make a mistake. Sources also updated.
10/10/02: Version 0.25: Its been too long before updating... Many additions! Thanks to many people for added feedback. Added support to rebin CS-XAS data in SamView module. Added generic file reader with scrolling windows. Small improvements on some of the interface controls, including some hiding of unnecessary windows building up. Also added window to display fit correlations in advanced fitting. Added extra file support for DND-CAT data files, including compatibility with ID line EXAFS and multi-element detectors. The file extensions of these data types are also also recognized: *.dnd = ascii and CS-XAS, *.dme = multi-element. Source codes also appropriately updated.
8/11/02: Version 0.22: Added dialog window to present fit variable correlations.
8/02/02: Version 0.21: Added support to read in generic ASCII files as raw data with assignment of data columns. Also made e0 calibration in SamView module more robust and easier to choose calibration point. Improved performance of background subtraction routine to reduce unnecessary calculations. Included support for writing FEFF input files compatible with older versions of FEFF.
7/16/02: Fixed errors in single file read in background subtraction function. Also fixed bug that showed up when performing deadtime fits on Ge detectors which have bad channels. Errors in fitting now cause a default value to created. Added these changes to the source code as well
7/9/02: First release version of SixPACK (v0.2) incorporating the 0.11 version of SamView and 2.3.1 version of SamXAS.