Papers
Topics
Authors
Recent
Assistant
AI Research Assistant
Well-researched responses based on relevant abstracts and paper content.
Custom Instructions Pro
Preferences or requirements that you'd like Emergent Mind to consider when generating responses.
Gemini 2.5 Flash
Gemini 2.5 Flash 73 tok/s
Gemini 2.5 Pro 40 tok/s Pro
GPT-5 Medium 32 tok/s Pro
GPT-5 High 28 tok/s Pro
GPT-4o 75 tok/s Pro
Kimi K2 184 tok/s Pro
GPT OSS 120B 466 tok/s Pro
Claude Sonnet 4.5 35 tok/s Pro
2000 character limit reached

XASproc JavaScript Library

Updated 19 September 2025
  • XASproc is a web-based JavaScript library for performing X-ray absorption spectroscopy analysis, offering routines for normalization, background subtraction, and EXAFS extraction.
  • The library leverages advanced mathematical algorithms like polynomial fitting and Fourier transforms to ensure precise, interactive spectral processing.
  • Its integration with the XASVue viewer on XASDB promotes FAIR data principles by standardizing protocols and facilitating collaborative research.

The XASproc JavaScript Library is a web-based module developed as a core analytical engine for the XASDB platform. Designed to process X-ray absorption spectroscopy (XAS) data entirely within the browser, XASproc delivers advanced routines previously reserved for specialized desktop environments. The library is tightly integrated with the XASVue viewer on the Canadian Light Source’s XASDB, enabling normalization, background subtraction, extended X-ray absorption fine structure (EXAFS) extraction, and preliminary spectral analysis, with immediate graphical feedback and broad accessibility. By implementing rigorous mathematical algorithms and adhering to standardized analytical protocols, XASproc serves both collaborative research and educational initiatives, promoting FAIR (Findable, Accessible, Interoperable, Reusable) data principles within the synchrotron user community (Spasyuk, 16 Sep 2025).

1. Functional Overview

XASproc automates the core tasks required for XAS spectrum pre-processing and EXAFS analysis:

  • Data Ingestion: The library identifies and reads relevant intensity channels (I₀ for incident, Iₜ for transmitted, I_f for fluorescence) based on the measurement mode, enabling universal support across transmission, fluorescence, and total electron yield (TEY) datasets.
  • Normalization: For transmission measurements, XASproc applies the Beer–Lambert law,

μ(E)=1xln(I0It)\mu(E) = \frac{1}{x}\ln\left(\frac{I_0}{I_t}\right)

where xx is sample thickness. In fluorescence mode, the proportionality μ(E)IfI0\mu(E) \propto \frac{I_f}{I_0} is used. Pre-edge fitting (linear function Spre(E)S_\text{pre}(E)), edge-step determination (Δμ\Delta\mu), and post-edge background (polynomial or spline Spost(E)S_\text{post}(E)) yield a normalized attenuation coefficient:

