-
Notifications
You must be signed in to change notification settings - Fork 3
Installation
Download for your OS from here and install.
This is a much harder method to install PeakPo
unless you are familiar with Anaconda or Miniconda.
If you previously installed PeakPo
, you may already have this setup and therefore you may skip Step 1 and Step 2, and go to Step 3 just for an update. If you need to create a new environment, you may start from Step 2.
Download Python 3.6
(version 3.9 not tested) from https://www.anaconda.com/distribution/ for your OS and install. The installation should be straightforward.
Conda
in Anaconda distribution provides you with virtual environment functionality: see here for detail. We will make a virtual environment for PeakPo
.
-
Run
Terminal.app
(for Mac) orAnaconda powershell
(for Windows). All the commands below should be typed or copied to the terminal. -
Create a
conda
environment forPeakPo
, for examplepkpo
:conda create --name pkpo python=3.6
(2022/06/22) For MacOS, any versions of
python 3.6
works. (2021/05/01) For MacOS, we used to recommend:conda create --name pkpo python=3.6.6
because of the segmentation fault 11 found fortk == 8.6.9
for MacOS. However, it appears thatPython 3.8
is fine for macos.Avoid
Python < 3.5
, because they do not work withpymatgen
. -
Switch to the new environment (in this example
pkpo
):conda activate pkpo
(Warning)
PeakPo
versions between 7.7.10 and 7.7.19,PeakPo
works only withmatplotlib
version = 2.1 andPyQt5
. In this case you should do:conda install matplotlib=2.1
.(Warning)
PeakPo
versions above 7.7.20 work only withmatplotlib
version 2.2.x.PeakPo
versions above 7.7.24 work only withmatplotlib
version 3 or higher. -
Install some necessary packages.
conda install -c conda-forge scipy=1.4 pyqt=5.9.2 uncertainties pymatgen=2020.12.31 lmfit periodictable fabio=0.12.0 xlwt
conda install -c conda-forge matplotlib=3.2 statsmodels=0.10
pip install pytheos --user
(2021/05/01) If the command above fails, try to install modules one by one rather than once. For example,
conda install -c conda-forge pyqt
, etc. (2021/05/01)matplotlib >= 3.3
has an incompatibility issue withPeakPo
.(2021/05/01) I remove the restriction on macos for
tk=8.6.8
. A version higher than that inpython=3.6
used to cause segment fault. Now withtk=8.6.10
andpython=3.8
, I found no problem anymore.At this point we have three difference choices for versions of
pyfai
anddill
.(a) If you have never used
PeakPo
before or yourdpp
files made in 2019 or later (environmentpkpo
), execute the following and then go to Step 3.conda install -c conda-forge pyfai=0.20.0 dill=0.3.4
If you have old
dpp
files, these files may not open properly with the environment created here. In this case, I suggest to create a different environment with different versions ofpyfai
anddill
. In this case, by changing the environment you can still open olddpp
files.(b) If you have
dpp
files made in 2017 or before, go back to step 2-2 above and create an environmentpkpo2017
. Then install the packages below in thepkpo2017
environment.conda install -c conda-forge pyfai=0.14.2 dill=0.2.8.2
If the command above returns an error not finding any of these old versions:
pip install pyfai=0.14.2 dill=0.2.8.2 --user
(c) If you have
dpp
files made in 2018 or before, go back to step 2-2 above and create an environmentpkpo2018
. Then install the packages below in thepkpo2018
environment.conda install -c conda-forge pyfai=0.14.2 dill=0.2.6
If the command above returns error not finding any of these old versions:
pip install pyfai=0.14.2 dill=0.2.6 --user
You are ready to run PeakPo
.
-
Go to a folder where you will install the
PeakPo
files. For example,cd ~
mkdir Python
cd Python
-
Make a folder to install
PeakPo
:mkdir PeakPo-7.7.31
cd PeakPo-7.7.31
-
In the terminal window, copy, paste, and hit the
return
key for the line below.git clone https://github.com/SHDShim/PeakPo .
(Note) Don't forget the period at the end of the line above.
(Note for Big Sur) You need to insert the following line in the beginning of
.bash_profile
file.export QT_MAC_WANTS_LAYER=1
-
Go to the
peakpo
folder.cd ~/Python/PeakPo-7.7.31/peakpo
-
Run the following commands in Terminal:
conda activate pkpo
python -m peakpo
In a very rare case, you might have to do
sudo
:sudo python -m peakpo
Most common error at this step is you are in a wrong folder. Please find a folder that has
PeakPo.py
.
-
For macos, insert the following line in
.bash_profile
file.alias peakpo="cd ~/Python/PeakPo-7.7.31/peakpo; python -m peakpo"
-
For windows, insert the following line in
autoexec.bat
file.
For windows and macos, you can download a script file from this github page. Then open the file with a text editor and modify for your path and environment setup. You can place this file in your desktop for example and double click for quick access.
Data types and functions
Plot and sidebars
Toolbars
Base pattern
Waterfall patterns
Background subtraction
Setup
Control gray scale
Azimuthal integration
JCPDSs
JCPDS, control the view
Make a jcpds from cif
Workflow
Tweak
Save Tweak to JCPDS
Get Tweak result
Peak fitting
Unit-cell fitting
Session
Output files
Publication-ready Cake plot
Illustrator-ready PeakPo plot
Install in anaconda
Update
Run PeakPo in python
Update history
Issues and Suggestions
Environments | FBS setup | APS setups
PeakPo with Jupyter