Commit Graph
65 Commits
Author SHA1 Message Date
bartels-rausch 07e414c3ef Now, the function can also deal with columns that have different numbers of entires (such as from peak fitting results) 2026-03-02 14:27:28 +01:00
bartels-rausch 23e49b4330 Addes a model for gas and condensed 2p spectra (2 doublets). Small improvements and bug fixes 2026-03-02 14:26:05 +01:00
bartels-rausch 67e75cde2e Added video to file list 2026-03-02 14:24:50 +01:00
bartels-rausch 6b3c96ff27 nappFileList now supports image formats of new camera. createBEamtimeFolder is a little helper to create empty folders in the beamtime folder. Folder PShell added for h5 data that are not NEXAFS but XPS aquired with PShell. 2026-02-26 13:08:16 +01:00
bartels-rausch 66a11d47f4 first Jeti plotting function 2026-01-23 09:38:15 +01:00
bartels-rausch 484c84e5f0 Major refactor - generic model architecture with full Shirley background support
BREAKING CHANGES:
- Single-spectrum fitting only (enforces exactly one row selected)
- Gauss fitting now uses FWHM parameter instead of Gaussian width sigma
- Removed multi-row batch processing capability

NEW FEATURES:
- Generic model architecture: arbitrary number of peaks (determined by length of FitParameter.peakArea)
- Full Shirley background support for both Gaussian and Pseudo-Voigt peak shapes
- Comprehensive parameter validation system with detailed error messages
- Support for shared vs per-peak Shirley K parameters
- New fitting modes: 'positionShirley', 'widthShirley', 'widthPositionShirley'
- New custom mode: 'TwoSpinOrbitDoubletPseudoVoigtShirley'
- Automatic field name typo correction ('Bond' → 'Bound')
- Enhanced results export: now includes peakEta and peakShirleyK columns

REFACTORING:
- Centralized peak and background equations in helper functions
  - gaussPeak(), lorentzPeak(), pseudoVoigtPeak()
  - linearBackground(), activeShirleyBackgroundFwhm()
  - fwhm2w() conversion utility
- Extracted model generation to genericModelGenerator()
- Modular validation helpers: checkFieldDimension(), checkBoundsPair()
- Standardized parameter vector layouts documented for all mode/background/peak-type combinations
- Improved column resizing logic with resizeColumnHelper()
- Enhanced plotting integration with nappPlot.m and nappAddFitToPlot.m

ARCHITECTURE:
- Unified parameter extraction for all fitting modes in centralized switch-case structure
- Consistent FWHM-based width parameterization across all peak types
- Mode-specific Shirley K sizing (scalar for shared modes, array for per-peak modes)
- Comprehensive inline documentation of parameter vector layouts (50+ combinations)

IMPROVEMENTS:
- Backward compatibility for 'gauss' width mode (auto-converts to FWHM)
- Robust bounds checking with detailed diagnostic messages
- Enhanced figure generation: residuals plot + fit visualization in tiledlayout
- Better error handling for empty/malformed data structures
- NaN-padded result arrays for variable peak counts

