salman cafeebc414
Build and package / build-package (push) Successful in 5m12s
Prepare muSRFlow 1.0.0-rc.6 release
2026-10-29 22:48:53 +01:00
2026-08-26 10:58:17 +02:00
2026-10-29 22:48:53 +01:00
2026-10-29 22:48:53 +01:00
2026-10-29 22:48:53 +01:00

muSRFlow

muSRFlow makes fitting muSR spectra easier: create and edit MSR models, fit single runs or run series, inspect spectra, and plot fitted parameters. It is available as a desktop application and a web application.

Current release candidate: 1.0.0-rc.6.

Installation

Start with the guide for your platform. Packaged desktop applications do not require Node.js or npm.

Platform Instructions ROOT and musrfit
Windows Install muSRFlow on Windows Included in the installer; WSL2 must be enabled first.
Linux Install muSRFlow on Linux Use a local installation or install the separate runtime.
Web Open your site's muSRFlow URL in a browser. Runs on the server; no local installation.

Already using Windows? Read the existing-installation update steps. Older runtimes need the Boost-header update as well as the refreshed application. The Windows guide also covers WSL startup errors, wsl.exe ENOENT, and missing libCore.so. Native macOS packages and Flatpak packages are not available yet.

Before your first desktop fit, choose a Work directory and Data directory in File -> Preferences. Keep your MSRs and results outside the application installation folder.

User Manual

Development and Packaging

These instructions are for working on the source code or producing installers. For installation on a user's computer, use the platform guides above.

With Node.js and npm installed, run from the repository:

npm ci
npm start

The manual uses Sphinx. Rebuild its HTML and PDF with:

cd docs
make html
make latexpdf

Web Deployment

The browser application consists of index.html, quick-start.html, ZGUI.css, muSRFitweb.js, muSRFitRoot.js, muSRFitParameterPlot.js, and muSRFitlib.js. The web plot window uses JSROOT to draw the ROOT files produced by musrview --root. Its server-side runner is documented in cgi/README.md.

Install both the browser files and CGI endpoint. The script targets the default Apache paths and hands the files to the web server's owner:

sudo ./scripts/deploy-web.sh

The web-only owner (apache/www-data/httpd) is auto-detected when the deployed tree is not already owned by the invoking user, so the script also runs unprivileged against a developer-owned web tree (skip that case's sudo). Override the targets and owner as needed with MUSRFLOW_WEB_TARGET, MUSRFLOW_CGI_TARGET, MUSRFLOW_STARTUP_XML_TARGET, MUSRFLOW_WEB_OWNER, and MUSRFLOW_WEB_GROUP.

The installed musrfit_startup.xml is rewritten when the machine's data tree lives under a non-PSI root: set MUSRFLOW_DATA_ROOT (e.g. /mnt/fake) and the <data_path> roots in the installed copy are rewritten to it so the portable RUN-name resolver matches the local data layout. The repository source file is never modified.

The server-side data root is configured separately: the CGI reads MUSRFIT_DATA_ROOT (default /psi.ch/group/lmu/public/data) and reports it to the browser through its health endpoint. When MUSRFLOW_DATA_ROOT is used, set MUSRFIT_DATA_ROOT to the same value so the path the browser shows and the security boundary agree with the rewritten startup-XML roots. See cgi/README.md for the full list of CGI environment variables.

Code Organization

The project splits platform code from shared logic so that a change is made once instead of duplicated across the desktop and web runtimes:

  • muSRFitlib.js — shared, platform-agnostic logic (MSR generation/parsing, series-fit planning and merge, fit-statistic parsing, shared-configuration protocol, command/parameter formatting). This is the canonical home for any logic that both runtimes need.
  • muSRFitelec.js — Electron-specific code (filesystem and IPC access, local process execution, local transaction adapter).
  • muSRFitweb.js — web-specific code (CGI transport, browser clipboard, drag-and-drop windows).

As a rule, the adapters supply only platform-specific primitives (filesystem, process, clipboard, HTTP) while muSRFitlib.js owns the logic. Pure transformations such as displayCommand, seriesRunDirectiveIdentity, and normalizeParameterDataHeaderLines live in muSRFitlib.js. The CGI endpoint writes files and runs external executables on the server; generated artifacts are served back over HTTP.

Contact

Zaher Salman zaher.salman@psi.ch

License

Copyright (C) 2026 Zaher Salman. muSRFlow is distributed under the GNU General Public License, version 3 or later (GPL-3.0-or-later). See LICENSE for the full license text.

2026-11-19 04:34:49 +01:00
Languages
JavaScript 85.7%
Perl 5.6%
CSS 3.2%
HTML 2.7%
Shell 1.9%
Other 0.8%