musrfit/doc/html/mupp.html

285 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</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="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.8.0 documentation" href="index.html" />
<link rel="next" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files" href="msr2data.html" />
<link rel="prev" title="musredit: the GUI Based Interface to musrfit" href="musredit.html" />
</head>
<body>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>mupp - μSR Parameter Plotter</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="musredit.html"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a>&#160;&#160;»
</p>
</div>
<div class="content">
<div class="section" id="mupp-mgrsr-parameter-plotter">
<span id="mupp"></span><span id="index-0"></span><h1>mupp - μSR Parameter Plotter<a class="headerlink" href="#mupp-mgrsr-parameter-plotter" title="Permalink to this headline"></a></h1>
<p><tt class="docutils literal"><span class="pre">mupp</span></tt> is a little helper program which allows to quickly plot a collection of msr-file parameters,
as for instance generated by <a class="reference internal" href="msr2data.html#msr2data"><em>msr2data</em></a>. It can handle <tt class="docutils literal"><span class="pre">db</span></tt>- and <tt class="docutils literal"><span class="pre">dat</span></tt>-files.
Also a collection of <tt class="docutils literal"><span class="pre">msr</span></tt>-files can be invoked. <tt class="docutils literal"><span class="pre">mupp</span></tt> is heavily inspired by μView (see
<a class="reference external" href="http://musr.org/muview/">here</a>).</p>
<p><tt class="docutils literal"><span class="pre">mupp</span></tt> can be operated from within as graphical user interface or via a command line scripting interface.
The <tt class="docutils literal"><span class="pre">mupp</span></tt> GUI can be invoked either directly from the command line or from within <a class="reference internal" href="musredit.html#musredit-sec"><em>musredit</em></a>.</p>
<p>Each collection bundles a number of runs, where a run is a single μSR measurement.
A run is analyzed by a number of parameters (defined in the msr-files), and complemented by
additional physical parameters as the temperature, magnetic field, implantation energy, etc.
Hence parameters can be seen as vectors and can be plot against each other.</p>
<div class="section" id="the-graphical-user-interface">
<span id="index-1"></span><h2>The Graphical User Interface<a class="headerlink" href="#the-graphical-user-interface" title="Permalink to this headline"></a></h2>
<p>A typical setting could look like this</p>
<img src="_images/mupp-gui-0.svg" /><ol class="arabic">
<li><p class="first">shows the list of loaded collections. A collection is defined as <tt class="docutils literal"><span class="pre">db</span></tt>- or <tt class="docutils literal"><span class="pre">dat</span></tt>-file (typically the
output from <a class="reference internal" href="msr2data.html#msr2data"><em>msr2data</em></a>). If you call the open-dialog and select a collection of
<tt class="docutils literal"><span class="pre">msr</span></tt>-files, <tt class="docutils literal"><span class="pre">mupp</span></tt> will call <tt class="docutils literal"><span class="pre">msr2data</span></tt> and tries to generate a collection on-the-fly.</p>
</li>
<li><p class="first">in this list, the data-tags of the currently selected collection is presented. The data-tags can be
directly dragged over to the <tt class="docutils literal"><span class="pre">x</span></tt>- and <tt class="docutils literal"><span class="pre">y</span></tt>-axis list. Another way is to select the data-tag
wished and click <tt class="docutils literal"><span class="pre">add</span> <span class="pre">X</span></tt> to add the selected data-tag to the <tt class="docutils literal"><span class="pre">x</span></tt>-axis list. Analogous it is done
for the <tt class="docutils literal"><span class="pre">y</span></tt>-axis.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">x</span></tt>-axis list. The labels are followed by <tt class="docutils literal"><span class="pre">(-X-)</span></tt> where the number <tt class="docutils literal"><span class="pre">X</span></tt> corresponds to the
selection it corresponds to. The numbering of the collection is as given in the collection list.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">y</span></tt>-axis list. The labels are followed by <tt class="docutils literal"><span class="pre">(-X-)</span></tt> where the number <tt class="docutils literal"><span class="pre">X</span></tt> corresponds to the
selection it corresponds to. The numbering of the collection is as given in the collection list.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">add</span> <span class="pre">X</span></tt> allows to add the currently selected data-tag to the <tt class="docutils literal"><span class="pre">x</span></tt>-axis list.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">add</span> <span class="pre">Y</span></tt> allows to add the currently selected data-tag to the <tt class="docutils literal"><span class="pre">y</span></tt>-axis list.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">remove</span> <span class="pre">X</span></tt> will remove the selected <tt class="docutils literal"><span class="pre">x</span></tt>-axis tag.</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">remove</span> <span class="pre">Y</span></tt> will remove the selected <tt class="docutils literal"><span class="pre">y</span></tt>-axis tag.</p>
</li>
<li><p class="first">Often one would like to compare trends of different settings. In the above example each collections
holds an energy scans for a given temperature. Each collection is measured at a different temperature.
Now, instead of adding <tt class="docutils literal"><span class="pre">x</span></tt>- and <tt class="docutils literal"><span class="pre">y</span></tt>-axis tags for each collection, you can do the following:
you add <tt class="docutils literal"><span class="pre">x</span></tt>- and <tt class="docutils literal"><span class="pre">y</span></tt>-axis data-tags for the first collection. Afterwards you select all the other
collections of interest and click on <tt class="docutils literal"><span class="pre">Add</span> <span class="pre">Ditto</span></tt>. <tt class="docutils literal"><span class="pre">mupp</span></tt> will then add the corresponding
<tt class="docutils literal"><span class="pre">x</span></tt>- and <tt class="docutils literal"><span class="pre">y</span></tt>-axis data-tags accordingly. This is less error prone and quicker!</p>
</li>
<li><p class="first">Clicking the <tt class="docutils literal"><span class="pre">Plot</span></tt> button will invoke <tt class="docutils literal"><span class="pre">mupp_plot</span></tt> (a <tt class="docutils literal"><span class="pre">ROOT</span></tt> based application) which will
present the data, as shown here</p>
<a class="reference internal image-reference" href="_images/mupp-plot-0.svg"><img height="600px" src="_images/mupp-plot-0.svg" /></a>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">Remove</span> <span class="pre">Collection</span></tt>: will remove the selected collection</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">Refresh</span> <span class="pre">Collection</span></tt>: will reload the collection (<tt class="docutils literal"><span class="pre">db</span></tt>- or <tt class="docutils literal"><span class="pre">dat</span></tt>-file). This is often useful
during beamtime where the collection is growing run-by-run.</p>
</li>
<li><p class="first">Command history window.</p>
</li>
<li><p class="first">This is the script command line. Currently it allows to perform the tasks without mouse gambling.
In the future much more commands are planed. See the <tt class="docutils literal"><span class="pre">Help</span> <span class="pre">/</span> <span class="pre">Cmd's</span></tt> for the currently available
commands.</p>
</li>
</ol>
<div class="section" id="define-variable-dialog">
<h3>Define Variable Dialog<a class="headerlink" href="#define-variable-dialog" title="Permalink to this headline"></a></h3>
<img src="_images/mupp-add-var.svg" /><ol class="arabic simple">
<li>Variable text edit window.</li>
<li>Collection link window.</li>
<li>Shows the parameters of the selected collection.</li>
<li>Check if the variable/error variable from the edit window is valid.</li>
<li>Add the variable to the selected collection(s) if the parsing is successful.</li>
</ol>
<p>A variable defined here is a mathematical expression defined by parameters of loaded collections.
Since a parameter also has an associated error, also newly defined variables <strong>always</strong> need
to be defined together with a corresponding error variable. If the name of a variable is defined
as <tt class="docutils literal"><span class="pre">SigmaSC_10</span></tt> (see the above snapshot), the error variable need to be named as <tt class="docutils literal"><span class="pre">SigmaSC_10Err</span></tt>.</p>
<p>Currently the following mathematical functions are defined: <tt class="docutils literal"><span class="pre">max</span></tt>, <tt class="docutils literal"><span class="pre">min</span></tt>, <tt class="docutils literal"><span class="pre">abs</span></tt>, <tt class="docutils literal"><span class="pre">sin</span></tt>, <tt class="docutils literal"><span class="pre">cos</span></tt>,
<tt class="docutils literal"><span class="pre">tan</span></tt>, <tt class="docutils literal"><span class="pre">exp</span></tt>, <tt class="docutils literal"><span class="pre">log</span></tt>, <tt class="docutils literal"><span class="pre">ln</span></tt>, <tt class="docutils literal"><span class="pre">pow</span></tt>.</p>
</div>
</div>
<div class="section" id="the-scripting-interface">
<span id="index-2"></span><h2>The Scripting Interface<a class="headerlink" href="#the-scripting-interface" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">mupp</span></tt> can also be operated in a scripting like manner. The use cases are plot updates during run time,
or web-based interaction which requests figures. A script is invoked by the command line option <tt class="docutils literal"><span class="pre">-s</span></tt> (see
<a class="reference internal" href="#mupp-usage"><em>mupp command line summary</em></a>. Currently the following scripting commands are available:</p>
<dl class="docutils">
<dt><strong>loadPath &lt;dir&gt;</strong></dt>
<dd>set the load path to <tt class="docutils literal"><span class="pre">&lt;dir&gt;</span></tt>. Bash variables like $HOME are accepted. This is the path where to look for collection files (<tt class="docutils literal"><span class="pre">db</span></tt>- and <tt class="docutils literal"><span class="pre">dat</span></tt>-files).</dd>
<dt><strong>load &lt;coll&gt;</strong></dt>
<dd>will load the collection <tt class="docutils literal"><span class="pre">&lt;coll&gt;</span></tt>.</dd>
<dt><strong>selectAll</strong></dt>
<dd>will select all loaded collections. This means every plot of variable x/y will be carried out to <em>ALL</em> collections.</dd>
<dt><strong>select &lt;nn&gt;</strong></dt>
<dd>selects collection <tt class="docutils literal"><span class="pre">&lt;nn&gt;</span></tt>, where <tt class="docutils literal"><span class="pre">&lt;nn&gt;</span></tt> is either the <em>number</em> of the collections, or its <em>name</em>, <em>e.g.</em>
select YBCO-40nm-T5K-FC150mT-Escan.db.</dd>
<dt><strong>x &lt;label&gt;</strong></dt>
<dd>add <tt class="docutils literal"><span class="pre">&lt;label&gt;</span></tt> as a <em>x</em>-variable. Only <em>one</em> is allowed.</dd>
<dt><strong>y &lt;label(s)&gt;</strong></dt>
<dd>add <tt class="docutils literal"><span class="pre">&lt;label(s)&gt;</span></tt> as <em>y</em>-variable. <em>Multiple</em> labels are possible.</dd>
<dt><strong>norm</strong></dt>
<dd>this will normalize all the <em>y</em>-variables by their maximum.</dd>
<dt><strong>savePath &lt;dir&gt;</strong></dt>
<dd>set the save path to <tt class="docutils literal"><span class="pre">&lt;dir&gt;</span></tt>. The place where the macros, and/or the plot output will be saved.</dd>
<dt><strong>plot &lt;fln&gt;</strong></dt>
<dd>where <tt class="docutils literal"><span class="pre">&lt;fln&gt;</span></tt> is the file name with extension under which the plot should be saved.</dd>
<dt><strong>macro &lt;fln&gt;</strong></dt>
<dd>where <tt class="docutils literal"><span class="pre">&lt;fln&gt;</span></tt> is the file name under which the root macro should be saved.</dd>
<dt><strong>var &lt;var_name&gt; = &lt;expr&gt;</strong></dt>
<dd><p class="first">defines a variable.
&lt;expr&gt; is a mathematical expression where collection variables are addressed
via the &#8216;$&#8217;, e.g. <tt class="docutils literal"><span class="pre">dataT</span></tt> is addressed by <tt class="docutils literal"><span class="pre">$dataT</span></tt>, etc. An example:</p>
<p><tt class="docutils literal"><span class="pre">var</span> <span class="pre">invT</span> <span class="pre">=</span> <span class="pre">1000.0</span> <span class="pre">/</span> <span class="pre">$dataT</span></tt></p>
<p>Each variable has to be accompanied by its error variable. An error variable
is defined by the <tt class="docutils literal"><span class="pre">&lt;var_name&gt;</span></tt> followed by <tt class="docutils literal"><span class="pre">Err</span></tt>
For the above example the error variable is</p>
<p class="last"><tt class="docutils literal"><span class="pre">var</span> <span class="pre">invTErr</span> <span class="pre">=</span> <span class="pre">$invT</span> <span class="pre">*</span> <span class="pre">$dataTErr</span> <span class="pre">/</span> <span class="pre">$dataT</span></tt></p>
</dd>
<dt><strong>col &lt;nn&gt; : &lt;var_name&gt;</strong></dt>
<dd>links &lt;var_name&gt; to the collection &lt;nn&gt;, where &lt;nn&gt; is the number of the
collection as defined by the order of load, starting with 0.</dd>
</dl>
<p>An example script file <tt class="docutils literal"><span class="pre">sigmaSC-vs-temp.txt</span></tt> might look like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span># This is a comment
# Script: sigmaSC-vs-temp.txt
loadPath ./
load YBCO-40nm-FC-E3p8keV-B10mT-Tscan.db # collection 0
load YBCO-40nm-FC-E3p8keV-B150mT-Tscan.db # collection 1
# define variables: for each variable an associated error variable is needed.
# B=10mT
var SigmaSC_10 = pow(abs(pow($Sigma,2.0)-pow(0.11,2.0)), 0.5) # 0.11 (1/us) is the nuclear contribution (T&gt;Tc)
var SigmaSC_10Err = pow(pow($Sigma*$SigmaErr,2.0)+pow(0.11*0.0025,2.0), 0.5)/$SigmaSC_10
# B=150mT
var SigmaSC_150 = pow(abs(pow($Sigma,2.0)-pow(0.075,2.0)), 0.5) # 0.075 (1/us) is the nuclear contribution (T&gt;Tc)
var SigmaSC_150Err = pow(pow($Sigma*$SigmaErr,2.0)+pow(0.075*0.0025,2.0), 0.5)/$SigmaSC_150
# link variables to collections
col 0 : SigmaSC_10 # error variable SigmaSC_10Err doesn&#39;t need to be given, it is automatically linked to SigmaSC_10
col 1 : SigmaSC_150
norm # normalize the plot to the maximum of each y-data-set
# the next 3 cmds means the following: use collection 0, add dataT to the x-axis,
# and SigmaSC_10 to the y-axis
select 0
x dataT
y SigmaSC_10
select 1
x dataT
y SigmaSC_150
# where to save the output
savePath ./
# create a pdf output file of the above defined xy-data sets. Currently also
# other file formats are supported, like png, jpg, etc.
plot SigmaSCVsTemp.pdf
# creates a ROOT macro which can be used for further refinement
macro SigmaSCVsTemp.C
# end
</pre></div>
</div>
</div>
<div class="section" id="the-usage-summary">
<span id="mupp-usage"></span><span id="index-3"></span><h2>The Usage Summary<a class="headerlink" href="#the-usage-summary" title="Permalink to this headline"></a></h2>
<div class="highlight-python"><div class="highlight"><pre><span></span>usage: mupp [OPTIONS] [[--path &lt;fit-param-path&gt;] &lt;fit-param-file-names&gt;]
OPTIONS:
-h, --help: this help
-v, --version: current mupp version
-s &lt;fln&gt;, --script &lt;fln&gt;: &lt;fln&gt; being a mupp script.
--path &lt;fit-param-path&gt;: path where to look for the &lt;fit-param-file-names&gt;
&lt;fit-param-file-names&gt;: list of file name(s) to be loaded.
allowed formats are: db, dat, msr
SCRIPT COMMANDS:
Lines starting with &#39;#&#39;, &#39;%&#39;, or &#39;//&#39; are comments and will be ignored.
The same is true for empty lines. Comments are also allowed at the end
for a command, i.e. loadPath ./ # the best place ever.
load &lt;coll&gt; : load a collection. &lt;coll&gt; is the filename of the
collection (*.db, *.dat)
loadPath &lt;path&gt; : set the load path to &lt;path&gt;; accepting bash variables
like $HOME, etc.
x &lt;var-name&gt; : set a x-axis variable. &lt;var-name&gt; is a data tag of
the db/dat-file.
y &lt;var-name&gt; : set a y-axis variable. &lt;var-name&gt; is a data tag of
the db/dat-file.
select &lt;nn&gt; : select collection &lt;nn&gt;, where &lt;nn&gt; is the row-number
or the name of the collection to be selected.
selectAll : i.e. already set &#39;x&#39;, &#39;y&#39; will apply to ALL collections
present.
savePath &lt;path&gt; : sets the save path to &lt;path&gt;; accepting bash variables
like $HOME, etc.
plot &lt;fln&gt; : where &lt;fln&gt; is the file name with extension under which
the plot should be saved.
macro &lt;fln&gt; : where &lt;fln&gt; is the file name under which the root macro
should be saved.
var &lt;var_name&gt; = &lt;expr&gt; : defines a variable.
&lt;expr&gt; is a mathematical expression where
collection variables are addressed via the &#39;$&#39;,
e.g. dataT is addressed by $dataT, etc.
col &lt;nn&gt; : &lt;var_name&gt; : links &lt;var_name&gt; to the collection &lt;nn&gt;, where
&lt;nn&gt; is the number of the collection as defined
by the order of load, starting with 0.
</pre></div>
</div>
</div>
</div>
</div>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="musredit.html"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a>&#160;&#160;»
</p>
</div>
<div class="footer">
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>
</html>