WavesFit Go · An open source spectroscopy workbench

Live fitting. One executable.
No Python setup.

Turn your acquisition computer into a live spectroscopy fitting station. Download the executable for your operating system, run it, and open the local browser dashboard. Connect a growing data file and watch peak positions, widths, and areas evolve as you measure.

No Python installation or virtual environment. No Go installation needed for the prebuilt executable. The dashboard and fitting run locally, with no account or internet connection needed after installation.

MIT licensed · macOS, Linux & Windows · Go v0.1.0 · How live acquisition works ↓ · Launch guide ↓

Try it here before installing

A new peak—or a changing background?

A shoulder appears while you measure a treated surface. Before calling it a new component, test a simpler explanation. Follow one experiment from a clean peak to a live scan, then apply the same workflow to your own spectrum.

Illustrative XPS-style measurement · Synthetic data, not a measured specimen · Energy is relative to a reference.

What you will take away

A repeatable sequence: inspect → choose the simplest plausible model → examine what it misses → add a justified constraint or component → export the analysis.

A fitted component is a model contribution. It is not, on its own, a chemical identification or a concentration measurement.

One experiment. Four decisions.

Start simple. Add only what the data need.

Runs locally in your browser

Step 01 · Locate the original line

Where is the peak, and how much signal is in it?

The reference surface has one isolated line on a nearly flat baseline. Start with one Voigt peak and one constant offset.

Your next move

Fit a single peak. Look for a stable centre and residuals that fluctuate around zero.

Why a Voigt peak? ↗
Initial result is shown. Click a step or Fit spectrum to start the local fitter (7.3 MB).

In this teaching case, a reference measurement supplies the Lorentzian FWHM of 0.30 eV. It stays fixed; centres, areas, Gaussian widths, and one offset are fitted. This is an example constraint, not a universal setting for your data.

-0.080.741.562.373.19-4.0-2.4-0.80.82.44.0Energy relative to reference (eV)Intensity
MeasuredFitBackground + offsetComponents + baseline
-0.060.000.06-4.0-2.4-0.80.82.44.0Energy relative to reference (eV)Residual
Residual = measured − fitted. A band or slope in the residuals is a clue about what the model is missing. It is more informative than how closely two lines overlap.
Complete · convergedrank 4 · 397 residual degrees of freedom
Original peak centre-0.6495 eV
Original peak area2.997Synthetic reference: 3.00 intensity × eV
Residual RMS0.0184Synthetic noise σ: 0.020 intensity
Second component's area shareNot in this modelModel area share, not concentration

One peak recovers the reference centre and area; residuals fluctuate around the synthetic noise level. Keep this as the reference before interpreting the changed surface.

Download complete example CSV

Website demo: “Watch it arrive” simulates a growing scan. A CSV chosen on this page is a snapshot. See how the installed Go application reads real acquisition files ↓

The case is controlled so you can check the answer: the main peak is at −0.65 eV with area 3; the added peak is at +0.80 eV with area 1. All stages use the same Gaussian-noise realization. Adding a parameter can improve a fit without proving a physical explanation.

A framework you can reuse

Three questions before you report a number

1. What does the instrument observe?

Keep the energy scale and units explicit. A Voigt peak combines Gaussian and Lorentzian broadening; its area and height are different quantities. Use a reference to justify a fixed width.

Widths and area conventions ↗

2. What is the model missing?

Correct a plausible baseline before adding peaks. Look for structured residuals. A second contribution should have a reason to exist and remain stable under reasonable changes of the fit interval and constraints.

Background choices ↗

3. Are the parameters determined?

A low residual does not guarantee unique widths or areas. Read convergence, rank, uncertainties, and active bounds. A growing scan is provisional; a pause does not finish the measurement.

What uncertainty does—and does not—mean ↗

Use it on a measurement

Bring your own spectrum

Choose a complete spectrum, map the columns, and start with one or two Voigt peaks. Your file stays in this browser; it is not uploaded to the website. This small workbench accepts 16–2,048 points. Use the native Go application for larger files, other models, or continuous instrument acquisition.

Or paste a text table

No data selected. Files must contain one spectrum with a strictly increasing or decreasing energy axis. Numbers use a decimal point. Optional uncertainties must be positive 1σ standard deviations in the intensity unit.

Choose a model and inspect the starting values

A suggestion sets starting values for the model you chose. It does not decide how many peaks exist. Unlike the teaching case, both widths start free.

