a collection of python modules for data analysis in udkm group
The documentation including code examples can be found here: https://udkm.readthedocs.io
This library is subdivided into modules that are adapted to the different experimental setups and
pxs
: library for the X-ray diffraction setup using the Plasma X-ray sourcemoke
: routines for the trMOKE setup in the femto-magnetism labkmc3
: data evaluation using the h5 files that come out of the xpp endstation at kmc3tools
: general functions, fits, constants and plot layoutssim
: general material database and example for udkm1dsim codecalc
: general collection of more or less frequently used calculation scripts
This allows you to have editable source file that you can add to the python search path.
- install git that is available from
https://git-scm.com/downloads
- run git and initialize your name and e-mail adress via:
git config --global user.name "John Doe"
git config --global user.email [email protected]
- go to folder where you want to store the code repository for example
C:\Users\Aleks\Documents\Code
- open a console by typing
cmd
into your explorer line - clone the repsoitory via
git clone https://github.com/AleksUDKM/udkm.git
- add the repository to your search path of your python distribution
in Spyder I have
C:\Users\Aleks\Documents\Code\udkm
in the PYTHONPATH manager - Klick the synchronize button and restart Spyder to be sure that the changes are applied
To see if your installation works try:
import udkm.tools.functions as tools
print(tools.teststring)
which should yield: "Successfully loaded udkm.tools.functions"
Allows usage of the code without the option of changing it
pip install git+https://github.com/AleksUDKM/udkm.git
To contribute code to the repository you need a GitHub account. Once you have that let me know and I will add you as contributor after a brief intro into our concept.
- open a command window in the directory of the repository (for example:
C:\Users\Aleks\Documents\Code\udkm
) - check that you have no conflicts by typing
git status
- get the most recent version of the repository via
git pull
- modify the code on your local machine and test that it works.
- once you are satisfied you can add your changes to the repository by
git add *
- commit your changes via
git commit -m "short description of the commit"
- push your commits into the online repository via
git push
In udkm.tools you find the file udkm_base.mplstyle
that we use as a default for plotting with matplotlib.
To add it to the preinstalled matplotlib styles follow these steps:
- Look for the function path of matplotlib using
import matplolitb
matplotlib.matplotlib_fname()
- There you will find a folder called
stylelib
to which you copy the fileudkm_base.mplstyle
- After restarting your kernel you should be able to use the new plotstyle via:
import matplolitb.pyplot as plt
plt.style.use("udkm_base")
Alternatively you can import the plotstyle file into your runtime using the absolute or relative path
to the style file via plt.style.use(path_to_file+"/udkm_base.mplstyle")
, potentially also in the startup routine.