updated of the offline docu.

This commit is contained in:
2025-06-09 09:10:49 +02:00
parent 0943f1f061
commit 0cde84d756
63 changed files with 6618 additions and 22247 deletions

View File

@ -1,90 +1,50 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tutorial for musrfit &mdash; musrfit 1.9.5 documentation</title>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tutorial for musrfit &mdash; musrfit 1.9.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=7a5cd723" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=4320943d"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="User manual" href="user-manual.html" />
<link rel="prev" title="How to Cite musrfit?" href="cite.html" />
<link href="_static/style.css" rel="stylesheet" type="text/css">
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> musrfit
<a href="index.html" class="icon icon-home">
musrfit
</a>
<div class="version">
1.9
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="cite.html">How to Cite <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>?</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></a><ul>
@ -114,72 +74,34 @@
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">musrfit</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></li>
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/tutorial.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="tutorial-for-musrfit">
<span id="index-0"></span><h1>Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code><a class="headerlink" href="#tutorial-for-musrfit" title="Permalink to this headline"></a></h1>
<div class="section" id="single-histogram-fit-tutorial">
<h2>Single-histogram-fit tutorial<a class="headerlink" href="#single-histogram-fit-tutorial" title="Permalink to this headline"></a></h2>
<section id="tutorial-for-musrfit">
<span id="index-0"></span><h1>Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code><a class="headerlink" href="#tutorial-for-musrfit" title="Link to this heading"></a></h1>
<section id="single-histogram-fit-tutorial">
<h2>Single-histogram-fit tutorial<a class="headerlink" href="#single-histogram-fit-tutorial" title="Link to this heading"></a></h2>
<p>The μSR-data-analysis process using musrfit is based on so-called msr files. These files contain all
information needed for the analysis such as names of the data files, a theory function, fit and plot parameters,
and so on. It is the idea of this page to explain the basic use of an msr file and the different programs
@ -194,8 +116,8 @@ with the source-code distribution in the sub-directory <code class="docutils lit
text editor. For convenience the editor <code class="docutils literal notranslate"><span class="pre">musredit</span></code> is provided which offer some msr-file-specific functionalities
and additionally serve as front ends to the underlying programs. In the following it is assumed that the file is
open within <code class="docutils literal notranslate"><span class="pre">musredit</span></code>.</p>
<div class="section" id="the-msr-file">
<h3>The msr file<a class="headerlink" href="#the-msr-file" title="Permalink to this headline"></a></h3>
<section id="the-msr-file">
<h3>The msr file<a class="headerlink" href="#the-msr-file" title="Link to this heading"></a></h3>
<p>The msr file itself is divided into different blocks; a full description of the format can be found <a class="reference internal" href="user-manual.html#msr-file-format"><span class="std std-ref">here</span></a>.
In the file <code class="docutils literal notranslate"><span class="pre">3110_tutorial.msr</span></code> these blocks are successively:</p>
<p><a class="reference internal" href="user-manual.html#msr-title-block"><span class="std std-ref">The title</span></a></p>
@ -258,7 +180,7 @@ sample holder), each with an amplitude (parameters 10 and 13), a depolarization
</pre></div>
</div>
<p>The THEORY block is used to define a fit-parameter-dependent theory function used to model
the decay asymmetry. Different <a class="reference internal" href="user-manual.html#msr-theory-block"><span class="std std-ref">predefined</span></a> and <a class="reference internal" href="user-manual.html#id38"><span class="std std-ref">user-defined</span></a>
the decay asymmetry. Different <a class="reference internal" href="user-manual.html#msr-theory-block"><span class="std std-ref">predefined</span></a> and <a class="reference internal" href="user-manual.html#id41"><span class="std std-ref">user-defined</span></a>
functions can be combined here. Theory lines following each other are <em>multiplied</em> and the <strong>+</strong> sign
is used to add different (here: two) signal contributions. The numbers are the parameter numbers
according to the <code class="docutils literal notranslate"><span class="pre">FITPARAMETER</span> <span class="pre">block</span></code>. <code class="docutils literal notranslate"><span class="pre">map</span></code> and <code class="docutils literal notranslate"><span class="pre">fun</span></code> are used to refer to
@ -418,13 +340,13 @@ date and time as well as the absolute and normalized values of <span class="math
number of degrees of freedom in the fit.
These information only have a meaning if the fitting procedure has been executed at
least once and the fit has converged!</p>
</div>
<div class="section" id="determine-t0-and-the-data-range-using-musrt0">
<h3>Determine t0 and the data range using musrt0<a class="headerlink" href="#determine-t0-and-the-data-range-using-musrt0" title="Permalink to this headline"></a></h3>
</section>
<section id="determine-t0-and-the-data-range-using-musrt0">
<h3>Determine t0 and the data range using musrt0<a class="headerlink" href="#determine-t0-and-the-data-range-using-musrt0" title="Link to this heading"></a></h3>
<p>Before the given model can be fitted to the data, the data ranges and time zeros of the different
<code class="docutils literal notranslate"><span class="pre">RUN</span> <span class="pre">blocks</span></code> have to be set correctly. This can be achieved using <a class="reference internal" href="user-manual.html#musrt0"><span class="std std-ref">musrt0</span></a>.
Starting this program by selecting the <code class="docutils literal notranslate"><span class="pre">musrt0</span></code> button in <code class="docutils literal notranslate"><span class="pre">musredit</span></code> or calling from a terminal</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ musrt0 3110_tutorial.msr
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>musrt0<span class="w"> </span>3110_tutorial.msr
</pre></div>
</div>
<p>opens an interactive window plotting the data of the first RUN block:</p>
@ -441,38 +363,38 @@ when the cursor is found at a suitable location:</p>
This procedure is repeated until all ranges have been set correctly. When finished with the last histogram
the new t0 and data-range values will be written to the msr file. A full description of <code class="docutils literal notranslate"><span class="pre">musrt0</span></code> can be
found <a class="reference internal" href="user-manual.html#musrt0"><span class="std std-ref">here</span></a>.</p>
</div>
<div class="section" id="fit-the-model-to-the-data-using-musrfit">
<h3>Fit the model to the data using <code class="docutils literal notranslate"><span class="pre">musrfit</span></code><a class="headerlink" href="#fit-the-model-to-the-data-using-musrfit" title="Permalink to this headline"></a></h3>
</section>
<section id="fit-the-model-to-the-data-using-musrfit">
<h3>Fit the model to the data using <code class="docutils literal notranslate"><span class="pre">musrfit</span></code><a class="headerlink" href="#fit-the-model-to-the-data-using-musrfit" title="Link to this heading"></a></h3>
<p>Now that the basics of the msr file have been introduced and the necessary adjustments have been done one
can proceed with fitting the specified model to the data. This is done by selecting the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> icon
in <code class="docutils literal notranslate"><span class="pre">musredit</span></code> or calling from a terminal</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ musrfit 3110_tutorial.msr
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>musrfit<span class="w"> </span>3110_tutorial.msr
</pre></div>
</div>
<p>After the fitting procedure has finished the msr file is updated and contains the newly determined values
of the fit parameters.</p>
</div>
<div class="section" id="view-the-data-and-the-fit-using-musrview">
<h3>View the data and the fit using <code class="docutils literal notranslate"><span class="pre">musrview</span></code><a class="headerlink" href="#view-the-data-and-the-fit-using-musrview" title="Permalink to this headline"></a></h3>
</section>
<section id="view-the-data-and-the-fit-using-musrview">
<h3>View the data and the fit using <code class="docutils literal notranslate"><span class="pre">musrview</span></code><a class="headerlink" href="#view-the-data-and-the-fit-using-musrview" title="Link to this heading"></a></h3>
<p>The data and the corresponding fit can be visualized by choosing the <code class="docutils literal notranslate"><span class="pre">musrview</span></code> icon in <code class="docutils literal notranslate"><span class="pre">musredit</span></code> or
calling from a terminal</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ musrview 3110_tutorial.msr
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>musrview<span class="w"> </span>3110_tutorial.msr
</pre></div>
</div>
<p>This creates the windows according to the given PLOT blocks in the msr file:</p>
<img alt="_images/tutorial-musrview-1.png" src="_images/tutorial-musrview-1.png" />
<p>The basic features of <code class="docutils literal notranslate"><span class="pre">musrview</span></code> can be found in the <code class="docutils literal notranslate"><span class="pre">Musrfit</span> <span class="pre">menu</span></code>. They include:</p>
<ul class="simple">
<li>export the shown data and the model to an ASCII file with comma-separated values</li>
<li>presenting the difference between the shown data and the model (keyboard shortcut: <strong>d</strong>)</li>
<li>calculate and show the Fourier transform of the shown data (keyboard shortcut: <strong>f</strong>), <em>e.g.</em> for
the asymmetry of the “Up” and “Down” detectors:</li>
<li><p>export the shown data and the model to an ASCII file with comma-separated values</p></li>
<li><p>presenting the difference between the shown data and the model (keyboard shortcut: <strong>d</strong>)</p></li>
<li><p>calculate and show the Fourier transform of the shown data (keyboard shortcut: <strong>f</strong>), <em>e.g.</em> for
the asymmetry of the “Up” and “Down” detectors:</p></li>
</ul>
<img alt="_images/tutorial-musrview-FT.png" src="_images/tutorial-musrview-FT.png" />
</div>
<div class="section" id="process-multiple-msr-files-using-msr2data">
<h3>Process multiple msr files using <code class="docutils literal notranslate"><span class="pre">msr2data</span></code><a class="headerlink" href="#process-multiple-msr-files-using-msr2data" title="Permalink to this headline"></a></h3>
</section>
<section id="process-multiple-msr-files-using-msr2data">
<h3>Process multiple msr files using <code class="docutils literal notranslate"><span class="pre">msr2data</span></code><a class="headerlink" href="#process-multiple-msr-files-using-msr2data" title="Link to this heading"></a></h3>
<p>This short introduction is concluded by calling attention to the program <a class="reference internal" href="msr2data.html#msr2data"><span class="std std-ref">msr2data</span></a>.
As the name indicates the main purpose of this program is to extract the <code class="docutils literal notranslate"><span class="pre">FITPARAMETER</span></code> block
information from multiple msr files with the same structure and to summarize them in a single
@ -487,89 +409,52 @@ and finally summarize the FITPARAMETER block information of all processed files
file <code class="docutils literal notranslate"><span class="pre">tutorial-T-dependence.dat</span></code> (simple columns). If further information on the temperature or the
applied field is available in the data files these will be included as well in the resulting ASCII file.
From the terminal this would be done as follows:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">3110</span> <span class="m">3114</span> _tutorial fit-3110 -o tutorial-T-dependence.dat data
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>msr2data<span class="w"> </span><span class="m">3110</span><span class="w"> </span><span class="m">3114</span><span class="w"> </span>_tutorial<span class="w"> </span>fit-3110<span class="w"> </span>-o<span class="w"> </span>tutorial-T-dependence.dat<span class="w"> </span>data
</pre></div>
</div>
<p>To achieve the same in <code class="docutils literal notranslate"><span class="pre">musredit</span></code> (in this snapshot in the <em>dark theme</em>) one selects the <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> icon and fills the form accordingly:</p>
<img alt="_images/tutorial-musredit-msr2data.png" src="_images/tutorial-musredit-msr2data.png" />
</div>
<div class="section" id="further-reading">
<h3>Further reading<a class="headerlink" href="#further-reading" title="Permalink to this headline"></a></h3>
</section>
<section id="further-reading">
<h3>Further reading<a class="headerlink" href="#further-reading" title="Link to this heading"></a></h3>
<p>This page only summarizes the very basic features and options of the programs contained in the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> suite.
For a complete description please refer to the manuals of <a class="reference internal" href="user-manual.html#musrfit"><span class="std std-ref">musrfit</span></a> (including <a class="reference internal" href="user-manual.html#musrview"><span class="std std-ref">musrview</span></a>,
<a class="reference internal" href="user-manual.html#musrt0"><span class="std std-ref">musrt0</span></a>, and <a class="reference internal" href="user-manual.html#musrft"><span class="std std-ref">musrFT</span></a>), <a class="reference internal" href="mupp.html#mupp"><span class="std std-ref">mupp</span></a>, <a class="reference internal" href="musredit.html#musredit-sec"><span class="std std-ref">musredit</span></a>, and <a class="reference internal" href="msr2data.html#msr2data"><span class="std std-ref">msr2data</span></a>.</p>
</div>
</div>
<div class="section" id="asymmtery-fit-tutorial">
<h2>Asymmtery-fit tutorial<a class="headerlink" href="#asymmtery-fit-tutorial" title="Permalink to this headline"></a></h2>
</section>
</section>
<section id="asymmtery-fit-tutorial">
<h2>Asymmtery-fit tutorial<a class="headerlink" href="#asymmtery-fit-tutorial" title="Link to this heading"></a></h2>
<p>to be written yet.</p>
</div>
</div>
</section>
</section>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="user-manual.html" class="btn btn-neutral float-right" title="User manual" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="cite.html" class="btn btn-neutral" title="How to Cite musrfit?" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="cite.html" class="btn btn-neutral float-left" title="How to Cite musrfit?" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="user-manual.html" class="btn btn-neutral float-right" title="User manual" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Jun 24, 2024.
</p>
<p>&#169; Copyright 2025, Andreas Suter.
<span class="lastupdated">Last updated on Jun 07, 2025.
</span></p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});