updated docu

This commit is contained in:
2019-07-24 10:15:15 +02:00
parent cf03c49cf8
commit b68286761a
22 changed files with 170 additions and 238 deletions

View File

@ -67,7 +67,8 @@ Additionally, *only* if ``musrfit`` should support reading of data files in the
.. index:: minixml
**minixml**
A small ``XML`` library that can be used to read and write ``XML`` and ``XML``-like data files. *Required version ≥ 2.2* (see `minixml <http://www.minixml.org/>`_).
A small ``XML`` library that can be used to read and write ``XML`` and ``XML``-like data files. *Required version ≥ 2.2* (see `minixml <http://www.minixml.org/>`_).
Currently the ``MXML`` support in ``NeXus`` is broken and hence you will **not** need to install ``minixml`` for the time being.
.. index:: nexus
@ -172,23 +173,20 @@ Installation of NeXus requirements (optional)
*Only* if ``musrfit`` should support reading/writing data files in the ``NeXus`` format the further required
software has to be set up. The required libraries and header files could either be available through the user's
GNU/Linux distribution or if this is not the case, the packages can be installed from the source code. The necessary
packages to build ``NeXus`` are ``MXML``, (``HDF4``), and ``HDF5``. This means, for a rpm-package based distro try something like:
GNU/Linux distribution or if this is not the case, the packages can be installed from the source code. In principle
NeXus should support ``MXML``, ``HDF4``, and ``HDF5``. At the time of this writing, the ``MXML`` support in the
NeXus project is broken, and ``HDF4`` is outdated on most platforms, hence currently only the ``HDF5`` binding is
used. Hence, the necessary package to build ``NeXus`` is ``HDF5``. This means, for a rpm-package based distro try something like:
.. code-block:: bash
$ yum install mxml-devel hdf-devel hdf5-devel
$ yum install hdf5-devel
and on a deb-package based distro try something like:
.. code-block:: bash
$ apt-get install libmxml-dev libhdf4-dev libhdf5-dev
.. note::
``HDF4`` support within ``NeXus`` will be dropped by ``musrfit`` in the near future. If you *not* urgently need
to read old ``ISIS NeXus`` files, you safely can drop it.
$ apt-get install libhdf5-dev
**Only NeXus Version ≥ 4.4 is support!**
@ -208,10 +206,7 @@ A brief instruction how to get ``NeXus`` compiled from source (lines starting wi
$ # next we will build NeXus out-of-source
$ mkdir build
$ cd build
$ # The next line only if HDF4 support is needed
$ cmake -DENABLE_HDF5=1 -DENABLE_HDF4=1 -DENABLE_MXML=1 ../code
$ # The next line if HDF4 support is NOT needed
$ cmake -DENABLE_HDF5=1 -DENABLE_MXML=1 ../code
$ cmake -DENABLE_HDF5=1 -DENABLE_HDF4=0 -DENABLE_MXML=0 ../code
$ cmake --build ./ --clean-first
$ # make install needs either to be carried out as root or sudo depending on your linux flavour.
$ sudo make install
@ -550,11 +545,7 @@ to be set up. Under ``Cygwin`` of all the required libraries only ``HDF5`` is av
``libhdf5-devel`` can be installed through the ``Cygwin`` setup. One should also make sure that ``bison``, ``flex``
and a package containing ``/usr/lib/librpc.a`` (*e.g.* ``sunrpc = 4.0-3``, but *not* ``sunrpc = 4.0-4``) are installed.
All other libraries have to be built from the sources. The following lines will track the installation of ``JPEG 6b``,
``MXML 2.9``, ``HDF 4.2.7-patch1``, and ``NeXus 4.3.2``. The version numbers and source-code locations might of
course change with time but should be easily adjustable.
*Only* ``NeXus`` version ≥ 4.4 is support!
**Only NeXus Version ≥ 4.4 is support!**
.. code-block:: bash
@ -567,18 +558,6 @@ course change with time but should be easily adjustable.
$ make
$ make install
$ cd ..
$ curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G | tar xz
$ cd mxml-2.9
$ ./configure --prefix=/usr/local --enable-static
$ make
$ make install
$ cd ..
$ curl http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.7-patch1.tar.gz -G | tar xz
$ cd hdf-4.2.7-patch1
$ ./configure --prefix=/usr/local --enable-static --disable-fortran --with-jpeg=/usr/local
$ make
$ make install
$ cd ..
$ # create a directory for the NeXus source code
$ mkdir nexus
$ cd nexus
@ -587,7 +566,7 @@ course change with time but should be easily adjustable.
$ # next we will build NeXus out-of-source
$ mkdir build
$ cd build
$ cmake -DENABLE_HDF5=1 -DENABLE_HDF4=1 -DENABLE_MXML=1 ../code
$ cmake -DENABLE_HDF5=1 -DENABLE_HDF4=0 -DENABLE_MXML=0 ../code
$ make
$ make install
@ -876,21 +855,14 @@ Installation of NeXus requirements (optional)
.. code-block:: bash
$ sudo port -v install hdf4 hdf5
$ sudo port -v install hdf5
Unfortunately, the ``minixml`` and ``NeXus`` libraries have to be compiled and installed directly from the source code.
Given the respective version numbers of 2.9 and 4.4.2 (which are subject to change with time.
Only ``NeXus`` Version ≥ 4.4 is support!) this can be achieved for example by:
**Only NeXus Version ≥ 4.4 is support!**
To get things compiled do:
.. code-block:: bash
$ # get and instal Mini-XML
$ cd $HOME/Applications
$ git clone https://github.com/michaelrsweet/mxml.git
$ cd mxml
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ # get and install NeXus
$ cd $HOME/Applications
$ # get the source code from the master repository
@ -899,7 +871,7 @@ Only ``NeXus`` Version ≥ 4.4 is support!) this can be achieved for example by:
$ cd nexus
$ mkdir build
$ cd build
$ cmake -DENABLE_HDF5=1 -DENABLE_HDF4=1 -DENABLE_MXML=1 ../code
$ cmake -DENABLE_HDF5=1 -DENABLE_HDF4=0 -DENABLE_MXML=0 ../code
$ make
$ sudo make install
@ -1101,27 +1073,20 @@ packages can be installed through Fink (check for the most recent versions):
libjpeg hdf hdf5-cpp11 hdf5-cpp11-shlibs
Unfortunately, the ``minixml`` and ``NeXus`` libraries have to be compiled and installed directly from
the source code. Given the respective version numbers of 2.9 and 4.3.2 (which are subject to change with time)
Unfortunately, the ``NeXus`` libraries have to be compiled and installed directly from
the source code. Given the respective version number 4.4 (which are subject to change with time)
this can be achieved for example by:
.. code-block:: bash
$ # first build Mini-XML
$ cd $HOME/Applications
$ git clone https://github.com/michaelrsweet/mxml.git
$ cd mxml
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
$ # second build NeXus
$ # build NeXus
$ cd ..
$ git clone https://github.com/nexusformat/code.git nexus/code
$ cd nexus
$ # build NeXus out-of-source
$ mkdir build
$ cd build
$ cmake ../code -DENABLE_HDF4=1 -DENABLE_HDF5=1 -DENABLE_MXML=1
$ cmake ../code -DENABLE_HDF5=1 -DENABLE_HDF4=0 -DENABLE_MXML=0
$ cmake --build ./ --clean-first -- -j8
$ sudo make install

