Skip to content

Latest commit

 

History

142 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mujpy

A Python \muSR data analysis based on classes, with a graphical interface designed for jupyter, released under the GPL-3 licence.

It aims at the power of musrfit with the user-friendly appearance of mulab.

Version 3.0 refactoring. See Changelog for the most recent version details. Main technical features:

  • a model built on two-letter bricks: mg, for Gaussian-damped cosine, ml for Lorentzian-damped cosine etc.
  • sequential fits by the same model, driven by a run list and a list of grouping dictionaries, for asymmetry definition
  • global fits by user-defined parameters assigned to model parameters in a json file
  • a mulab-like interface in jupyterlab that allow fit model and parameter editing, hopefully with a gentler learning curve than musrfit
  • web interface by `voila`, included

Try mujpy!

You only need to: [4]

  1. Install python (python3 is assumed)
  2. Install pip [perhaps create a venv]
  3. invoke pip install mujpy

This repository includes `Mudashed.ipynb`, a static notebook. Type its two cells yourself in jupyterlab:

%matplotlib qt

and

from mujpy.mudashed import dashed as mudash
the_dash = mudash()

Otherwise, download `Mudashed.ipynb` and `Mudashed-demos.ipynb` from the `tests/` folder of this repository and test the gui:

  1. create project directory and cd to it

b. copy Mudashed-demos.ipynb into it d. type voila Mudashed-demos.ipynb in a terminal (voila comes with mujpy) [5] e. Group0 already reads 3-4 (Up-Down in GPS), leave it f. press DL and choose the first datafile (e.g. a transverse field run, 822) g. insert the run number in run list and hit Enter (or press RL) h. press LF and double-click on `almgml.822.3-4.1_fit.json` in teh pop-up i. press Fit, check the result j. change run list to 822,834 or 822,827:834:-1 and press LF again, check the result

For more complex fits see the Introduction in ReadTheDocs For a first demo try out [6] the script test.py: choose an empty folder, edit a file savetests.py and copy-paste the following code:

from mujpy.tools.tools import savetests
savetests()

Execute python savetests.py. This allows you to run python test.py, to get a look and feel of the 16 different types of fit that mujpy provides.

Modify the script for your purposes. The clumsy part here is to modify by hand the models in the fit/… .json files. Use the gui instead.

Footnotes

[4]in principle mujpy works on all OS, but for the moment it is tested only on linux
[5]snap-installed firefox has a known bug with voila, follow ` <voila-dashboards/voila#1508>`_ for a simple workaround
[6]if pip install mujpy was successful

About

A Python MuSR data analysis graphical interface, based on classes, designed for jupyter.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages