Spectra Background Remover
Fri, 01/22/2021 - 08:49 pm
This project provides functionality for calculating and removing (subtracting) backgrounds from (1D) data. The main purpose is to correct inelastic scattering backgrounds from photoemission spectra, but some general background types for other purposes are included as well. Both a GUI for interactively subtracting backgrounds as well as a function for calculating backgrounds from input data is provided.
Note that it is always better to directly include the correct background function during curve fitting for analysis instead of subtracting data 'by hand'. Most of the background types provided here are also found as fit functions in the Multipeak-fit package for Igor 9.
I tried my best to test everything thoroughly, but you should verify the correct behavior yourself for critical applications. Bug reports and suggestions for new features are welcome.
Included background types:
- Constant: Subtract a constant value.
- Step: Smooth step function which connects the two endpoints (using tanh()).
- Linear: Linear function through the two endpoints.
- Exponential: Normalized exponential function connecting the two endpoints.
- Polynomial: Polynomial function fitted within the selected range.
- Total Sum: The total sum inelastic scattering background after X. Li et al., J.Electron Spectrosc. Relat. Phenom. 63 (1993) 253-265
- Shirley: The iterative Shirley inelastic scattering background after A. Proctor and P. A. Sherwood, Anal. Chem. 54, 13-19 (1982)
- Tougaard: Three- and four-parameter universal scattering background after S. Tougaard, Surf. Interface Anal. 25: 137-154 (1997)
- Tougaard Data: Scattering background using scattering cross-section data after S. Tougaard, Surf. Interface Anal. 25: 137-154 (1997).
This data should ideally have a positive X scale starting from zero and at least the same total X width as the current spectrum (data not starting from x = 0 will be padded with zero values, and data which is too short may give the wrong result), like this one:
Basic controls in the GUI:
To start, select a (1D) wave in the Data Browser and then select 'Spectra Tools' -> 'Background Subtraction ...' in the top menu. Or use the command line:
- Subtract: Subtracts the current background (blue trace) from the data and then works with the subtracted data. This can be used to successively subtract multiple types of backgrounds one after another.
- Undo: Reverts to the initial data.
- Save Background: Saves the current background (blue trace) and current preview of the subtracted data (green trace) next to the original data.
- Overwrite & Quit: Overwrites the original data with the current spectrum (red trace). This will not have any effect on the original data if no background was subtracted in the first place.
- Left & Right: Shows and modifies the cursor positions, which mark the effective range. The cursors can be dragged directly as well.
- Fuzzy Range: The range is marked with the cursors and the Y height of the current data is used as start- and endpoints. The data is averaged over a certain range to smooth out noise. Set to zero if the range should end at the exact cursor location
- Background specific controls will appear, which are explained in tooltips.
Running your own code:
You can generate backgrounds using the function:
GenerateBackground(backstruct, datawave, backwave, [from, to])
Populate the BackRemoveStruct with the desired parameters and provide both the original data (datawave) and a wave which the background will be written to (backwave). Both datawave and backwave need to have the same size and scaling. Here is an example (for data with an x-scaling from 0 to 40):
STRUCT BackRemoveStruct s
Duplicate/O inwave, $(NameOfWave(inwave)+"_bk")
Wave backwave = $(NameOfWave(inwave)+"_bk")
String statusmsg = GenerateBackground(s, inwave, backwave, from=10.5,to=37.7)
Current Project Release
|Release File:||Background Remover_v1.32.zip|
|Version Date:||Thu, 02/04/2021 - 04:56 am|
|Version Patch Level:||32|
|OS Compatibility:||Windows Mac-Intel|
Minor window and control size adjustments for an improved layout on Mac.
Igor Pro 8
Igor XOP Toolkit
Igor NIDAQ Tools MX