musrfit/doc/html/msr2data.html

568 lines
49 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.9.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="any2many - a Universal μSR-file-format converter" href="any2many.html" />
<link rel="prev" title="mupp - μSR Parameter Plotter" href="mupp.html" />
<script src="_static/js/modernizr.min.js"></script>
</head>
<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">
<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="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">
<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"><a class="reference internal" href="tutorial.html">Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="user-manual.html">User manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="user-libs.html">Documentation of user libs (user functions)</a></li>
<li class="toctree-l1"><a class="reference internal" href="setup-standard.html">Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> on Different Platforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="setup-dks.html">Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> / <code class="docutils literal notranslate"><span class="pre">DKS</span></code>: High Speed Fitting with GPUs</a></li>
<li class="toctree-l1"><a class="reference internal" href="musredit.html"><code class="docutils literal notranslate"><span class="pre">musredit</span></code>: the GUI Based Interface to <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#basic-types-of-usage">Basic Types of Usage</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#run-list-file-structure">Run List File Structure</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#optional-parameters">Optional Parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="#the-global-mode">The Global Mode</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#file-generation">File Generation</a></li>
<li class="toctree-l3"><a class="reference internal" href="#parameter-extraction">Parameter Extraction</a></li>
<li class="toctree-l3"><a class="reference internal" href="#the-extended-global-mode">The Extended Global Mode</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#known-limitations">Known Limitations</a></li>
<li class="toctree-l2"><a class="reference internal" href="#the-graphical-user-interface-for-msr2data-provided-by-musredit">The Graphical User Interface for msr2data Provided by musredit</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<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">
<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">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/msr2data.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="msr2data-a-program-for-automatically-processing-multiple-musrfit-msr-files">
<span id="msr2data"></span><span id="index-0"></span><h1>msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files<a class="headerlink" href="#msr2data-a-program-for-automatically-processing-multiple-musrfit-msr-files" title="Permalink to this headline"></a></h1>
<p><code class="docutils literal notranslate"><span class="pre">msr2data</span></code> (originally written by B. M. Wojek) is a program implemented in <code class="docutils literal notranslate"><span class="pre">C++</span></code>. Its purpose is
to process multiple msr files (input files for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>) with the same parameters and summarize the fitting
results either in a <em>TRIUMF DB</em> <a class="footnote-reference" href="#f1" id="id1">[1]</a> or a <em>column ASCII</em> file. This allows essentially to</p>
<ol class="arabic simple">
<li>Collect the fit parameters.</li>
<li>Generate <em>new</em> input msr files based on old ones.</li>
</ol>
<table class="docutils footnote" frame="void" id="f1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>For an abridged description of this format see <a class="reference external" href="http://musr.org/xyfit/dbformat.html">here</a>. The DB files
produced by <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> can be viewed for instance with <a class="reference internal" href="mupp.html#mupp"><span class="std std-ref">mupp</span></a> or μView <a class="reference external" href="http://musr.org/muview/">see here</a>, however,
they are not completely backward-compatible to the original <code class="docutils literal notranslate"><span class="pre">db</span> <span class="pre">language</span></code> since the parameter names can be longer than five or
six characters! In order to establish this backward compatibility (if needed) the user has to ensure the correct length of the
parameter names in the msr files!</td></tr>
</tbody>
</table>
<div class="section" id="basic-types-of-usage">
<span id="msr2data-basic-usage"></span><h2>Basic Types of Usage<a class="headerlink" href="#basic-types-of-usage" title="Permalink to this headline"></a></h2>
<p>Apart from numerous <a class="reference internal" href="#msr2data-opt-param"><span class="std std-ref">optional parameters</span></a> that might be set, in principle there are four different ways of calling <code class="docutils literal notranslate"><span class="pre">msr2data</span></code>.
These differ in how the list of runs which should be processed is supplied:</p>
<dl class="docutils">
<dt><strong>msr2data &lt;run&gt; &lt;extension&gt; [optional parameters]</strong></dt>
<dd>A single run number.</dd>
<dt><strong>msr2data &lt;firstRunNo&gt; &lt;lastRunNo&gt; &lt;extension&gt; [optional parameters]</strong></dt>
<dd>An interval of run numbers is specified through the first and the last run number. The condition <code class="docutils literal notranslate"><span class="pre">&lt;firstRunNo&gt;</span></code> &lt; <code class="docutils literal notranslate"><span class="pre">&lt;lastRunNo&gt;</span></code> is not necessary.</dd>
<dt><strong>msr2data [ &lt;runList&gt; ] &lt;extension&gt; [optional parameters]</strong></dt>
<dd><p class="first">Where <code class="docutils literal notranslate"><span class="pre">&lt;runList&gt;</span></code> is one or a combination of the following:</p>
<ol class="last arabic simple">
<li><code class="docutils literal notranslate"><span class="pre">&lt;run0&gt;,</span> <span class="pre">&lt;run1&gt;,</span> <span class="pre">&lt;run2&gt;,</span> <span class="pre">...</span> <span class="pre">&lt;runN&gt;</span></code> : run numbers, <em>e.g.</em> 123 124,</li>
<li><code class="docutils literal notranslate"><span class="pre">&lt;run0&gt;-&lt;runN&gt;</span></code> : a range, <em>e.g.</em> 123-125 -&gt; 123 124 125,</li>
<li><code class="docutils literal notranslate"><span class="pre">&lt;run0&gt;:&lt;runN&gt;:&lt;step&gt;</span></code> : a sequence, <em>e.g.</em> 123:127:2 -&gt; 123 125 127. <code class="docutils literal notranslate"><span class="pre">&lt;step&gt;</span></code> has to be a positive integer.</li>
<li>A <code class="docutils literal notranslate"><span class="pre">&lt;runList&gt;</span></code> can also combine (1)-(3), <em>e.g.</em> 123 128-130 133, etc.</li>
</ol>
</dd>
<dt><strong>msr2data &lt;runListFileName&gt; &lt;extension&gt; [optional parameters]</strong></dt>
<dd>An ASCII file containing a list of run numbers and optional external parameters is passed to <code class="docutils literal notranslate"><span class="pre">msr2data</span></code>. For the structure of the ASCII file
see <a class="reference internal" href="#run-list-file-structure"><span class="std std-ref">below</span></a>.</dd>
</dl>
<p>All four basic types of calling <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> contain the <em>mandatory</em> file-name <code class="docutils literal notranslate"><span class="pre">&lt;extension&gt;</span></code> passed right after the list of runs. The meaning of
this <code class="docutils literal notranslate"><span class="pre">&lt;extension&gt;</span></code> should become clear after giving examples for all four cases:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8472</span> _tf_h13
</pre></div>
</div>
<p>generates the DB file <code class="docutils literal notranslate"><span class="pre">out.db</span></code> (can be changed by using the -o option) from <code class="docutils literal notranslate"><span class="pre">8472_tf_h13.msr</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8472</span> <span class="m">8474</span> _tf_h13
</pre></div>
</div>
<p>generates the DB file <code class="docutils literal notranslate"><span class="pre">out.db</span></code> (can be changed by using the -o option) from <code class="docutils literal notranslate"><span class="pre">8472_tf_h13.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8473_tf_h13.msr</span></code>, and <code class="docutils literal notranslate"><span class="pre">8474_tf_h13.msr</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="o">[</span><span class="m">8472</span> <span class="m">8470</span><span class="o">]</span> _tf_h13
</pre></div>
</div>
<p>generates the DB file <code class="docutils literal notranslate"><span class="pre">out.db</span></code> (can be changed by using the -o option) from <code class="docutils literal notranslate"><span class="pre">8472_tf_h13.msr</span></code> and <code class="docutils literal notranslate"><span class="pre">8470_tf_h13.msr</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="o">[</span><span class="m">8470</span>:8474:2<span class="o">]</span> _tf_h13
</pre></div>
</div>
<p>generates the DB file <code class="docutils literal notranslate"><span class="pre">out.db</span></code> (can be changed by using the -o option) from <code class="docutils literal notranslate"><span class="pre">8470_tf_h13.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8472_tf_h13.msr</span></code>, and <code class="docutils literal notranslate"><span class="pre">8474_tf_h13.msr</span></code>.</p>
<div class="section" id="run-list-file-structure">
<span id="id2"></span><h3>Run List File Structure<a class="headerlink" href="#run-list-file-structure" title="Permalink to this headline"></a></h3>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data run.list _tf_h13
</pre></div>
</div>
<p>generates the DB file <code class="docutils literal notranslate"><span class="pre">out.db</span></code> (can be changed by using the -o option) from all runs listed in the ASCII file <code class="docutils literal notranslate"><span class="pre">run.list</span></code> in the working directory.
In this file it is also possible to include <em>external</em> parameters which should be put in the resulting DB file. The structure of the <code class="docutils literal notranslate"><span class="pre">run.list</span></code> is the following:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>RUN VAR1 VAR2 VAR3 ...
8460 200 27.1 46.2 ...
8472 205 27.1 46.3 ...
8453 210 27.2 45.9 ...
· · · ·
· · · ·
· · · ·
</pre></div>
</div>
<p><em>The first not commented and not empty line determines the parameter names and labels and has to be present!</em></p>
<p>It is allowed to add comments (with a preceding #) or empty lines to the run-list file.</p>
<p>The following should be mentioned together with the above examples:</p>
<ul>
<li><p class="first">The output files in the examples above are only newly created if they did <em>not</em> exist before invoking <code class="docutils literal notranslate"><span class="pre">msr2data</span></code>.
If the files were already present the msr file data would be appended!</p>
</li>
<li><p class="first">If the files have been newly created, also the DB file header is written. If the files were present before, only
the data blocks are appended. The output of the header can either be forced or completely suppressed with the <code class="docutils literal notranslate"><span class="pre">header</span></code>
and <code class="docutils literal notranslate"><span class="pre">noheader</span></code> options as shall be seen later.</p>
</li>
<li><p class="first">If the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> output files do not have an <code class="docutils literal notranslate"><span class="pre">&lt;extension&gt;</span></code> as specified above like <code class="docutils literal notranslate"><span class="pre">8472.msr</span></code> one has to call <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> like in the following example:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8472</span> <span class="m">8460</span> <span class="s2">&quot;&quot;</span>
</pre></div>
</div>
</li>
</ul>
</div>
</div>
<div class="section" id="optional-parameters">
<span id="msr2data-opt-param"></span><h2>Optional Parameters<a class="headerlink" href="#optional-parameters" title="Permalink to this headline"></a></h2>
<p>As mentioned already above there are some optional parameters which change the behavior of <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> and can be passed in any order. Here is a complete list:</p>
<dl class="docutils">
<dt><strong>data</strong></dt>
<dd>The output file format is changed to a simple column ASCII file (default output file name: out.dat).</dd>
<dt><strong>new</strong></dt>
<dd>An existing output file is deleted before new information is written to it.</dd>
<dt><strong>header</strong></dt>
<dd>Force the output of the file header even if the output file was present before.</dd>
<dt><strong>noheader</strong></dt>
<dd>The output of the file header is suppressed—also if the output file is newly created.
If either both or none of the header options are given, <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> writes the file header only to new files
and it solely appends the data blocks to an existing output file assuming that the header is present already.</dd>
<dt><strong>nosummary</strong></dt>
<dd>There will be no attempt to read additional information like the temperature or the applied magnetic field from
the data files even if these information were present there.</dd>
<dt><strong>paramList &lt;param&gt;</strong></dt>
<dd>option used to select the parameters which shall be exported. <code class="docutils literal notranslate"><span class="pre">&lt;param&gt;</span></code> is a list of parameter numbers to be exported.
Allowed lists are: <code class="docutils literal notranslate"><span class="pre">&lt;startNo&gt;-&lt;endNo&gt;</span></code>, <em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">1-16</span></code> will export parameters 1 to 16. Space separated numbers, <em>e.g.:</em> <code class="docutils literal notranslate"><span class="pre">1</span> <span class="pre">3</span> <span class="pre">5</span></code>.
A combination of both is possible, <em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">1-16</span> <span class="pre">19</span> <span class="pre">31</span> <span class="pre">62</span></code>, and so on.</dd>
<dt><strong>-o&lt;outputFileName&gt;, -o &lt;outputFileName&gt;</strong></dt>
<dd>The processed data will be written to the file <code class="docutils literal notranslate"><span class="pre">&lt;outputFileName&gt;</span></code> instead of the default <code class="docutils literal notranslate"><span class="pre">out.db</span></code> or <code class="docutils literal notranslate"><span class="pre">out.dat</span></code>.
If <code class="docutils literal notranslate"><span class="pre">&lt;outputFileName&gt;</span></code> is equal to none (case-insensitive) the parameter data are not appended to any output file.</dd>
<dt><strong>fit</strong></dt>
<dd>Additionally to the final data collection <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> will invoke <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> to fit the specified runs.
All msr files are assumed to be present, none is newly generated!</dd>
<dt><strong>fit-&lt;template&gt;[!]</strong></dt>
<dd>Additionally to the final data collection <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> will generate msr files for the runs specified in the list
of runs and invoke <a class="reference internal" href="user-manual.html#musrfit"><span class="std std-ref">musrfit</span></a> for performing fits of the data. As template for the first run the file
<code class="docutils literal notranslate"><span class="pre">&lt;template&gt;&lt;extension&gt;.msr</span></code> (or if not available: <code class="docutils literal notranslate"><span class="pre">&lt;template&gt;&lt;extension&gt;.mlog</span></code>) is used; the subsequent input
files will be created using the msr output of the last processed runs (“chain fit”). However, if for all runs only
the given template should be used one has to append an exclamation mark (<strong>!</strong>) to the <code class="docutils literal notranslate"><span class="pre">&lt;template&gt;</span></code>.</dd>
<dt><strong>msr-&lt;template&gt;</strong></dt>
<dd>The same as <code class="docutils literal notranslate"><span class="pre">fit-&lt;template&gt;[!]</span></code>, <em>without</em> calling <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> and the final data collection, <em>i.e.</em> only the msr files for the given runs are generated.</dd>
<dt><strong>-k</strong></dt>
<dd>If specified together with the <code class="docutils literal notranslate"><span class="pre">fit-&lt;template&gt;</span></code> option, the <a class="reference internal" href="user-manual.html#musrfit"><span class="std std-ref">- -keep-mn2-output</span></a> option is passed to <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>.
In the case no fits should be done, this option is ignored.</dd>
<dt><strong>-t</strong></dt>
<dd>In case this option is given additionally to the <code class="docutils literal notranslate"><span class="pre">fit-&lt;template&gt;</span> <span class="pre">option</span></code>, <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is called with
the <a class="reference internal" href="user-manual.html#musrfit"><span class="std std-ref">- -title-from-data-file</span></a> option. If no fitting is done, this option is ignored.</dd>
</dl>
<p><strong>Examples:</strong></p>
<p>In order to illustrate the usage of these parameters a few examples with explanations are given below:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8400</span> <span class="m">8460</span> _tf_h13 -oABC.db fit-8472
</pre></div>
</div>
<p>Using <code class="docutils literal notranslate"><span class="pre">8472_tf_h13.msr</span></code> as first template, <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> generates subsequent msr input files <code class="docutils literal notranslate"><span class="pre">8400_tf_h13.msr</span></code> through <code class="docutils literal notranslate"><span class="pre">8460_tf_h13.msr</span></code>,
calls <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> to perform a fit of these files and collects the results of the fits together with the DB header in the new file <code class="docutils literal notranslate"><span class="pre">ABC.db</span></code>.
Additionally, some information about external parameters like the temperature will be passed to <code class="docutils literal notranslate"><span class="pre">ABC.db</span></code> if it is present in the data files.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="o">[</span><span class="m">8500</span> <span class="m">8502</span>-8504 <span class="m">8507</span><span class="o">]</span> _zf fit-8472 noheader nosummary -o DEF.db
</pre></div>
</div>
<p>Using <code class="docutils literal notranslate"><span class="pre">8472_zf.msr</span></code> as first template, <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> generates subsequent msr input files <code class="docutils literal notranslate"><span class="pre">8500_zf.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8502_zf.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8503_zf.msr</span></code>,
<code class="docutils literal notranslate"><span class="pre">8504_zf.msr</span></code>, and <code class="docutils literal notranslate"><span class="pre">8507_zf.msr</span></code>, calls <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> to perform a fit of these files and collects the results of the fits in the file <code class="docutils literal notranslate"><span class="pre">DEF.db</span></code>
<em>without</em> writing the DB file header or attempting to read additional information from the data files.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8595</span> <span class="m">8585</span> <span class="s2">&quot;&quot;</span> noheader fit-8472! -oGHI.dat data nosummary -k
</pre></div>
</div>
<p>Using <code class="docutils literal notranslate"><span class="pre">8472.msr</span></code> as template for all runs, <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> generates the msr input files <code class="docutils literal notranslate"><span class="pre">8595.msr</span></code> through <code class="docutils literal notranslate"><span class="pre">8585.msr</span></code>, calls <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> with
the option <code class="docutils literal notranslate"><span class="pre">--keep-mn2-ouput</span></code> to perform a fit of these files and collects the results of the fits in the column-structured ASCII file <code class="docutils literal notranslate"><span class="pre">GHI.dat</span></code>
<em>without</em> writing any file header or attempting to read additional information from the data files.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8472</span> <span class="m">8475</span> <span class="s2">&quot;&quot;</span> fit -o none
</pre></div>
</div>
<p>Take the <em>given</em> msr files <code class="docutils literal notranslate"><span class="pre">8472.msr</span></code> through <code class="docutils literal notranslate"><span class="pre">8475.msr</span></code> and call <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> <em>without</em> finally summarizing the results.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8472</span> <span class="m">8475</span> _tf_h13 msr-8471!
</pre></div>
</div>
<p>Using <code class="docutils literal notranslate"><span class="pre">8471_tf_h13.msr</span></code> as template for all runs, <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> generates the msr input files <code class="docutils literal notranslate"><span class="pre">8472_tf_h13.msr</span></code> through <code class="docutils literal notranslate"><span class="pre">8475_tf_h13.msr</span></code>.
<em>No fitting will be performed and no DB or ASCII output will be generated!</em></p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="o">[</span><span class="m">8472</span> <span class="m">8475</span>-8479<span class="o">]</span> _tf_h13 paramList <span class="m">1</span>-16 data -o bestData.dat
</pre></div>
</div>
<p>Will collect the parameters 1 to 16 from the msr-files <code class="docutils literal notranslate"><span class="pre">8472_tf_h13.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8475_tf_h13.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8476_tf_h13.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8477_tf_h13.msr</span></code>, <code class="docutils literal notranslate"><span class="pre">8478_tf_h13.msr</span></code>,
and <code class="docutils literal notranslate"><span class="pre">8479_tf_h13.msr</span></code> and write these parameters into a column like output file <code class="docutils literal notranslate"><span class="pre">bestData.dat</span></code>.</p>
</div>
<div class="section" id="the-global-mode">
<span id="index-1"></span><h2>The Global Mode<a class="headerlink" href="#the-global-mode" title="Permalink to this headline"></a></h2>
<p>Apart from all the options described <a class="reference internal" href="#msr2data-opt-param"><span class="std std-ref">above</span></a> there is another program option: <strong>global</strong>.
This option changes the general behavior of <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> in that way that instead of processing one msr file for each
run it combines all specified runs in <em>one single msr file</em> with the possibility to define common parameters for all
runs as well as run-specific parameters. When writing the obtained parameters to a DB file or a column-structured
ASCII file that single msr file is read and the parameters valid for each run are extracted. The global option can be
used in conjunction with any of the described invocations of <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> and together with all options stated <a class="reference internal" href="#msr2data-opt-param"><span class="std std-ref">above</span></a>.</p>
<div class="section" id="file-generation">
<h3>File Generation<a class="headerlink" href="#file-generation" title="Permalink to this headline"></a></h3>
<p>The general idea of this mode is to generate a global msr file on the basis of a working single-run msr file. For this
purpose a single-run template containing information about common and run-specific parameters should be created. These
parameters are identified through their parameter names:</p>
<dl class="docutils">
<dt><strong>run-specific parameters</strong></dt>
<dd>these parameters are tagged with the current run number in the format <code class="docutils literal notranslate"><span class="pre">%0Xu</span></code>, <em>i.e.</em> <code class="docutils literal notranslate"><span class="pre">X</span></code> digits with leading zeros,
at the end of the parameter name, <em>e.g.</em> for a 4-digit-formatted run number <code class="docutils literal notranslate"><span class="pre">alpha0123</span></code> if the run number was 123 or
for a 8-digit-formatted run number <code class="docutils literal notranslate"><span class="pre">alpha00123456</span></code> if the run number was 123456. <code class="docutils literal notranslate"><span class="pre">X</span></code> has to be at least 4.</dd>
<dt><strong>common parameters</strong></dt>
<dd>all parameters that are not run specific</dd>
</dl>
<p>The <a class="reference internal" href="user-manual.html#msr-fitparameter-block"><span class="std std-ref">FITPARAMETER block</span></a> of an exemplary template file <code class="docutils literal notranslate"><span class="pre">8472_example.msr</span></code> could therefore look like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">FITPARAMETER</span>
<span class="c1"># No Name Value Step Pos_Error Boundaries</span>
<span class="mi">1</span> <span class="n">Phase</span> <span class="mf">35.8359</span> <span class="o">-</span><span class="mf">3.94496</span> <span class="mf">3.93749</span>
<span class="mi">2</span> <span class="n">Asy8472</span> <span class="mf">0.04501</span> <span class="o">-</span><span class="mf">0.00208</span> <span class="mf">0.00211</span> <span class="mi">0</span> <span class="mf">0.33</span>
<span class="mi">3</span> <span class="n">Field</span> <span class="mf">143.212</span> <span class="o">-</span><span class="mf">0.27960</span> <span class="mf">0.27885</span> <span class="mi">100</span> <span class="mi">200</span>
<span class="mi">4</span> <span class="n">Rate8472</span> <span class="mf">0.14245</span> <span class="o">-</span><span class="mf">0.02501</span> <span class="mf">0.02279</span> <span class="mi">0</span> <span class="mi">1</span>
</pre></div>
</div>
<p>Here the parameters <strong>2</strong> and <strong>4</strong> would be treated as <em>run-specific</em> whereas the parameters <strong>1</strong> and <strong>3</strong> would be <em>common</em> to the original and all newly added runs.</p>
<p>Normally, within the template file there should <em>not</em> appear explicitly any run-specific parameters in the <a class="reference internal" href="user-manual.html#msr-theory-block"><span class="std std-ref">THEORY</span></a> and
<a class="reference internal" href="user-manual.html#msr-functions-block"><span class="std std-ref">FUNCTIONS</span></a> blocks. If however, those parameters are met, <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> will try to substitute them by mapped parameters
and add them accordingly to the map contained in each <a class="reference internal" href="user-manual.html#msr-run-block"><span class="std std-ref">RUN block</span></a>.</p>
<p>When <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> is called to generate a global msr file, <em>e.g.</em></p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8471</span> <span class="m">8470</span> _example msr-8472 global
</pre></div>
</div>
<p>a new msr file <code class="docutils literal notranslate"><span class="pre">8471+global_example.msr</span></code> is created. As can be seen in the example, the name of the global msr file always starts with the
first specified run number followed by the <code class="docutils literal notranslate"><span class="pre">+global</span></code> identifier and the template <code class="docutils literal notranslate"><span class="pre">&lt;extension&gt;</span></code>. The examples global FITPARAMETER block would be:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">FITPARAMETER</span>
<span class="c1"># No Name Value Step Pos_Error Boundaries</span>
<span class="c1"># Common parameters for all runs</span>
<span class="mi">1</span> <span class="n">Phase</span> <span class="mf">35.8359</span> <span class="o">-</span><span class="mf">3.94496</span> <span class="mf">3.93749</span>
<span class="mi">2</span> <span class="n">Field</span> <span class="mf">143.212</span> <span class="o">-</span><span class="mf">0.27960</span> <span class="mf">0.27885</span> <span class="mi">100</span> <span class="mi">200</span>
<span class="c1"># Specific parameters for run 8471</span>
<span class="mi">3</span> <span class="n">Asy8471</span> <span class="mf">0.04501</span> <span class="o">-</span><span class="mf">0.00208</span> <span class="mf">0.00211</span> <span class="mi">0</span> <span class="mf">0.33</span>
<span class="mi">4</span> <span class="n">Rate8471</span> <span class="mf">0.14245</span> <span class="o">-</span><span class="mf">0.02501</span> <span class="mf">0.02279</span> <span class="mi">0</span> <span class="mi">1</span>
<span class="c1"># Specific parameters for run 8470</span>
<span class="mi">5</span> <span class="n">Asy8470</span> <span class="mf">0.04501</span> <span class="o">-</span><span class="mf">0.00208</span> <span class="mf">0.00211</span> <span class="mi">0</span> <span class="mf">0.33</span>
<span class="mi">6</span> <span class="n">Rate8470</span> <span class="mf">0.14245</span> <span class="o">-</span><span class="mf">0.02501</span> <span class="mf">0.02279</span> <span class="mi">0</span> <span class="mi">1</span>
</pre></div>
</div>
<p>This shows that the fit parameters are reorganized in a way that the common parameters appear at the beginning of the parameter list and they are
followed by copies of the parameters specific to each run (in the specified order!). Additionally, for each specified run new RUN blocks are
created — for each run as many as found for the template run.</p>
<p>During this reorganization all the affected parameter occurrences are changed accordingly!</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Please be aware of the fact that comments in the template msr file are <em>not</em> propagated to the newly generated global msr file!</p>
</div>
</div>
<div class="section" id="parameter-extraction">
<span id="index-2"></span><h3>Parameter Extraction<a class="headerlink" href="#parameter-extraction" title="Permalink to this headline"></a></h3>
<p>After fitting some model to the specified data the fit parameters can be extracted from the global msr file to a DB or column-structured ASCII file;
as usual this includes also parameters stored in the run data files or externally specified parameters given in a <a class="reference internal" href="#run-list-file-structure"><span class="std std-ref">run-list file</span></a>.
In order to reach this goal the global msr file has to obey certain rules:</p>
<ul class="simple">
<li>The order of the parameters has to match the one described above, meaning the common parameters are listed first followed by
the same number of parameters specific to each run tagged by the according run numbers at the end of the parameter names and
having the same order as the specified list of runs.</li>
<li>The RUN blocks have to be ordered according to the list of runs to be processed.</li>
</ul>
<p>Following these rules which is achieved most easily by generating the global msr file using <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> as shown above the parameters can be extracted <em>e.g.</em> like</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8471</span> <span class="m">8470</span> _example global data -o globalFit.dat
</pre></div>
</div>
<p>This will read in the file <code class="docutils literal notranslate"><span class="pre">8471+global_example.msr</span></code>, extract for each run all relevant parameters from the msr file as well as
from the according data files (if available) and append all of them in columns to the ASCII file <code class="docutils literal notranslate"><span class="pre">globalFit.dat</span></code>.</p>
</div>
<div class="section" id="the-extended-global-mode">
<span id="index-3"></span><h3>The Extended Global Mode<a class="headerlink" href="#the-extended-global-mode" title="Permalink to this headline"></a></h3>
<p>If a new global input file is generated, it is also possible to do an automatic pre-analysis for each single run using the specified template first;
afterwards the run-specific parameters of these single-run msr files are collected into the global msr file. In special cases this might be useful
to obtain a better set of starting values for the parameters, however, in most cases it will not replace the “manual review” of the generated global
input file. The option is activated by choosing the keyword <strong>global+</strong>. For example</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8471</span> <span class="m">8470</span> _example global+ msr-8472
</pre></div>
</div>
<p>Here, <code class="docutils literal notranslate"><span class="pre">8472_example.msr</span></code> is first used as template to generate the file <code class="docutils literal notranslate"><span class="pre">8471-OneRunFit_example.msr</span></code>, then <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is called for it, the result
is used to generate <code class="docutils literal notranslate"><span class="pre">8470-OneRunFit_example.msr</span></code> and <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is called for that file. Finally, the global fit file <code class="docutils literal notranslate"><span class="pre">8471+global_example.msr</span></code> is
produced — including the fit results of the <code class="docutils literal notranslate"><span class="pre">OneRunFit</span></code> files for the run-specific parameters.</p>
<p>By appending an exclamation mark <strong>!</strong> to the <strong>global+</strong> option, the given template will be used for every new file generation (similar to the fit option
explained before). The <strong>+[!]</strong> extension will be ignored, if no new global input file is generated.
The single run msr files are <em>not</em> deleted at the moment. The information contained in them might be useful for some people. Of course the data can also
be collected by <code class="docutils literal notranslate"><span class="pre">msr2data</span></code>. <em>E.g.</em> in order to produce a DB file <code class="docutils literal notranslate"><span class="pre">OneRunFits.db</span></code> one could call</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ msr2data <span class="m">8471</span> <span class="m">8470</span> -OneRunFit_example -o OneRunFits.db
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Please be aware that the program in this mode <em>always</em> generates new single-run msr files and <em>always</em> calls <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> for them. In case there are
already single-run fits present, these cannot be used in conjunction with this option. The program on purpose behaves in this way in order to ensure
the file integrity and correct parameter order within these files.</p>
</div>
</div>
</div>
<div class="section" id="known-limitations">
<h2>Known Limitations<a class="headerlink" href="#known-limitations" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>The indexing run number of the msr file has to be at the begin of every filename.</li>
<li>Within the data file name the <code class="docutils literal notranslate"><span class="pre">RUN#</span></code> has the format <code class="docutils literal notranslate"><span class="pre">%0Xu</span></code>, <em>i.e.</em> <code class="docutils literal notranslate"><span class="pre">X</span></code> digits with leading zeros, and has to be the rightmost number given in this
format in the file name. <code class="docutils literal notranslate"><span class="pre">X</span></code> has to be at least 4. The highest treatable run number is <span class="math notranslate nohighlight">\(2^{32}-1 = 4294967295\)</span>.</li>
<li>In order to keep <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> working properly the msr files should only contain <em>one</em> STATISTIC block at the end of the file and <em>one</em> FITPARAMETER block
right after the TITLE — <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> itself allows to have more creative msr files…</li>
<li>The msr-file generation from a template takes only care of runs given on the <em>first</em> line of a <code class="docutils literal notranslate"><span class="pre">RUN</span> <span class="pre">block</span></code>. <a class="reference internal" href="user-manual.html#msr-addrun"><span class="std std-ref">ADDRUN</span></a> statements are simply
copied! Since this is most probably <em>not</em> what one likes to do, it is suggested <em>not</em> to use the <code class="docutils literal notranslate"><span class="pre">fit-&lt;template&gt;</span></code> and <code class="docutils literal notranslate"><span class="pre">msr-&lt;template&gt;</span></code> options if
ADDRUN statements were present in the template file.</li>
<li><code class="docutils literal notranslate"><span class="pre">msr2data</span></code> will write only up to two successive empty lines in newly generated msr files. In case more subsequent empty lines are encountered in a template file,
these are not copied! Actually, this measure is not a limitation but has been introduced to keep the msr files in a reasonable shape.</li>
</ul>
</div>
<div class="section" id="the-graphical-user-interface-for-msr2data-provided-by-musredit">
<h2>The Graphical User Interface for msr2data Provided by musredit<a class="headerlink" href="#the-graphical-user-interface-for-msr2data-provided-by-musredit" title="Permalink to this headline"></a></h2>
<p><a class="reference internal" href="musredit.html#musredit-sec"><span class="std std-ref">musredit</span></a>, designed especially for the manipulation of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr files and graphical front ends to <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>, offer an almost
self-explanatory graphical user interface to <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> depicted below:</p>
<img alt="_images/msr2data-GUI.svg" src="_images/msr2data-GUI.svg" /><ol class="arabic simple">
<li>and 2. Choose one of the ways to specify your list of runs as described under <a class="reference internal" href="#msr2data-basic-usage"><span class="std std-ref">basic usage</span></a>.</li>
</ol>
<ol class="arabic simple" start="3">
<li>Give the file extension here, <em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">_zf</span></code> for files like <code class="docutils literal notranslate"><span class="pre">8472_zf.msr</span></code>. If the files do not have an extension this
field stays empty. <code class="docutils literal notranslate"><span class="pre">musredit</span></code> takes care of passing the “” to <code class="docutils literal notranslate"><span class="pre">msr2data</span></code> as mentioned above.</li>
<li>Activates the <code class="docutils literal notranslate"><span class="pre">fit-&lt;template&gt;</span></code> option if <code class="docutils literal notranslate"><span class="pre">&lt;template&gt;</span></code> is entered. In case the option <code class="docutils literal notranslate"><span class="pre">Chain</span> <span class="pre">Fit</span></code> is <em>not</em> set the
given template will be used for the input-file generation for all runs to be fitted — otherwise the output of the first
fit serves as template for the second and so on. The template field stays empty if <em>no</em> fits should be performed!</li>
<li>Activates the <code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">&lt;outputFileName&gt;</span></code> option if <code class="docutils literal notranslate"><span class="pre">&lt;outputFileName&gt;</span></code> is entered. If nothing is entered the default output file <code class="docutils literal notranslate"><span class="pre">out.db</span></code> or <code class="docutils literal notranslate"><span class="pre">out.dat</span></code> is used.</li>
</ol>
<p>The options tags correspond essentially to the description in <a class="reference internal" href="#msr2data-opt-param"><span class="std std-ref">optional parameters</span></a>.</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="any2many.html" class="btn btn-neutral float-right" title="any2many - a Universal μSR-file-format converter" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="mupp.html" class="btn btn-neutral" title="mupp - μSR Parameter Plotter" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</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>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.1',
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">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>