μcorrected(E)={[μ(E)Spre(E)]/ΔμEE0 [μ(E)Spost(E)+Δμ]/ΔμE>E0\mu_\text{corrected}(E) = \begin{cases} [\mu(E) - S_\text{pre}(E)] / \Delta\mu & E \leq E_0 \ [\mu(E) - S_\text{post}(E) + \Delta\mu] / \Delta\mu & E > E_0 \end{cases}

  • Background Subtraction: Two methods are implemented: cubic smoothing spline, with the number of control points Nknots0.326Rbkg[EmaxE0EminE0]N_\text{knots} \approx 0.326 R_\text{bkg}[\sqrt{E_\text{max}-E_0} - \sqrt{E_\text{min}-E_0}], and adaptive weighted polynomial fitting, both applied for optimal isolation of oscillatory EXAFS signal.
  • EXAFS Extraction: After background correction, the EXAFS function is calculated as

χ(E)=μ(E)μ0(E)Δμ0\chi(E) = \frac{\mu(E) - \mu_0(E)}{\Delta\mu_0}

with energy-axis transformation to wavevector k=2me(EE0)/2k = \sqrt{2m_e(E - E_0)/\hbar^2} and k-weighting (e.g., χ(n)(k)=knχ(k)\chi^{(n)}(k) = k^n \cdot \chi(k)) for enhanced signal selection.

  • Fourier Transform and Windowing: Numerical Fourier transform (Riemann sum) from kk-space to RR-space,

χ(R)2πk[χ(k)W(k)e2ikRΔk]\chi(R) \approx \sqrt{\frac{2}{\pi}} \sum_k [\chi(k)\cdot W(k)\cdot e^{-2ikR}\Delta k]

is supported; Hanning and Kaiser window functions are available for artifact minimization, including cosine tapering and modified Bessel weighting.

Quality control is provided via the Background Quality Score (BQS), itself a composite of weighted k³ mean offset, slope, symmetry, and variance metrics.

2. Analytical Algorithms and Mathematical Formulation

The library’s major computational routines are implemented in Vanilla JavaScript, eschewing third-party frameworks for performance and portability. Key routines include:

  • Polynomial and Spline Fitting: Used for pre/post-edge baseline correction and background removal, with user-adjustable parameters through the graphical interface. Spline control-point estimation is governed by the modified Newville expression for NknotsN_\text{knots}, balancing overfitting and underfitting in EXAFS extraction.
  • Savitzky–Golay Smoothing: Applied for enhanced signal-to-noise ratio prior to further transformation.
  • Energy-Wavevector Conversion: Nonlinear transformation supports the requirements of EXAFS theory.
  • Fourier Transformation: Performed numerically with explicit windowing for R-space signal analysis.
  • Window Functions: Hanning window

wtaper(n)=12(1cos(πn))w_\text{taper}(n) = \frac{1}{2}(1 - \cos(\pi n))

for n[0,1]n \in [0, 1], and Kaiser window (modified Bessel form) for optimal k-space selection.

Each algorithm and parameterization is presented to the user within XASVue, with direct plotting of normalized spectra, background fits, χ(k)\chi(k), and χ(R)\chi(R) for interactive review.

3. Comparison to Traditional Desktop Tools

Historically, XAS data processing has required specialized desktop environments including Athena, Larch, and EXAFSPAK, with separate utilities for data conversion and spectral visualization. XASproc introduces several key differences:

Feature Traditional Desktop XASproc Browser-based
Installation Required None (runs in browser)
OS Compatibility Limited Universal (via JS)
User Interactivity Moderate Real-time, interactive GUI
Visualization External tools needed Integrated (XASVue)
Data Accessibility Local only Web, database-integrated

A plausible implication is that XASproc democratizes access to high-quality analytical routines and broadens the user base beyond institutions with pre-existing infrastructure (Spasyuk, 16 Sep 2025).

4. Integration and Modular Design

XASproc’s architecture supports seamless integration with the XASDB platform and the XASVue viewer:

  • Automated Workflow: Spectra loaded in XASVue are processed through XASproc analytics, with immediate overlays of background, normalized, and extracted EXAFS signals.
  • Export Capabilities: Data can be exported in native beamline formats as well as the XDI (X-ray Data Interchange) standard, supporting downstream use in linear combination fitting (LCF), machine learning workflows, and educational settings.
  • Parameter Control: Users can tune polynomial orders, spline knot counts, window ranges, and weighting factors dynamically, with all changes reflected in real-time spectral plots.

This modular approach strengthens collaborative research, as analysis protocols and output are standardized across users and sites.

5. Impact on FAIR Data Principles and Collaborative Research

XASproc contributes to the dissemination of FAIR data practices by:

  • Findability and Accessibility: As part of XASDB, all processed data, provenance information, and metadata are inherently discoverable and accessible online.
  • Interoperability: Data conform to XDI and open-access licensing (CC BY 4.0), permitting cross-platform and cross-software compatibility.
  • Reusability: The standardized protocols and export routines facilitate wide reuse for further analysis, educational modules, and machine learning efforts.
  • Collaborative Engagement: Browser-based, installation-free access allows global user groups to analyze and share XAS data immediately, eliminating barriers related to platform dependence or software licensing. This suggests a measurable improvement in reproducibility and protocol harmonization for the synchrotron community (Spasyuk, 16 Sep 2025).

6. Significance and Limitations

The XASproc JavaScript library encapsulates robust and well-established XAS analysis methodologies within a format accessible to a broad technical audience. Its integration within XASVue provides real-time, interactive exploration of normalization, background subtraction, and EXAFS analysis, offering parity with traditional desktop tools in a web environment. By adhering to open data principles, it fosters collaborative research and participation in data-driven material science, chemistry, environmental research, and biology.

This suggests that while XASproc rivals desktop software in functionality, limits imposed by client-side execution, simplified physical models, and finite Hilbert space representations may constrain ultra-high-precision applications. Nevertheless, its modular, transparent workflow and standardized output support reproducible research and pedagogical utility across domains.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)
Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to XASproc JavaScript Library.