View File

@ -449,7 +449,7 @@ where :math:`\tau_{\mathrm{Li}}=1.21`\ s is the :math:`^8`\ Li lifetime.
Functions
^^^^^^^^^^^^
The ``libLineProfile`` library currently contains the following functions:
The ``libBNMR`` library currently contains the following functions:
@ -464,10 +464,10 @@ The ``libLineProfile`` library currently contains the following functions:
The parameters are:
#. pulse length :math:`t_0` (ms)
#. relaxation rate :math:`\sigma` (ms\ :math:`^{-1}`\ )
#. pulse length :math:`t_0` (s)
#. relaxation rate :math:`\lambda` (s\ :math:`^{-1}`\ )
This function implements :math:`f(t)=e^{-\sigma t}`.
This function implements :math:`f(t)=e^{-\lambda t}`.
.. index:: SExpRlx
@ -479,11 +479,11 @@ This function implements :math:`f(t)=e^{-\sigma t}`.
The parameters are:
#. pulse length :math:`t_0` (ms)
#. relaxation rate :math:`\sigma` (ms\ :math:`^{-1}`\ )
#. pulse length :math:`t_0` (s)
#. relaxation rate :math:`\lambda` (s\ :math:`^{-1}`\ )
#. stretching exponent :math:`\beta`
This function implements :math:`f(t)=e^{-(\sigma t)^{\beta}}`.
This function implements :math:`f(t)=e^{-(\lambda t)^{\beta}}`.

