This page provides a quick overview of the pymicro code base.
Pymicro is organised around 8 packages:
pymicro.appscontains a simple application to visualise and interact with 2D images and 3D volumes;
pymicro.coregather the samples.py module at the root of the data management in Pymicro and some related utilities.
pymicro.crystalcontains various modules to handle crystal lattices, crystallographic grains and to organise them into microstructures;
pymicro.externalregroup external utilities used for instance to read TIF or CIF files;
pymicro.fecontains a module to manipulate files for finite-elements analysis;
pymicro.filecontains many helpers methods to handle typical file reading and writting found at ESRF, ANKA and Soleil;
pymicro.viewcontains the two principal modules for 3D visualisation: vtk_utils.py for rendering still 3D images and vtk_anim.py to create animations;
pymicro.xrayregroup modules to simulate and analyse xray experiments like tomography and diffraction..
You can grab a copy of the latest version on the git repository at Centre des Materiaux, open a terminal and type:
git clone http://github.com/heprom/pymicro
This will create a pymicro folder containing the source code (another pymicro folder), the documentation and the examples. Then you must add this folder to the PYTHONPATH environement variable. To do this you can add this line to your .cshrc file:
setenv PYTHONPATH /path/to/source/folder/pymicro
Then you will be able to use pymicro (you may have to source the .cshrc or restart the terminal). For instance after starting a ipython shell:
from pymicro.file.file_utils import HST_read
If you want to use pymicro interactively and import all modules at ipython startup you may apply the following recipe: Using pymicro interactively
Python 3.7+ required, please report any problem on the github page.
numpy - For array, matrix and other numerical manipulations. Used extensively by all modules.
scipy, mainly used for ndimage filters.
skimage for additional image analysis (http://scikit-image.org).
matplotlib 1.1+ for plotting (e.g. pole figures or 3D image slices).
VTK with Python bindings (http://www.vtk.org/) for visualization of 3D data using the
pymicro.viewpackage. Version should be > 5.8.0, 9.0.1 recommended.
h5py and pytables to deal with HDF5 files.
basictools. Starting with version 0.5, we rely on this library to support mesh data; basictools is open source and can be installed from conda using:
`conda install -c conda-forge basictools`.
Crystal lattices can be created using CIF files usig the
pymicro.crystal.lattice.from_cifmethod. We use PyCifRW to read and parse CIF files.
reading and writing 3d Tiff files is supported via the TiffFile module.
For detailed documentation of all modules and classes, please refer to the API docs.