Adds native IDE parameter suggestions, name-value pair tracking, and enum choices for all NAPP functions based on their current inputParser configurations.
Both Scienta (.ibw) and SpecsLab (.xy) raw files capture multidimensional XPS data but use different terminology to structure it. Scienta uses "Region Iterations" and "Sequence Iterations". SpecsLab organizes data by "Groups" or "Regions" (different elemental energy sweeps), "Scans" (time-resolved repetitions), and "Curves". Scienta Region Iterations are automatically averaged to improve the signal-to-noise ratio, while Scienta Sequence Iterations and SpecsLab Scans are preserved to keep the time-resolved data. For SpecsLab files specifically, distinct Regions are split into separate table rows. Ultimately, the preserved time-resolved data is saved in the table's image variable as a 2D matrix ([Energy bins × Sequence iterations/Scans]).
File type handling: Added .xy as a recognized XPS format. Currently, the script differentiates data types strictly by file extension (NEXAFS: .h5, XPS: .ibw and .xy). This extension-based differentiation needs to be improved in future updates.
Metadata parsing: Implemented global header scanning for .xy files to correctly extract instrument parameters (Acquisition Mode, Lens Mode, Slit, Workfunction) located before the first region block.
Timezone alignment: Added timestamp conversion for .xy files from UTC to local time (Europe/Zurich) to ensure synchronization with LabView logs.
Region separation: Modified .xy parsing to append a _RegX suffix to filenames. This correctly splits single .xy files that contain multiple elements or energy sweeps into distinct table rows so they can be processed individually.
Import efficiency: Added an originalFileName variable. The script now cross-references the input DataTable and skips files that have already been imported to reduce execution time on re-runs.
Testing status: Processing of .xy data has currently only been tested and debugged with nappGenerateSpectra and nappPlot. Compatibility with other functions in the suite remains untested.
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)