View File

@ -1064,7 +1064,7 @@ In order to describe the operations needed for fitting and plotting, quite some
.. _msr-alpha-beta:
**alpha, beta** (fit type 2, 3, 5)
These parameters are used to correct the asymmetry for different detector efficiencies, solid angles and initial asymmetries. They are defined as :math:`\alpha = N_{0,b}/N_{0,f}` and :math:`\beta = A_{0,b}/A_{0,f}`. If the parameters are not specified in the :ref:`RUN block <msr-run-block>`, for each one the value of 1 is assumed (for fittype 5 alpha is estimated from the ration of sum of Bp+Bm and Fp+Fm). Example for alpha with fit parameter number 1:
These parameters are used to correct the asymmetry for different detector efficiencies, solid angles and initial asymmetries. They are defined as :math:`\alpha = N_{0,b}/N_{0,f}` and :math:`\beta = A_{0,b}/A_{0,f}`. If the parameters are not specified in the :ref:`RUN block <msr-run-block>`, for each one the value of 1 is assumed (for fittype 5, alpha is estimated from the ratio of :math:`\sum_i \left( N_{\mathrm{bp}}(i)+N_{\mathrm{bm}}(i) \right)` and :math:`\sum_i \left( N_{\mathrm{fp}}(i)+N_{\mathrm{fm}}(i) \right)`). Example for alpha with fit parameter number 1:
::
@ -1868,12 +1868,12 @@ Since MuMinus is quite generic, the full functional depends has to be written in
beta-NMR Asymmetry Fit (fit type 5)
+++++++++++++++++++++++++++++++++++
For a beta-NMR asymmetry fit (fit type 5) four histograms are needed, two for positive and two for negative helicities. These are given by the :ref:`forward <msr-forward-backward>` and :ref:`backward <msr-forward-backward>` keywords
Four histograms are needed for a beta-NMR asymmetry fit (fit type 5), two for positive helecity and two for negative. These are given by the :ref:`forward <msr-forward-backward>` and :ref:`backward <msr-forward-backward>` keywords
in the :ref:`RUN block <msr-run-block>`. Additionally, the parameters :ref:`alpha <msr-alpha-beta>` and :ref:`beta <msr-alpha-beta>` which relate the detector
efficiencies, solid angles and initial asymmetries of the two detectors can be supplied. The constant background for the two histograms is either given by
:ref:`background-determined intervals <msr-background-asymmetry>` or specified through :ref:`backgr.fix <msr-backgr.fix>` in the :ref:`RUN-block <msr-run-block>`.
The experimental asymmetry :math:`a(k)` then is calculated from the four histograms:
The experimental asymmetry :math:`a(k)` is then calculated from the four histograms:
.. math::
@ -1884,12 +1884,12 @@ with
* :math:`N_{\mathrm{fp}}(k)`: counts in the **forward** histogram channel with positive helicity :math:`k`
* :math:`N_{\mathrm{bp}}(k)`: counts in the **backward** histogram channel with positive helicity :math:`k`
* :math:` B_{\mathrm{fp}}`: constant background in the **forward** histogram with positive helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
* :math:` B_{\mathrm{bp}}`: constant background in the **backward** histogram with positive helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
* :math:`B_{\mathrm{fp}}`: constant background in the **forward** histogram with positive helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
* :math:`B_{\mathrm{bp}}`: constant background in the **backward** histogram with positive helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
* :math:`N_{\mathrm{fm}}(k)`: counts in the **forward** histogram channel with negative helicity :math:`k`
* :math:`N_{\mathrm{bm}}(k)`: counts in the **backward** histogram channel with negative helicity :math:`k`
* :math:` B_{\mathrm{fm}}`: constant background in the **forward** histogram with negative helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
* :math:` B_{\mathrm{bm}}`: constant background in the **backward** histogram with negative helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
* :math:`B_{\mathrm{fm}}`: constant background in the **forward** histogram with negative helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
* :math:`B_{\mathrm{bm}}`: constant background in the **backward** histogram with negative helicity (RUN block: :ref:`backgr.fix <msr-backgr.fix>` or :ref:`background <msr-background-asymmetry>`)
This theoretical asymmetry :math:`a(t)` is used to fit the function
@ -1907,7 +1907,8 @@ For the graphical representation in plot type 5 the equation above is rearranged
.. math::
A(t)=\frac{(\alpha -1)+(\alpha +1)a(t)}{(\alpha\beta +1)+(\alpha\beta -1)a(t)}-\frac{(\alpha +1)a(t)-(\alpha -1)}{(\alpha\beta +1)+(1-\alpha\beta)a(t)}=\frac{\alpha\left[N_{\mathrm{fp}}(t)-B_{\mathrm{fp}}\right]-\left[N_{\mathrm{bp}}(t)-B_{\mathrm{bp}}\right]}{\alpha\beta\left[N_{\mathrm{fp}}(t)-B_{\mathrm{fp}}\right]+\left[N_{\mathrm{bp}}(t)-B_{\mathrm{bp}}\right]} -\frac{\alpha\left[N_{\mathrm{fm}}(t)-B_{\mathrm{fm}}\right]-\left[N_{\mathrm{bm}}(t)-B_{\mathrm{bm}}\right]}{\alpha\beta\left[N_{\mathrm{fm}}(t)-B_{\mathrm{fm}}\right]+\left[N_{\mathrm{bm}}(t)-B_{\mathrm{bm}}\right]}
A(t) &= \frac{(\alpha -1)+(\alpha +1)a(t)}{(\alpha\beta+1)+(\alpha\beta -1)a(t)}-\frac{(\alpha +1)a(t)-(\alpha-1)}{(\alpha\beta +1)+(1-\alpha\beta)a(t)} \\
&= \frac{\alpha\left[N_{\mathrm{fp}}(t)-B_{\mathrm{fp}}\right]-\left[N_{\mathrm{bp}}(t)-B_{\mathrm{bp}}\right]}{\alpha\beta\left[N_{\mathrm{fp}}(t)-B_{\mathrm{fp}}\right]+\left[N_{\mathrm{bp}}(t)-B_{\mathrm{bp}}\right]} -\frac{\alpha\left[N_{\mathrm{fm}}(t)-B_{\mathrm{fm}}\right]-\left[N_{\mathrm{bm}}(t)-B_{\mathrm{bm}}\right]}{\alpha\beta\left[N_{\mathrm{fm}}(t)-B_{\mathrm{fm}}\right]+\left[N_{\mathrm{bm}}(t)-B_{\mathrm{bm}}\right]}
and plotted together with the function given in the THEORY block.