Getting started
===============

Before the first fit
--------------------

Install a desktop package or open the browser edition as described in
:doc:`installation`. On the desktop, open **File / Preferences** and choose a
writable work directory outside the application installation folder. Select
your local data root as well; missing runs can be downloaded later when the
server has them.

Packaged desktop applications do not require Node.js or npm. The web edition
runs the scientific tools on its server and has no local Preferences dialog.

Your first Plot and Fit
-----------------------

.. figure:: images/runs-tab.png
   :alt: Runs tab showing instrument, year, run number, fit range, model, and the Fit and Plot buttons.
   :width: 100%

   Start in the Runs tab. The example values are illustrative; choose a run and
   model appropriate for your measurement.

#. Select the instrument and year in **Runs**.
#. Enter a known run number and check its histogram selection.
#. Press **Plot** first. Confirm that a spectrum appears and inspect the data
   range before fitting.
#. Choose the model and starting parameters, then press **Fit**.
#. Open **Parameters** and confirm that fitted values and uncertainties have
   replaced the starting values.
#. For a run series, select useful parameter rows and choose
   **Plot parameters...**.

The status bar shows the active command, work directory, and completion state.
The collapsible log records the exact shell commands and diagnostic output.
See :doc:`results-diagnostics` when an action does not complete as expected.

Where files go
--------------

The desktop writes MSR files, logs, plots, and parameter tables to the selected
work directory. The web edition keeps them in the current server job directory
and exposes them through **Results**. Changing the first run starts a new web
job; related Plot, Fit, FFT, and average views stay with the current job.

Quick Start and full example
----------------------------

The ``?`` button opens concise help for the active tab. On the desktop it opens
an independent window; in the browser it opens a modeless dialog.

For a complete workflow using real fitted LEM data and application screenshots,
continue with :doc:`lem2025-singlehist-example`.

Support
-------

For questions and bug reports, include the muSRFlow version and complete run
log. See :doc:`troubleshooting` for common workflow problems or contact
`Zaher Salman <mailto:zaher.salman@psi.ch>`_.