Initial values, bounds & fixed parameters

Centres and widths use your energy unit; areas use intensity × energy. Empty bounds are unbounded. Fix only parameters supported by independent knowledge.

ParameterInitialMinMaxFixed

Select data to begin.

From the instrument to the screen

Who reads the file? Go does. The browser shows the fit.

The acquisition software saves measurements on your computer. The installed WavesFit Go executable reads new data, performs the fitting, and serves a dashboard to your browser. You keep the same dashboard open while measurements arrive.

On your acquisition computer

  1. 01 · WriteInstrument softwareAppends measurements as complete rows.
  2. 02 · SaveLocal CSV or text fileNew rows become available as the file grows.
  3. 03 · FitWavesFit GoReads new rows and updates the accumulated fit.
  4. 04 · DisplayLocal browser dashboardReceives data, fitted curves, and parameter trends.
Instrument software → local file → Go executable → browser dashboard. The browser connects to Go on the same computer; acquisition data do not pass through this website.

Open the local address printed by Go, for example http://127.0.0.1:8765. This address points to your own computer. The executable includes the dashboard and plotting assets, so the installed application works offline.

Example: one new energy point every second
  1. The instrument software appends and flushes a complete row to measurement.csv.
  2. Go remembers its reading position and reads the new rows. An unfinished trailing line waits until its newline arrives.
  3. Once enough of the configured peaks has been observed, Go refits the accumulated spectrum at the chosen cadence, starting from the last successful parameters.
  4. The browser receives local updates approximately every half-second. Fitting time depends on the data and model; backlog is visible if acquisition runs ahead.

A growing file: updates within a scan

The instrument appends points to one file. Go can show provisional fits as the spectrum fills in. A configured point count or explicit scan boundary marks completion. A pause alone does not finish a scan.

A directory: updates between scans

The instrument saves one complete spectrum per file. Publish each file by atomic rename, or create a done marker after closing it. Go processes finalized spectra in order while undispatched files remain on disk.

What is live, and where does it run?
What you openData sourceWhat updates
This website: “Watch it arrive”Synthetic teaching spectrumSimulated acquisition in your browser
This website: “Bring your own spectrum”A CSV you choose or a table you pasteA snapshot fitted locally in your browser; subsequent file changes are not monitored
Installed Go: demoLocally generated synthetic spectraSimulated acquisition in the native application
Installed Go: real file sourceA growing file or finalized-file directoryReal measurements, read and fitted by Go on the acquisition computer

Check your instrument’s output first. Fitting during a scan requires acquisition software that writes and flushes data while it runs. If it only exports at the end of each scan, WavesFit updates between completed scans. A direct instrument connection requires a custom acquisition adapter; the generic file modes read the files your acquisition software produces.

Launch Go and connect an acquisition source ↓ · File formats and scan-completion rules ↗

From a browser experiment to your instrument

One executable on the acquisition computer.

Download and extract the release for macOS, Linux, or Windows. Run the command below from that folder, then open the local URL printed in the terminal. The demo starts simulated acquisition immediately. On Windows, use wavesfit-go.exe demo.

./wavesfit-go demo

For a shared lab or beamline, the same executable gives operators the same fitting tool without maintaining a scientific Python environment. Its plotting assets are included, so the installed dashboard works offline.

Connect real acquisition by configuring a growing file or finalized-file directory in the dashboard. Set a point count, explicit scan boundary, or finalized-file rule. Save a reusable preset, then launch it for the next measurement:

./wavesfit-go serve --config acquisition.json

Watch fits, residuals, and parameter trends while data arrive. A bounded queue shows backlog when fitting falls behind; JSONL/CSV exports keep the session available for replay and analysis.

Keep the same model when moving from this page to the instrument. Download an example CSV and its Go preset, or export data and a preset from your own successful fit. The executable uses the same published Go fitting library as this page:

./wavesfit-go fit wavesfit-input.csv --config wavesfit-config.json --output result.json

The fit command above uses the filenames exported by “Bring your own spectrum”. For a guided case, substitute its downloaded CSV filename. Use wavesfit-go.exe in place of ./wavesfit-go on Windows.

Get the Go executable ↗ Acquisition and library guide ↗

For developers: install from source with Go 1.24 or later
go install github.com/AlessandroLodi/wavesfit-go/cmd/wavesfit-go@v0.1.0