Skip to content
XRD Analyzer

1. Getting Started Guide

A step-by-step tutorial for uploading raw scan data, setting filter thresholds, running profile fits, and matching mineral reference libraries.

Introduction to the Interface

When you first open XRD Analyzer, the WebAssembly engine starts loading Pyodide in the background. Because it downloads a full Python compilation alongside scientific libraries like NumPy and SciPy, this first launch takes about 8 to 12 seconds depending on your connection. Once loaded, the engine is cached by your service worker, enabling instant loads on subsequent visits.

Step 1: Loading Experimental Data

To begin, you can drag and drop your raw scan file onto the dashed loading zone or click the prompt to select a local file. If you don't have a dataset ready, click the **"Or load example data"** button. This imports a pre-loaded pattern of alpha-Quartz (SiOβ‚‚), along with its reference Crystallographic Information File (CIF), giving you an immediate preview of the tool's capabilities.

[Upload Area] → Click "Load Example Data" → Plotly Graph Renders
Figure 1.1: Loading process for example experimental data.

Step 2: Configuring Pre-processing Filters

Use the sidebar controls to adjust pre-processing filters. The background removal toggle uses the SNIP algorithm to filter out baseline noise caused by thermal diffuse scattering or fluorescence. You can adjust the Savitzky-Golay smoothing window slider to reduce measurement noise, or toggle $K\alpha_2$ stripping to remove secondary reflections.

The background removal process uses Python's pybaselines.whittaker.snip function:

# Typical background clipping iteration
background, params = snip(intensity, max_half_window=40, decreasing=True)

Step 3: Running Peak Detection and Fitting

Navigate to the peak detection tab in the sidebar. Adjust the height and prominence thresholds to isolate experimental peaks relative to the background level. Click **"Auto-detect Peaks"** to identify peaks, calculate matching d-spacings via Bragg's Law, and fit them using a Pseudo-Voigt model. Fitting results, including FWHM and area, will display in the peak table.

Step 4: Database Search & Phase Matching

If you want to identify phases, go to the CIF Matcher tab. You can upload custom `.cif` files or search the Crystallography Open Database (COD) by typing formulas (like Fe2O3 or SiO2) into the search bar. When you import a phase, it overlays theoretical reflection sticks on the plot, calculating a Figure-of-Merit (FOM) match coefficient.