16 Commits
Author SHA1 Message Date
bartels-rausch 2ec52b7ee7 Add openBIS sync pipeline; fix nappFileList/nappGenerateSpectra/nappPlot bugs; add importData.m ground script
beamtime/nappFileList.m
- Fix h5 LensMode: translate numeric codes to descriptive text (e.g. 1 ->
  T_HiPPHAXPES) to match what .ibw files already store, applied across all
  three h5read fallback branches, not just the oldest-format one

beamtime/nappGenerateSpectra.m
- Bug fixes

beamtime/nappPlot.m
- Bug fixes

import/importData.m (new)
- Ground script for one beamtime: import (nappFileList,
  nappGenerateSpectra), sample/spot and photon-energy assignment per row
  range, campaign metadata (CustomProperties) and column
  descriptions/units set inline, tidy-up, and export to .csv/.mat/.h5
  (via nappExportH5). Leaves FileList in the workspace for PublishReport.m
  and callOpenbisSync.m to run against afterward.

import/nappExportH5.m (new)
- Export FileList + campaign metadata + raw source files to a
  self-contained HDF5 archive
- Low-level HDF5 API (H5F/H5G/H5D/H5A/H5T/H5S/H5P) to fix
  H5FD_truncate/"too many open files" errors from the top-level
  h5create/h5write functions each reopening the file internally
- Explicit rowIndex attribute per row group, since HDF5 group listing
  order isn't guaranteed to match table row order

openBIS/ (new)
- nappSyncToOpenbis.py, callOpenbisSync.m, testpybis.m, README.md
- openBIS sync pipeline: create-or-update per row matched by $name,
  correct lowercase property codes, timestamp formatting, parent linking,
  raw file upload, plot/photo/video thumbnail embedding, config/engine
  split for maintainability -- see README.md for full details
2026-08-31 14:31:39 +02:00
bartels-rausch 5b9c7608d7 Data import now works with 2016 data, too. Data tracking added to md file. 2026-08-21 10:18:39 +02:00
bartels-rausch 3ad96b3890 ISS 2.0 ready 2026-07-03 21:54:47 +02:00
bartels-rausch 2a22d2dbea bug fixes 2026-05-04 19:03:39 +02:00
bartels-rausch 091cf00e77 Refactor energy calibration pipeline, introduce modern arguments blocks, and add universal logging
* Transitioned nappNorm, nappDetermineShift, and nappCopyShift to use modern MATLAB arguments blocks, removing their legacy functionSignatures.json entries.

* Refactored nappNorm to rely on prior peak fitting results (e.g., from nappFitGaussXps) for normalization rather than performing the fitting internally.

* Decoupled energy calibration: nappDetermineShift now solely calculates internal binding energy shifts, and nappCopyShift distributes them using a unified matching engine ('earlier', 'after', 'spectrumNumber').

* Implemented a Universal Logging Block to track data provenance, automatically appending execution timestamps and caller script names to processed rows.

* Updated nappCombineSpectra to output a logDataSource cell array and cleanly name combined spectra.

* Created nappSaveDataTable for automatic, script-named .mat file saving, complete with a Live Editor interceptor.

* Added a publish-mode silencer to nappFitGaussXps to prevent optimizer spam in generated PDFs.

* Updated readme.md to document the new arguments structure, the 3-step calibration workflow, the matching engine, and the new table variables.
2026-03-25 12:07:49 +01:00
bartels-rausch a26847b332 Good to know I'm smarter than google gemini. That code did not run. fixed it. Also fixed a time issue. Start aquisition is now taken from the logged time in the data file or if that is not present the OS creation date. the end aquisition time is the last modification time of the os for that file. 2026-03-12 13:35:27 +01:00
bartels-rausch d7bc516442 Bug fix. The excitation energy for our offline XPS is wrong in the xy files. Set it to 1253.6 eV during import 2026-03-12 10:26:31 +01:00
bartels-rausch 00d34110db MAJOR UPDATE: Add support for Specs .xy files from offline XPS (Soleil/Luca)
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.
2026-03-12 10:08:47 +01:00
bartels-rausch d521db8cb8 Now uses helper function to merge data tables with different columns 2026-03-04 17:04:02 +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 1b89885447 Added documentation to readme file. Re-arranged folder content slightly 2025-12-05 10:28:16 +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
florez_j f5385a98c0 Revert "Deleted unnecessary files."
This reverts commit a27e9e459a.
2023-08-10 09:19:49 +02:00
florez_j a27e9e459a Deleted unnecessary files. 2023-08-09 16:32:21 +02:00
florez_j d64e4d5916 Restructured folder structure and deleted irrelevant scripts. 2023-08-09 16:22:46 +02:00