-
Notifications
You must be signed in to change notification settings - Fork 1
CasaXPS data analysis results parsing #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lukaspie
merged 23 commits into
main
from
21-xps-data-analysis-results-parsing-through-config-file
Feb 3, 2025
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3cf981a
remove intermediate mapping from vms reader
lukaspie 4add1eb
calculate lineshape of vms components
lukaspie 71f1236
mypy fix
lukaspie 340f763
parse data analysis in Casa from main file and export files
lukaspie 1bdfa31
update tests for vms comments
lukaspie 0447e27
add test case for vms data analysis
lukaspie 7de621c
small changes to the vamas data parsing
lukaspie d63ddf5
make scripts executable
lukaspie 55b7682
bring in peak/background intensities for default view
lukaspie d8e1db3
make NXfit default view if it exists
lukaspie 53a6308
regenerate ref data anaylsis nxs file
lukaspie b24d8a2
mypy fixes
lukaspie 672760b
regenerate nxs files, skip units with no parents
lukaspie c278972
shuffle around examples, add docs
lukaspie d66d250
update example regeneration script
lukaspie 7956705
use typing for python 3.8
lukaspie a86e4a1
small code review
lukaspie b34c66f
more elaborate default settings
lukaspie 7856cd5
small code optimizations
lukaspie 97d129e
escape brackets in entry names to find components
lukaspie abcf6b6
small bug fix for writing default for NXfit instances
lukaspie 5b5a9fb
fixes for python 3.8
lukaspie 225a340
fixes for python 3.8
lukaspie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,45 @@ | ||
# Data processing with CasaXPS | ||
# Data processing with CasaXPS | ||
|
||
```pynxtools-xps``` supports extracting data and the description of the data analysis (i.e., peak fitting) | ||
by the [CasaXPS data analysis software](http://www.casaxps.com/). | ||
|
||
## Modeling of peak fitting in CasaXPS | ||
|
||
This is a short description of how peak models are implemented in CasaXPS. The user is referred to the [CasaXPS web site](http://www.casaxps.com/) for a more accurate and detailed explanation. | ||
|
||
CasaXPS models peak fitting using two concepts: **regions** and **components**. Regions define the energy range | ||
that is used for peak fitting as well as the background shape to be used. Many different background shapes are | ||
available in CasaXPS, including the most commonly used linear, Shirley, and Tougaard backgrounds. Each peak model is made up of several components, each of which model a single chemical species. Components can have many different line shapes. Constraints with respect to the total area, full-width at half maximum, and position on the energy axis can be defined as well, also with respect to any of the other components. | ||
|
||
## Modeling of data fitting in NeXus | ||
|
||
NeXus contains a base class for modelling fit procedures called [`NXfit`](https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXfit.html). ``NXfit`` contains | ||
|
||
- the data to be modelled | ||
- one or more instances of [`NXpeak`](https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXpeak.html) to define individual peaks in the model. These map to the components in | ||
CasaXPS | ||
- one or more instances of [`NXfit_background`](https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXfit_background.html) to define the background to be subtracted during the fit. These map to the regions in CasaXPS. | ||
- two instances of [`NXfit_function`](https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXfit_function.html) to describe the function used for the global fit (`global_fit_function`) and for the optimization (`error_function`). | ||
- information about the fitting envelope and the residual of the fit | ||
|
||
The application definition `NXxps` implements an [`NXfit` group](https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXxps.html#nxxps-entry-fit-group) to model peak fitting in XPS. Aside from the terms defined in the base class `NXfit`, it also contains some information more specific to XPS fits, like the atomic concentration of each species in the fit model. | ||
|
||
## How-to convert peak fitting in CasaXPS into a NeXus file | ||
|
||
```pynxtools-xps``` can extract the definition of the peak fitting parameters and store them in an HDF5 file compliant with the `NXxps` application definition. | ||
|
||
Three files are needed for the example conversion: | ||
|
||
1) The VAMAS (.vms) file containing the original (meta)data and the definition of the peak fitting in the VAMAS | ||
comments | ||
2) The lineshapes of the measurement data as well as the peak fitting, exported from CasaXPS as a TXT file. | ||
This file can be obtained by using the `Save Tab ASCII` to TXT button in CasaXPS and choosing "Rows of Tables" as the export option. | ||
3) The analysis results (incl. the atomic concentrations), exported from CasaXPS as a CSV file. This file can be obtained from the `Quantify` window in CasaXPS and exporting the "Comps" report from the "Report" tab. You can learn more about XPS quantification in CasaXPS [here](http://www.casaxps.com/casaxps-training/quantification/quant.htm). | ||
|
||
You can have a look a the example conversion to understand which exported files are expected for the data reader to work. | ||
|
||
## Example conversion | ||
See [here](../reference/vms.md#data-analysis-and-peak-fitting) for an example of converting VAMAS data containing | ||
data analysis results from CasaXPS. The resulting file looks like this: | ||
|
||
 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.