FILE SIZE: ~73KB → ~152KB (107% increase due to comprehensive documentation and generic architecture)
2026-01-23 08:02:53 +01:00
bartels-rausch 7d37326785 import and plot function for Jeti spectrometer data and for the pressure logging at ISS. 2025-12-17 23:59:20 +01:00
bartels-rausch bf1eb85f88 added export figure description 2025-12-07 16:09:14 +01:00
bartels-rausch 484648b648 Added a function to export figure data into ascii txt files (and to plot ascii text files to check if export worked) 2025-12-07 16:05:59 +01:00
bartels-rausch 5dcb0a9119 Added list of helper functions in utils subfolder 2025-12-07 12:59:34 +01:00
bartels-rausch 74dbdda5e8 Added a list of all functions and added information on a function to join data tables with differences in column number and type. 2025-12-07 12:41:19 +01:00
bartels-rausch 38a62bf560 Updated the HowDoI: Added how to merge tables with different columns into one. 2025-12-07 11:41:12 +01:00
bartels-rausch bbfab45787 Added Example Matlab script with most common during beamtime processing 2025-12-05 15:35:30 +01:00
bartels-rausch 53dd8c6080 Added links to matlab documentation 2025-12-05 10:42:44 +01:00
bartels-rausch 1b89885447 Added documentation to readme file. Re-arranged folder content slightly 2025-12-05 10:28:16 +01:00
bartels-rausch 7677ad8668 Residuals are now plotted. And added the option to change weight for a section of data in fitting routine 2025-12-01 12:04:35 +01:00
bartels-rausch aac4e834c3 added Auger-Meitner plots and interactive NEXAFS 2025-11-24 19:08:38 +01:00
bartels-rausch 5a65fa13c4 initial commit 2025-11-21 20:03:47 +01:00
bartels-rausch efff7c29f5 Updated to new PShell file structure and added abiltiy to read several spectra in each h5 file 2025-11-21 19:51:44 +01:00
bartels-rausch 723714c85d Added some helper tools 2025-11-21 11:02:23 +01:00
bartels-rausch 74292eebd3 Small changes 2025-07-07 08:53:30 +02:00
bartels-rausch 4f21681cf6 Color scheme now a shared function. Small changes 2025-07-06 12:40:23 +02:00
bartels-rausch e48baa9d41 Specs data are now divided by number of scans (bug fix) 2025-03-04 16:18:51 +01:00
bartels-rausch 2e5f3eaf1c Started to include Speces lab XPS data. nappFileList, nappPlot, and peakFit should work 2025-03-04 15:24:55 +01:00
bartels-rausch fa1323b96d Added peak area ratio as fitting constrain. Additional small bug fixes (not sure what I did) 2025-02-27 08:59:53 +01:00
bartels-rausch 7633f3a741 First version import-export to h5 file 2024-05-23 07:16:38 +02:00
bartels-rausch 683e0198e6 Added feature to merge 2 tables, not only to add a row to a table 2024-05-23 07:08:40 +02:00
bartels-rausch 20577d00be Don't remember what I changed 2024-05-23 07:07:44 +02:00
bartels-rausch 0c5c4f6ed9 Added linear background fit. 2024-05-23 07:07:13 +02:00
bartels-rausch 43889de25b Import is now backward compatible with files dating 2018 2024-04-23 12:50:06 +02:00
bartels-rausch 3f0d9be72a Add a function to merge two tables that might have different columns. Both sets of columns are preserved 2024-02-29 16:15:00 +01:00
bartels-rausch f61e1113b0 Added more options to exclude data in background fit and made the call to nappFitGAussXps more consitent 2024-02-20 15:17:04 +01:00
bartels-rausch 81d49ccbbd Added exponential fit and divide for binding energy scale. Needs testing. 2024-01-27 15:32:27 +01:00
bartels-rausch a61f4b7141 Bug fix in using the input parser of the NappFitGaussXPS.m function. This impacts the functions calls in all scripts and functions
git push
2024-01-26 09:06:53 +01:00
bartels-rausch 7729717da5 small bug fixes and 2023-11-28 14:36:44 +01:00
bartels-rausch 8b55810fc6 Added exponential fit. Added divide by background to normalise intensity. 2023-11-16 07:17:37 +01:00
bartels-rausch 4ad9ccbd35 Added Gauss Fit to determine peak positions. Uses nappFitGaussXps.m 2023-11-16 07:16:11 +01:00
bartels-rausch 3a0a97fe88 Added model with 5 features: acid-base, gas-phase, acid-base. Both acid-base (feature 1,2,4,5) have one fixed and one relative BE. Position and width of gas-phase feature is unconstrained. 2023-11-16 07:14:25 +01:00
bartels-rausch 1aa130982f Added Gauss Peak Fitting to XPS shift determination. First implementation for positionWidth contrained fit. Not yet documented. Not yet fully tested. WIP 2023-11-09 07:37:10 +01:00
bartels-rausch b23894e06c initial files 2023-10-31 11:16:30 +01:00
bartels-rausch 62181940c5 Small debugging 2023-10-31 11:12:17 +01:00
bartels-rausch 0337ecc260 Merge branch 'main' of https://gitlab.psi.ch/5505/functionsMatlab 2023-10-31 10:06:36 +01:00
bartels-rausch 419fd691ee Move from SWITCH to GITLAB. Copy files with local changes to this project from Switch folder. GITLAB is now most recent and updated. 2023-10-31 10:04:02 +01:00
bartels-rausch bbcabaa4bc Add new directory for lopap procedures 2023-10-31 10:00:02 +01:00
florez_j 895585a206 Updated to admit changes performed on save_table_as_hdf5.m 2023-10-06 15:40:36 +02:00
florez_j bb09c5fe28 Added two features. 1) to facilitate python access, we now preprocess
input_table so that string variables are changed as cellstr and
multicolumn variables (e.g., scientaEkinRange_eV) are splitted into
independent variables. 2) we now support when there is no dataset columns (arrays) by creating a dummy dataset called DS_EMPTY. This is required to create a new h5 file for the first time using h5create.
2023-10-06 15:25:21 +02:00
florez_j ac7f34a30a Modified output_table to be created from cell array using cell2table() instead of array2table(). This extracts the contents of each cell, facilitating later column based filtering ops. 2023-08-18 14:24:47 +02:00
florez_j 596a35f7f1 Modified read_hdf5_as_table.m to read String entries as chars. 2023-08-18 11:47:20 +02:00
florez_j c23464c795 Modified code to write dataset and attributes' names with the indices of the original table's columns. The indices can then inferred by examining the names. 2023-08-15 13:25:15 +02:00
florez_j 384e5e62d5 Made some modifications to preserve original ordering of the table's columns/vars. 2023-08-15 13:18:40 +02:00