musrfit/doc/html/user/MUSR/Msr2Data.html
2012-05-31 11:00:24 +00:00

399 lines
37 KiB
HTML
Raw Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en_US">
<!-- Mirrored from intranet.psi.ch/MUSR/Msr2Data?cover=print by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 31 May 2012 10:51:43 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><!-- /Added by HTTrack -->
<head>
<link rel="stylesheet" href="../pub/System/HeadlinesPlugin/style.css" type="text/css" media="all" />
<title> MUSR :: Msr2Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="robots" content="noindex" /> <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="WebRsshtml.html" />
<meta name="scripturl" content="https://intranet.psi.ch/wiki/bin" />
<meta name="scriptsuffix" content="" />
<meta name="WEBTOPIC" content="Msr2Data" />
<meta name="WEB" content="MUSR" />
<meta name="SCRIPTURLPATH" content="/wiki/bin" />
<meta name="SCRIPTSUFFIX" content="" />
<meta name="TEXT_JUMP" content="Jump" />
<meta name="TEXT_SEARCH" content="Search" />
<meta name="TEXT_NUM_TOPICS" content="Number of topics:" />
<meta name="TEXT_MODIFY_SEARCH" content="Modify search" />
<link rel="icon" href="../pub/Main/WebPreferences/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="../pub/Main/WebPreferences/favicon.ico" type="image/x-icon" />
<link rel="alternate" href="https://intranet.psi.ch/wiki/bin/edit/MUSR/Msr2Data?t=1338461464" type="application/x-wiki" title="edit Msr2Data" />
<meta name="description" content="Msr2Data" />
<base /><!--[if IE]></base><![endif]-->
<style type="text/css" media="all">
@import url('../pub/System/SkinTemplates/base.css');
</style>
<style type="text/css" media="all">
@import url('../pub/System/PatternSkinTheme2009/layout.css');
@import url('../pub/System/PatternSkinTheme2009/style.css');
@import url('../pub/System/PatternSkinTheme2009/colors.css');
</style>
<style type="text/css" media="all">
@import url('../pub/System/PatternSkinTheme2009/column_left.css');
@import url('../pub/System/PatternSkinTheme2009/variant_twiki.css');
</style><style type="text/css" media="all">
/* Styles that are set using variables */
.patternBookView .foswikiTopRow,
.patternWebIndicator a img,
.patternWebIndicator a:hover img {
background-color:#D0D0D0;
}
#patternTopBarContents { background-image:url(../pub/System/PatternSkin/header5.gif); background-repeat:repeat-x;}
#patternTopBarContents { background-color:#ffffff;}
.patternBookView {
border-color:#D0D0D0;
}
.patternPreviewPage #patternMain {
/* uncomment to set the preview image */
/*background-image:url("/pub/System/PreviewBackground/preview2bg.gif");*/
}
</style>
<style type="text/css" media="all">
@import url("../pub/System/PsiSkin/psicolors.css");
@import url("../pub/System/PsiSkin/psistyle.css");
.foswikiTopic {overflow: hidden;}
</style>
<style type="text/css" media="all">
@import url("../pub/System/PatternSkin/print.css");
</style>
<!--[if IE]><style type="text/css" media="screen">
pre {
height:1%;
overflow-x:auto;
}
.foswikiAttachments,
.foswikiForm,
.foswikiHelp,
.foswikiPreviewArea,
.patternPreviewPage .foswikiForm,
.patternSigLine,
.patternToolBar,
.patternTop,
.patternTopicAction,
#patternSideBarContents .patternLeftBarPersonal,
#patternSideBarContents h2,
#patternSideBarContents li,
#patternTopBarButtons ul {
height:1%;
}
#patternSideBarContents .patternLeftBarPersonal {
width:100%;
}
.foswikiFormStep {
height:100%;
}
#foswikiLogin,
.patternShadow {
border:10px solid #fff;
margin-top:10px;
margin-bottom:10px;
border:2px solid #ccc;
}
</style><![endif]-->
<!--[if gt IE 8 ]><style type="text/css" media="screen">
#foswikiLogin,
.patternShadow {
border:10px solid #fff;
margin-top:10px;
margin-bottom:10px;
box-shadow: 0 0 10px #ccc;
}
</style><![endif]-->
<link rel="stylesheet" href="../pub/System/FootNotePlugin/styles.css" type="text/css" media="all" /><!--FOOTNOTEPLUGIN_LINKCSS-->
</head>
<body class="foswikiNoJs patternViewPage patternPrintPage">
<a name="PageTop"></a><div class="foswikiPage"><div id="patternScreen">
<div id="patternPageShadow">
<div id="patternPage">
<div id="patternOuter">
<div id="patternFloatWrap">
<div id="patternMain">
<div id="patternMainContents">
<p></p>
<p></p>
<div class="patternContent"><div class="foswikiTopic">
<h1><a name="A_61_61msr2data_61_61"></a> <code><b>msr2data</b></code> </h1>
<p></p>
<a name="foswikiTOC"></a><div class="foswikiToc"> <ul>
<li> <a href="Msr2Data.html#A_61_61msr2data_61_61"> msr2data </a>
</li> <li> <a href="Msr2Data.html#A_1_Introduction"> 1 Introduction </a>
</li> <li> <a href="Msr2Data.html#A_2_Basic_Types_of_Usage"> 2 Basic Types of Usage </a>
</li> <li> <a href="Msr2Data.html#A_3_Optional_Parameters"> 3 Optional Parameters </a>
</li> <li> <a href="Msr2Data.html#A_4_The_Global_Mode"> 4 The Global Mode </a> <ul>
<li> <a href="Msr2Data.html#A_4.1_File_Generation"> 4.1 File Generation </a>
</li> <li> <a href="Msr2Data.html#A_4.2_Parameter_Extraction"> 4.2 Parameter Extraction </a>
</li> <li> <a href="Msr2Data.html#A_4.3_The_Extended_Global_Mode"> 4.3 The Extended Global Mode </a>
</li></ul>
</li> <li> <a href="Msr2Data.html#A_5_Known_Limitations"> 5 Known Limitations </a>
</li> <li> <a href="Msr2Data.html#A_6_The_Graphical_User_Interface_Provided_by_61_61musrgui_61_61_47_61_61musredit_61_61"> 6 The Graphical User Interface Provided by musrgui / musredit </a>
</li> <li> <a href="Msr2Data.html#A_7_Bugtracking"> 7 Bugtracking </a>
</li></ul>
</div>
<p></p>
<a name="IntroDuction"></a>
<h1><a name="A_1_Introduction"></a> 1 Introduction </h1>
<code>msr2data</code> (originally written by B. M. Wojek) is a program implemented in <code>C++</code>. Its purpose is to process multiple <code><a href="MusrFit.html">musrfit</a></code> msr files with the same parameters and summarize the fitting results either in a TRIUMF <strong>DB</strong> <a name="FootNote1text"></a><span class="FootNoteTextLink" title=" For an abridged description of this format see <a href="http://musr.org/xyfit/dbformat.html" target="_top">here</a>. The <strong>DB</strong> files produced by <code>msr2data</code> can be viewed for instance with <a href="http://musr.org/muview/" target="_top">&mu;View</a>, however, they are <em>not completely</em> backward-compatible to the original "db language" 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!"><a href="#FootNote1note" class="foswikiCurrentTopicLink">(1)</a></span> or a <strong>column ASCII</strong> file. It evolved from a script called <code>mlog2db</code> which has been written only for collecting fit results of <a href="http://lmu.web.psi.ch/lem/" target="_top">LEM</a> data stored in mlog files generated by <code>musrfit</code> and putting them together in a file with the <strong>DB</strong> format for further analysis. Therefore, any peculiarities, e.g. in supplying options to <code>msr2data</code> are owed its original purpose.
<code>msr2data</code> is <a href="http://www.gnu.org/philosophy/free-sw.html" target="_top">free software</a> and licensed under the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" target="_top">GNU GPL version 2</a> or any later version (at your option).
<p></p>
Before the usage of msr2data will be explained in greater detail first be aware of the following:
<p></p>
<strong><span class='foswikiRedFG'>If using msr2data always bear in mind <a href="#KnownLimitations" class="foswikiCurrentTopicLink">its limitations</a>!</span></strong>
<p></p>
<p></p>
<p></p>
Notes
<p></p>
<a name="FootNote1note"></a><span class="FootNoteLabel"><a href="Msr2Data.html#FootNote1text" class="foswikiCurrentWebHomeLink"> <strong>1</strong> </a></span>: <span class="FootNote"> For an abridged description of this format see <a href="http://musr.org/xyfit/dbformat.html" target="_top">here</a>. The <strong>DB</strong> files produced by <code>msr2data</code> can be viewed for instance with <a href="http://musr.org/muview/" target="_top">&mu;View</a>, however, they are <em>not completely</em> backward-compatible to the original "db language" 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!</span>
<p></p>
<p></p>
<p></p>
<hr />
<p></p>
<a name="BasicTypesOfUsage"></a>
<h1><a name="A_2_Basic_Types_of_Usage"></a> 2 Basic Types of Usage </h1>
Apart from numerous <a href="#OptionalParameters" class="foswikiCurrentTopicLink">optional parameters</a> that might be set or not, in principle there are four different ways of calling <code>msr2data</code>. These differ in how the list of runs which should be processed is supplied: <dl>
<dt> msr2data &lt;run&gt; &lt;extension&gt; [optional parameters] </dt><dd> A single run number.
</dd> <dt> msr2data &lt;firstRunNo&gt; &lt;lastRunNo&gt; &lt;extension&gt; [optional parameters] </dt><dd> An interval of run numbers is specified through the first and the last run number. The condition <strong>&lt;firstRunNo&gt; &lt; &lt;lastRunNo&gt;</strong> is <em>not</em> necessary.
</dd> <dt> msr2data \[&lt;run1&gt; &lt;run2&gt; ... &lt;runN&gt; \] &lt;extension&gt; [optional parameters] </dt><dd> A space separated list of run numbers can be enclosed in <strong>[</strong> and <strong>]</strong>. Every run that should be processed has to be specified explicitly by its run number.
</dd> <dt> msr2data &lt;runListFileName&gt; &lt;extension&gt; [optional parameters] </dt><dd> An ASCII file containing a list of run numbers and optional external parameters is passed to <code>msr2data</code>. For the structure of the ASCII file see <a href="#RunListStructure" class="foswikiCurrentTopicLink">below</a>.
</dd></dl>
<p></p>
All four basic types of calling <code>msr2data</code> contain the <em>mandatory</em> file-name <strong>&lt;extension&gt;</strong> passed right after the list of runs. The meaning of this <strong>&lt;extension&gt;</strong> should become clear after giving examples for all four cases:
<pre class="bash">msr2data 8472 &#95;tf&#95;h13</pre> generates the <strong>DB</strong> file <code><b>out.db</b></code> (can be changed by using <a href="#OptionalParameters" class="foswikiCurrentTopicLink">the -o option</a>) from <code><b>8472_tf_h13.msr</b></code>.
<pre class="bash">msr2data 8472 8474 &#95;tf&#95;h13</pre> generates the <strong>DB</strong> file <code><b>out.db</b></code> (can be changed by using <a href="#OptionalParameters" class="foswikiCurrentTopicLink">the -o option</a>) from <code><b>8472_tf_h13.msr</b></code>, <code><b>8473_tf_h13.msr</b></code>, and <code><b>8474_tf_h13.msr</b></code>.
<pre class="bash">msr2data &#91;8472 8470] &#95;tf&#95;h13</pre> generates the <strong>DB</strong> file <code><b>out.db</b></code> (can be changed by using <a href="#OptionalParameters" class="foswikiCurrentTopicLink">the -o option</a>) from <code><b>8472_tf_h13.msr</b></code> and <code><b>8470_tf_h13.msr</b></code>.
<pre class="bash">msr2data run.list &#95;tf&#95;h13</pre> generates the <strong>DB</strong> file <code><b>out.db</b></code> (can be changed by using <a href="#OptionalParameters" class="foswikiCurrentTopicLink">the -o option</a>) from all runs listed in the ASCII file <code><b>run.list</b></code> in the working directory. In this file it is also possible to include external parameters which should be put in the resulting <strong>DB</strong> file. The structure of the <code><b>run.list</b></code> is the following:
<a name="RunListStructure"></a>
<pre>
RUN VAR1 VAR2 VAR3 ...
8460 200 27.1 46.2 ...
8472 205 27.1 46.3 ...
8453 210 27.2 45.9 ...
<EFBFBD> <20> <20> <20>
<EFBFBD> <20> <20> <20>
<EFBFBD> <20> <20> <20>
</pre>
<span class='foswikiRedFG'>The first not commented and not empty line determines the parameter names and labels and has to be present!</span><br/>
It is allowed to add comments (with a preceding <strong>#</strong>) or empty lines to the run-list file.
<p></p>
The following should be mentioned together with the above examples: <ul>
<li> The output files in the examples above are only newly created if they did not exist before invoking <strong>msr2data</strong>. If the files were already present the msr-file data would be appended!
</li> <li> If the files have been newly created, also the <strong>DB</strong> 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 <a href="#OptionalParameters" class="foswikiCurrentTopicLink">header and noheader options</a> as shall be seen later.
</li></ul>
<a name="NoExtension"></a> <ul>
<li> <span class='foswikiRedFG'>If the <code>musrfit</code> output files do not have an &lt;extension&gt; as specified above like <code><b>8472.msr</b></code> one has to call <code>msr2data</code> like in the following example:</span> <pre class="bash">
msr2data 8472 8460 &#34;&#34;
</pre>
</li></ul>
<p></p>
<a name="OptionalParameters"></a>
<h1><a name="A_3_Optional_Parameters"></a> 3 Optional Parameters </h1>
As mentioned already above there are some optional parameters which change the behavior of <code>msr2data</code> and can be passed in any order. Here is a complete list: <dl>
<dt> data </dt><dd> The output file format is changed to a simple column ASCII file (default output file name: <code><b>out.dat</b></code>).
</dd> <dt> new </dt><dd> An existing output file is deleted before new information is written to it.
</dd> <dt> header </dt><dd> Force the output of the file header&#151;even if the output file was present before.
</dd> <dt> noheader </dt><dd> The output of the file header is suppressed&#151;also if the output file is newly created.<br>If either both or none of the header options are given, <code>msr2data</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> nosummary </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> -o&lt;outputFileName&gt;, -o &lt;outputFileName&gt; </dt><dd> The processed data will be written to the file <strong>&lt;outputFileName&gt;</strong> instead of the default <code><b>out.db</b></code> or <code><b>out.dat</b></code>. If <strong>&lt;outputFileName&gt;</strong> is equal to <strong>none</strong> (case-insensitive) the parameter data are <em>not appended</em> to any output file.
</dd> <dt> fit </dt><dd> Additionally to the final data collection <code>msr2data</code> will invoke musrfit to fit the specified runs. All msr files are assumed to be present, none is newly generated!
</dd> <dt> fit-&lt;template&gt;[!] </dt><dd> Additionally to the final data collection <code>msr2data</code> will generate msr files for the runs specified in the list of runs and invoke <code>musrfit</code> for performing fits of the data. As template for the first run the file <code><b>&lt;template&gt;&lt;extension&gt;.msr</b></code> (or if not available: <code><b>&lt;template&gt;&lt;extension&gt;.mlog</b></code>) is used; the subsequent input files will be created using the msr output of the last processed runs ("chain fit"). However, if for <em>all</em> runs only the given template should be used one has to append an exclamation mark (<strong>!</strong>) to the <strong>&lt;template&gt;</strong>.
</dd> <dt> msr-&lt;template&gt; </dt><dd> The same as <strong>fit-&lt;template&gt;[!]</strong>, <em>without</em> calling <code>musrfit</code> and the final data collection, i.e. only the msr files for the given runs are generated.
</dd> <dt> -k </dt><dd> If specified together with the <strong>fit-&lt;template&gt;</strong> option, the <strong>--keep-mn2-output</strong> <a href="MusrFit.html#MusrFit">option</a> is passed to <code>musrfit</code>. In the case no fits should be done, this option is ignored.
</dd> <dt> -t </dt><dd> In case this option is given additionally to the <strong>fit-&lt;template&gt;</strong> option, <code>musrfit</code> is called with the <strong>--title-from-data-file</strong> <a href="MusrFit.html#MusrFit">option</a>. If no fitting is done, this option is ignored.
</dd></dl>
<p></p>
In order to illustrate the usage of these parameters a few examples with explanations are given below:
<pre class="bash">
msr2data 8400 8460 &#95;tf&#95;h13 -oABC.db fit-8472
</pre>
Using <code><b>8472_tf_h13.msr</b></code> as first template, <code>msr2data</code> generates subsequent msr input files <code><b>8400_tf_h13.msr</b></code> through <code><b>8460_tf_h13.msr</b></code>, calls <code>musrfit</code> to perform a fit of these files and collects the results of the fits together with the <strong>DB</strong> header in the new file <code><b>ABC.db</b></code>. Additionally, some information about external parameters like the temperature will be passed to <code><b>ABC.db</b></code> if it is present in the data files.
<pre class="bash">
msr2data &#91;8500 8505] &#95;zf fit-8472 noheader nosummary -o DEF.db
</pre>
Using <code><b>8472_zf.msr</b></code> as first template, <code>msr2data</code> generates subsequent msr input files <code><b>8500_zf.msr</b></code> and <code><b>8505_zf.msr</b></code>, calls <code>musrfit</code> to perform a fit of these files and collects the results of the fits in the file <code><b>DEF.db</b></code> without writing the <strong>DB</strong> file header or attempting to read additional information from the data files.
<pre class="bash">
msr2data 8595 8585 &#34;&#34; noheader fit-8472! -oGHI.dat data nosummary -k
</pre>
Using <code><b>8472.msr</b></code> as template for <em>all</em> runs, <code>msr2data</code> generates the msr input files <code><b>8595.msr</b></code> through <code><b>8585.msr</b></code>, calls <code>musrfit</code> with the option <strong>--keep-mn2-ouput</strong> to perform a fit of these files and collects the results of the fits in the column-structured ASCII file <code><b>GHI.dat</b></code> without writing any file header or attempting to read additional information from the data files.
<pre class="bash">
msr2data 8472 8475 &#34;&#34; fit -o none
</pre>
Take the <strong>given</strong> msr files <code><b>8472.msr</b></code> through <code><b>8475.msr</b></code> and call <code>musrfit</code> <em>without</em> finally summarizing the results.
<pre class="bash">
msr2data 8472 8475 &#95;tf&#95;h13 msr-8471!
</pre>
Using <code><b>8471_tf_h13.msr</b></code> as template for <em>all</em> runs, <code>msr2data</code> generates the msr input files <code><b>8472_tf_h13.msr</b></code> through <code><b>8475_tf_h13.msr</b></code>. <span class='foswikiRedFG'>No fitting will be performed and no DB or ASCII output will be generated!</span>
<p></p>
<a name="TheGlobalMode"></a>
<h1><a name="A_4_The_Global_Mode"></a> 4 The Global Mode </h1>
Apart from all the options described <a href="#OptionalParameters" class="foswikiCurrentTopicLink">above</a> there is another program option: <strong>global</strong>. This option changes the general behavior of <code>msr2data</code> in that way that instead of processing one msr file for each run it combines all specified runs in one single msr file 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 <strong>global</strong> option can be used in conjunction with any of the described <a href="#BasicTypesOfUsage" class="foswikiCurrentTopicLink">invocations</a> of <code>msr2data</code> and together with all options stated <a href="#OptionalParameters" class="foswikiCurrentTopicLink">above</a>.
<p></p>
<a name="GlobalFileGeneration"></a>
<h2><a name="A_4.1_File_Generation"></a> 4.1 File Generation </h2>
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: <dl>
<dt> run-specific parameters </dt><dd> these parameters are tagged with the current run number in the format <strong>%0Xu</strong>, i.e. <strong>X</strong> digits with leading zeros, at the end of the parameter name, e.g. for a 4-digit-formatted run number <strong>alpha0123</strong> if the run number was <strong>123</strong> or for a 8-digit-formatted run number <strong>alpha00123456</strong> if the run number was <strong>123456</strong>. <strong>X</strong> has to be at least 4.
</dd> <dt> common parameters </dt><dd> all parameters that are not run specific
</dd></dl>
The FITPARAMETER block of an exemplary template file <code><b>8472_example.msr</b></code> could therefore look like:<pre>
FITPARAMETER
# No Name Value Step Pos&#95;Error Boundaries
1 Phase 35.8359 -3.94496 3.93749
2 Asy8472 0.04501 -0.00208 0.00211 0 0.33
3 Field 143.212 -0.27960 0.27885 100 200
4 Rate8472 0.14245 -0.02501 0.02279 0 1
</pre>
Here the parameters <strong>2</strong> and <strong>4</strong> would be treated as run-specific whereas the parameters <strong>1</strong> and <strong>3</strong> would be common 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 THEORY and FUNCTIONS blocks. If however, those parameters are met, <code>msr2data</code> will try to substitute them by mapped parameters and add them accordingly to the map contained in each RUN block.
<p></p>
When <code>msr2data</code> is called to generate a global msr file, e.g.<pre class="bash">
msr2data 8471 8470 &#95;example msr-8472 global
</pre>
a new msr file <code><b>8471+global_example.msr</b></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 <strong>+global</strong> identifier and the template <strong>&lt;extension&gt;</strong>.
The example's global FITPARAMETER block would be:<pre>
FITPARAMETER
# No Name Value Step Pos&#95;Error Boundaries
# Common parameters for all runs
1 Phase 35.8359 -3.94496 3.93749
2 Field 143.212 -0.27960 0.27885 100 200
# Specific parameters for run 8471
3 Asy8471 0.04501 -0.00208 0.00211 0 0.33
4 Rate8471 0.14245 -0.02501 0.02279 0 1
# Specific parameters for run 8470
5 Asy8470 0.04501 -0.00208 0.00211 0 0.33
6 Rate8470 0.14245 -0.02501 0.02279 0 1
</pre>
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&mdash;for each run as many as found for the template run.<br>
During this reorganization all the affected parameter occurrences are changed accordingly!
<p></p>
<span class='foswikiRedFG'>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!</span>
<p></p>
<h2><a name="A_4.2_Parameter_Extraction"></a> 4.2 Parameter Extraction </h2>
After fitting some model to the specified data the fit parameters can be extracted from the global msr file to a <strong>DB</strong> or column-structured ASCII file&mdash;as usual this includes also parameters stored in the run data files or externally specified parameters given in a <a href="#RunListStructure" class="foswikiCurrentTopicLink">run-list file</a>.
In order to reach this goal the global msr file has to obey certain rules: <ul>
<li> The order of the parameters has to match the one described <a href="#GlobalFileGeneration" class="foswikiCurrentTopicLink">above</a>, 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>
Following these rules&mdash;which is achieved most easily by generating the global msr file using <code>msr2data</code> as shown <a href="#GlobalFileGeneration" class="foswikiCurrentTopicLink">above</a>&mdash;the parameters can be extracted e.g. like <pre class="bash">
msr2data 8471 8470 &#95;example global data -o globalFit.dat
</pre>
This will read in the file <code><b>8471+global_example.msr</b></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><b>globalFit.dat</b></code>.
<p></p>
<a name="GlobalPlus"></a>
<h2><a name="A_4.3_The_Extended_Global_Mode"></a> 4.3 The Extended Global Mode </h2>
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 in 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 <pre class="bash">
msr2data 8471 8470 &#95;example global+ msr-8472
</pre>
Here, <code><b>8472_example.msr</b></code> is first used as template to generate the file <code><b>8471-OneRunFit_example.msr</b></code>, then <code>musrfit</code> is called for it, the result is used to generate <code><b>8470-OneRunFit_example.msr</b></code> and <code>musrfit</code> is called for that file. Finally, the global fit file <code><b>8471+global_example.msr</b></code> is produced&mdash;including the fit results of the OneRunFit files for the run-specific parameters.<br>
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 <strong>fit</strong> option explained <a href="#OptionalParameters" class="foswikiCurrentTopicLink">before</a>). The <strong>+[!]</strong> extension will be ignored, if no new global input file is generated.<br>
The single run msr files are not 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>msr2data</code>. E.g. in order to produce a <strong>DB</strong> file <code><b>OneRunFits.db</b></code> one could call <pre class="bash">
msr2data 8471 8470 -OneRunFit&#95;example -o OneRunFits.db
</pre>
<p></p>
<span class='foswikiRedFG'>Please be aware that the program in this mode always generates new single-run msr files and always calls <code>musrfit</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.</span>
<p></p>
<a name="KnownLimitations"></a>
<h1><a name="A_5_Known_Limitations"></a> 5 Known Limitations </h1> <ul>
<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 <strong>RUN#</strong> has the format <strong>%0Xu</strong>, i.e. <strong>X</strong> digits with leading zeros, and has to be the rightmost number given in this format in the file name. <strong>X</strong> has to be at least 4. The highest treatable run number is 2<sup>32</sup>-1 = 4294967295.
</li> <li> In order to keep <code>msr2data</code> working properly the msr files should only contain <em><span class='foswikiRedFG'>one</span> STATISTIC block at the end of the file</em> and <i><span class='foswikiRedFG'>one</span> FITPARAMETER block right after the TITLE</i>&mdash;<code>musrfit</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 first line of a RUN block. <a href="MusrFit.html#AddRun">ADDRUN statements</a> are simply copied! Since this is most probably not what one likes to do, it is suggested not to use the <strong>fit-&lt;template&gt;</strong> and <strong>msr-&lt;template&gt;</strong> options if ADDRUN statements were present in the template file.
</li> <li> <code>msr2data</code> will write only up to <em>two successive</em> empty lines in newly generated msr files. In case more subsequent empty lines are encountered in a template file, these are <em>not</em> copied! Actually, this measure is not a limitation but has been introduced to keep the msr files in a reasonable shape.
</li></ul>
<p></p>
<a name="MusrGuiInterface"></a>
<h1><a name="A_6_The_Graphical_User_Interface_Provided_by_61_61musrgui_61_61_47_61_61musredit_61_61"></a> 6 The Graphical User Interface Provided by <code><b>musrgui</b></code> / <code><b>musredit</b></code> </h1>
<code><a href="MusrGui.html">musrgui/musredit</a></code>, editors designed especially for the manipulation of <code>musrfit</code> msr files and graphical front ends to <code><a href="MusrFit.html">musrfit</a></code>, offer an almost self-explanatory graphical user interface to <code>msr2data</code> depicted below:<br>
<img src="../pub/MUSR/Msr2Data/msr2data-input-tabs.png" alt="msr2data-input-tabs.png" width='612' height='605' align="right" /> <dl>
<dt> <span class='foswikiRedFG'>1&ndash;3</span> </dt><dd> Choose one of the <a href="#BasicTypesOfUsage" class="foswikiCurrentTopicLink">ways</a> to specify your list of runs.
</dd> <dt> <span class='foswikiRedFG'>4</span> </dt><dd> Give the file extension here, e.g. <strong>_zf</strong> for files like <code><b>8472_zf.msr</b></code>. If the files do not have an extension this field stays empty. <code>musrgui</code> / <code>musredit</code> take care of passing the <strong>""</strong> to <code>msr2data</code> as mentioned <a href="#NoExtension" class="foswikiCurrentTopicLink">above</a>.
</dd> <dt> <span class='foswikiRedFG'>5</span> </dt><dd> Activates the <strong>fit-&lt;template&gt;</strong> option if <strong>&lt;template&gt;</strong> is entered. In case the option "Chain Fit" is <em>not</em> set the given template will be used for the input-file generation for <em>all</em> runs to be fitted&mdash;otherwise the output of the first fit serves as template for the second and so on. The template field stays empty if no fits should be performed!
</dd> <dt> <span class='foswikiRedFG'>6</span> </dt><dd> Activates the <strong>-o&lt;outputFileName&gt;</strong> option if <strong>&lt;outputFileName&gt;</strong> is entered. If nothing is entered the default output file <code><b>out.db</b></code> or <code><b>out.dat</b></code> is used.
</dd> <dt> <span class='foswikiRedFG'>7</span> </dt><dd> If <em>not</em> set, the <strong>noheader</strong> option is passed to <code>msr2data</code>.
</dd> <dt> <span class='foswikiRedFG'>8</span> </dt><dd> If set, the <strong>nosummary</strong> option is passed to <code>msr2data</code>.
</dd> <dt> <span class='foswikiRedFG'>9</span> </dt><dd> If set, the <strong>-k</strong> option is passed to <code>msr2data</code>.
</dd> <dt> <span class='foswikiRedFG'>10</span> </dt><dd> If set, the <strong>data</strong> option is passed to <code>msr2data</code>.
</dd> <dt> <span class='foswikiRedFG'>11</span> </dt><dd> If set, the output file is deleted before <code>msr2data</code> is called. Otherwise the data is appended to the file if it existed before <code>msr2data</code> has been called.
</dd> <dt> <span class='foswikiRedFG'>12</span> </dt><dd> If set, after processing by <code>msr2data</code> all specified msr files are opened in tabs in <code>musrgui</code> / <code>musredit</code>.
</dd> <dt> <span class='foswikiRedFG'>13</span> </dt><dd> If set, the <strong>-t</strong> option is passed to <code>msr2data</code>.
</dd> <dt> <span class='foswikiRedFG'>14</span> </dt><dd> If set, <code>msr2data</code> is called with the option <strong>msr-&lt;template&gt;</strong> (instead of <strong>fit-&lt;template&gt;</strong>) and hence is only producing the msr input files without any fitting.
</dd> <dt> <span class='foswikiRedFG'>15</span> </dt><dd> If set, <code>msr2data</code> is called with the option <strong>fit</strong>, i.e. no template will be used to generate new msr input files; only existing files are fed to <code>musrfit</code>.
</dd> <dt> <span class='foswikiRedFG'>16</span> </dt><dd> If set, <code>msr2data</code> is operating in the <a href="#TheGlobalMode" class="foswikiCurrentTopicLink">global mode</a>.
</dd> <dt> <span class='foswikiRedFG'>17</span> </dt><dd> If set, <code>msr2data</code> is operating in the <a href="#GlobalPlus" class="foswikiCurrentTopicLink">extended global mode</a>.
</dd></dl>
<p></p>
<a name="BugTracking"></a>
<h1><a name="A_7_Bugtracking"></a> 7 Bugtracking </h1>
<p></p>
For reporting bugs or requesting new features and improvements please use the <a href="https://tracker.intranet.psi.ch/jira/browse/MUSR" target="_top">PSI Tracker</a> or send an e-mail to A. Suter.
<p></p>
-- <a href="http://www.fsf.org/register_form?referrer=8369" target="_top">BMW</a> &amp; <a href="http://lmu.web.psi.ch/lem/group.html" target="_top">AS</a></div><!-- /foswikiTopic-->
<p></p>
<div id="attachment_list" style="display:none"><div class="foswikiAttachments">
<table summary="Topic attachments" id="tableMsr2Data1" class="foswikiTable" rules="none" border="1"><caption>Topic attachments</caption>
<thead>
<tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<th class="foswikiTableCol0 foswikiFirstCol"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=0;table=1;up=0#sorted_table" title="Sort by this column">I</a> </th>
<th class="foswikiTableCol1"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=1;table=1;up=0#sorted_table" title="Sort by this column">Attachment</a> </th>
<th class="foswikiTableCol2"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=2;table=1;up=0#sorted_table" title="Sort by this column">Action</a> </th>
<th class="foswikiTableCol3"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=3;table=1;up=0#sorted_table" title="Sort by this column">Size</a> </th>
<th class="foswikiTableCol4"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=4;table=1;up=0#sorted_table" title="Sort by this column">Date</a> </th>
<th class="foswikiTableCol5"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=5;table=1;up=0#sorted_table" title="Sort by this column">Who</a> </th>
<th class="foswikiTableCol6"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=6;table=1;up=0#sorted_table" title="Sort by this column">Comment</a> </th>
<th class="foswikiTableCol7 foswikiLastCol"> <a rel="nofollow" href="https://intranet.psi.ch/MUSR/Msr2Data?cover=print;sortcol=7;table=1;up=0#sorted_table" title="Sort by this column">Attribute</a> </th>
</tr>
</thead>
<tbody>
<tr class="foswikiTableEven foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0">
<td class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <span class="foswikiIcon"><img src="../pub/System/DocumentGraphics/png.png" width="16" height="16" alt="msr2data-input-tabs.png" /></span><span class="foswikiHidden">png</span> </td>
<td class="foswikiTableCol1 foswikiLast"> <a href="../pub/MUSR/Msr2Data/msr2data-input-tabs.png">msr2data-input-tabs.png</a> </td>
<td class="foswikiTableCol2 foswikiLast"> <a href="https://intranet.psi.ch/wiki/bin/attach/MUSR/Msr2Data?filename=msr2data-input-tabs.png;revInfo=1" title="change, update, previous revisions, move, delete..." rel="nofollow">manage</a> </td>
<td align="right" class="foswikiTableCol3 foswikiLast"> 37.0&nbsp;K </td>
<td class="foswikiTableCol4 foswikiLast"> <span class="foswikiNoBreak">20 Jul 2011 - 12:13</span> </td>
<td class="foswikiTableCol5 foswikiLast"> <a href="https://intranet.psi.ch/Main/BastianWojek">BastianWojek</a> </td>
<td class="foswikiTableCol6 foswikiLast"> graphical interface to msr2data </td>
<td class="foswikiTableCol7 foswikiLastCol foswikiLast"> &nbsp; </td>
</tr>
</tbody></table>
</div></div>
<p></p>
</div><!-- /patternContent vom pattern template-->
<p></p>
</div>
</div>
</div>
<div class="clear">&nbsp;</div>
</div><div id="patternBottomBar"><div id="patternBottomBarContents"><div id="patternWebBottomBar">Ideas, requests, problems regarding <a href="https://intranet.psi.ch/Main/WebHome">PSI Wiki</a>? <a href="mailto&#58;psi&#46;intranet&#64;psi&#46;ch&#63;subject&#61;PSI&#32;Wiki&#37;20Feedback&#37;20on&#37;20MUSR&#46;Msr2Data">Send feedback</a></div></div></div>
</div>
</div>
</div>
</div></div><!-- /endWrap -->
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</body>
<!-- Mirrored from intranet.psi.ch/MUSR/Msr2Data?cover=print by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 31 May 2012 10:51:44 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><!-- /Added by HTTrack -->
</html>
<p></p>
<p></p>