.. include:: .. index:: msr2data .. _msr2data: msr2data - A Program for Automatically Processing Multiple ``musrfit`` msr Files ================================================================================ ``msr2data`` (originally written by B. M. Wojek) is a program implemented in ``C++``. Its purpose is to process multiple msr files (input files for ``musrfit``) with the same parameters and summarize the fitting results either in a *TRIUMF DB* [#f1]_ or a *column ASCII* file. This allows essentially to #. Collect the fit parameters. #. Generate *new* input msr files based on old ones. .. [#f1] For an abridged description of this format see `here `_. The DB files produced by ``msr2data`` can be viewed for instance with :ref:`mupp ` or |mgr|\View `see here `_, however, they are not completely 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! .. _msr2data-basic-usage: Basic Types of Usage -------------------- Apart from numerous :ref:`optional parameters ` that might be set, in principle there are four different ways of calling ``msr2data``. These differ in how the list of runs which should be processed is supplied: **msr2data [optional parameters]** A single run number. **msr2data [optional parameters]** An interval of run numbers is specified through the first and the last run number. The condition ```` < ```` is not necessary. **msr2data \[ \] [optional parameters]** Where ```` is one or a combination of the following: #. ``, , , ... `` : run numbers, *e.g.* 123 124, #. ``-`` : a range, *e.g.* 123-125 -> 123 124 125, #. ``::`` : a sequence, *e.g.* 123:127:2 -> 123 125 127. ```` has to be a positive integer. #. A ```` can also combine (1)-(3), *e.g.* 123 128-130 133, etc. **msr2data [optional parameters]** An ASCII file containing a list of run numbers and optional external parameters is passed to ``msr2data``. For the structure of the ASCII file see :ref:`below `. All four basic types of calling ``msr2data`` contain the *mandatory* file-name ```` passed right after the list of runs. The meaning of this ```` should become clear after giving examples for all four cases: .. code-block:: bash $ msr2data 8472 _tf_h13 generates the DB file ``out.db`` (can be changed by using the -o option) from ``8472_tf_h13.msr``. .. code-block:: bash $ msr2data 8472 8474 _tf_h13 generates the DB file ``out.db`` (can be changed by using the -o option) from ``8472_tf_h13.msr``, ``8473_tf_h13.msr``, and ``8474_tf_h13.msr``. .. code-block:: bash $ msr2data [8472 8470] _tf_h13 generates the DB file ``out.db`` (can be changed by using the -o option) from ``8472_tf_h13.msr`` and ``8470_tf_h13.msr``. .. code-block:: bash $ msr2data [8470:8474:2] _tf_h13 generates the DB file ``out.db`` (can be changed by using the -o option) from ``8470_tf_h13.msr``, ``8472_tf_h13.msr``, and ``8474_tf_h13.msr``. .. _run-list-file_structure: Run List File Structure +++++++++++++++++++++++ .. code-block:: bash $ msr2data run.list _tf_h13 generates the DB file ``out.db`` (can be changed by using the -o option) from all runs listed in the ASCII file ``run.list`` in the working directory. In this file it is also possible to include *external* parameters which should be put in the resulting DB file. The structure of the ``run.list`` is the following: :: RUN VAR1 VAR2 VAR3 ... 8460 200 27.1 46.2 ... 8472 205 27.1 46.3 ... 8453 210 27.2 45.9 ... · · · · · · · · · · · · *The first not commented and not empty line determines the parameter names and labels and has to be present!* It is allowed to add comments (with a preceding '#') or empty lines to the run-list file. The following should be mentioned together with the above examples: * The output files in the examples above are only newly created if they did *not* exist before invoking ``msr2data``. If the files were already present the msr file data would be appended! * 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 ``header`` and ``noheader`` options as shall be seen later. * If the ``musrfit`` output files do not have an ```` as specified above like ``8472.msr`` one has to call ``msr2data`` like in the following example: .. code-block:: bash $ msr2data 8472 8460 "" .. _msr2data-opt-param: Optional Parameters ------------------- As mentioned already above there are some optional parameters which change the behavior of ``msr2data`` and can be passed in any order. Here is a complete list: **data** The output file format is changed to a simple column ASCII file (default output file name: out.dat). **new** An existing output file is deleted before new information is written to it. **header** Force the output of the file header even if the output file was present before. **noheader** 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, ``msr2data`` 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. **nosummary** 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. **paramList ** option used to select the parameters which shall be exported. ```` is a list of parameter numbers to be exported. Allowed lists are: ``-``, *e.g.* ``1-16`` will export parameters 1 to 16. Space separated numbers, *e.g.:* ``1 3 5``. A combination of both is possible, *e.g.* ``1-16 19 31 62``, and so on. **-o, -o ** The processed data will be written to the file ```` instead of the default ``out.db`` or ``out.dat``. If ```` is equal to none (case-insensitive) the parameter data are not appended to any output file. **fit** Additionally to the final data collection ``msr2data`` will invoke ``musrfit`` to fit the specified runs. All msr files are assumed to be present, none is newly generated! **fit-