top of page

Under construction


This page outlines some of the basic functions of SIXPACK:
Samview - Import data, background removal, alignment

Opening a Single Energy File

Click “Open”, navigate to your T drive > beamrunfolder > xrf > and open your map hdf5 file. This opens your data and you can select elements on the left hand side.

Opening Data For Multi-Energy Maps

First open one energy map as explained above. Now select “File” and then “Rapid Import From”. This allows you to select the other energy hdf5 files. It will ask you which element you want to import. Select your element. This will add the element you selected for all the energies your selected and automatically give then and appropriate name e.g. “S@2472”. You should now save the file in case SMAK crashes. Select “File” and “Save Data”. Note you need to “Save Data” to save any changes you make from now on, just like a Word doc.

Next you should also sum the TIME channel. You will need this later. It will get rid of some artifacts and improve the images.

Normalizing with the TIME channel:

The TIME channel is to do with the timing of scan electronics. In general these can create faint vertical stripes in the data but also an artifact on the left edge of the maps which are related to the acceleration of stages at the start of each line (the latter is more of an issue with 6–2).

Click the “Map Math” button. This opens a new window that allows you to perform mathematical functions on the data. You select the channel in the left column, the operation in the middle column and next channel in the right column. You can then click “Do Calculation” which performs the function for you to asses. If you like it, you can enter a new channel name and click “Save Calculation”. This will save the result as a new channel. Here you want to select one of your “SUM” channels you created earlier in the left column, select “Multiply” in the middle column and “Scalar” in the right column. This gives you a box to enter a scalar value. Enter “0.0000125”. Give this a new name like “S Sum Time” and click “Save Calculation”. OK, that’s the more complex bit done. You should now do to the “File” menu and click “Save Data”.


Background - SMAK dynamically scales the contrast of the maps from the minimum to the maximum count values (these can be seen by moving the cursor over the map and reading the Z value). Due to the nature of the data collection, there are dead or erroneous pixels at the edge of the maps. On the left side of the map there is usually one pixel for every line that registers as very high. At the right hand side there is usually a irregular sawtooth pattern of dead pixels. This obviously then scales the maps to include lots of zeros and some very high value pixels and thus makes your actual sample look like there is very low signal and you can hardly see it (which is not in fact the case). So you obviously want to get rid of that and this is where the Zoom function comes in. As you zoom in and exclude those erroneous pixels, SMAK will rescale automatically.


There are 2 ways to zoom:

Control, click and drag a box. Right click the map and select “Clear Zoom” to revert to the full map.


Edge removal - right click on the map and select Edge Removal. Edge removal will remove 1 pixel from around the entire border of the map. Use this and you will see even with 1 pixel removed the map contrast improves greatly. Considering you don’t really know how many pixels are erroneous around the map, drawing a zoom box to include almost all of your map is, in my opinion, the way to go.

NOTE: if you right click and select “Clear Zoom” this undoes both the box zoom AND the edge removal.

Building a Queue for XAS

  1. Go to the “Legend” menu and select “Plot Marker Options”. This opens a new window.

  2. Click “Add Marker” for as many points as you like.

  3. To select a point on the map, click “Get Pos” then click your point on the map. This populates the X and Y fields with motor positions.

  4. Repeat for as many points as you like.

  5. Add graphical markers so you can see the points, go to the “Markers” menu and select “Set all Default”. This gives all the points small which circle markers.

  6. You now need to save 2 versions of this marker list. Go to the “File” menu and select “Save Parameters”. This saves a SMAK compatible version of this list so you can load this back into SMAK at a later date and see you locations.

  7. Go to the “File” menu again and select “Save as Queue”. This saves a version of the file which can be loaded into uXAS.

  8. Now go to the control computer. In uXAS and click the “Setup Queue” button. This opens the queue editor. If there are already lines in the queue you should clear these out by clicking the “Clear” button at the bottom of the window.

  9. Click the “Load Queue” button at the bottom of the window. Select the queue file you just made in SMAK. You will probably need to navigate to you “xrf” folder on your T drive.

  10. You will now see that the locations have been loaded in as separate lines into the queue editor.

  11. Edit file names, regions and repeats as appropriate. Remember to click “Accept” when you are done.

  12. If you have rearranged the order of the queue from when you saved it in SMAK you should re-save a SMAK version by clicking “Write Plot Markers” (bottom left of uXAS).

Preparing images for data analysis (correlations and PCA)

The data can contain some noise and artifacts which can reduce the quality of the data analysis. This process helps alleviate those issues

Open your data as above. Select the “Process” menu and click “Advanced Filtering”. This opens a new window with a list of elements and many buttons. Select the element you want to process and click the “Blur” button. Drag the “Filter Size” slider to 5. Drag the “Std. Dev.” slider to 0.8. Click “Save”. This creates a new channel called “Element-blur”, e.g. S-blur. Select each element you want to work with and click “Save” for each. You will end up with a set of -blur channels.

What you just did was apply a sort of smoothing to the map data. The filter size defines how many pixels around a point should be combined into one. A filter size takes a 5×5 pixel area. If you had chosen the “Mean” button, SMAK would have assigned the mean value of the 5×5 pixel area. “Blur” takes a Gaussian distribution of the area.


You can now do correlations between elements by clicking the “Correlation Plots” button. This opens a new window where you can choose to plot one channel against another. The data plotted corresponds to whatever area is in the display window. You can “Mask” particular areas of the correlation plots by clicking “Define Mask” button and drawing an area around parts of the plot. You can then click the “Use Mask” button in the main SMAK window. The display will now only display the masked area of the plot.

Principle Component Analysis (PCA)

Click the “PCA Analysis” button. Select the channels you want to do PCA on (usually multiple energy maps). There are many types of PCA you can do but start with clicking the “sPCA” button. SMAK will process the data and produce a number of new channels called e.g. “sPCAComp1”, “sPCAComp2” etc. Very broadly, component 1 is using a proxy for concentration as concentration is the greatest variable in your data. You can create an inverse image of a component map by clicking “Map Math” in the main SMAK window and selecting the channel in the first column, “Multiply” in the second column and “Scalar” in the third column, then entering −1 into the box. You can then use these images to help you select locations for XAS by following the “Building a queue” instructions.

Alignment of misaligned images

If you have images that are slightly misaligned, there is a way to register them. Say, for instance that you measured a map at 12 KeV, then decided you wanted to measure the same map at 7 KeV. The position of the beam will shift slightly between these energies, and the resulting maps will be misaligned by a few microns or so.

  1. Load you first data file (e.g. 12 KeV map), then import the channel you want to align from your second data file (e.g. 7 KeV map)

  2. Go to the Process menu

  3. Select ‘Stack Alignment’

  4. A window will pop up where you can click which channels to align (select all channels using control + left click)

  5. SMAK will now align the selected channels and make a new channel with ‘-stack1’ appended to the end of the name

  6. If you want to apply this alignment to another channel (say you collected a multi-energy map at 7 KeV and actually need to import the same channel at 5 different energies), select ‘Apply Last Alignment’ from the process menu and select the channels to which you would like to apply the alignment

bottom of page