While one can pip install
this pacakge directly, most likely the non-Python dependencies will not be available. For the time being, therefore, we recommend using Conda.
The instruction below is for admins who have the root priviledge to install the software at the system level so that all users logging in the machine can run the software directly without any setup.
Note: The instructions for automatic installation are out of date and may not work as expected.
ptycho_production
: sudo /opt/conda/bin/conda create -p /opt/conda_envs/ptycho_production python=3.6 nsls2ptycho
(If you need beamline-specific packages, such as hxntools
for HXN, append the package names in the conda create
command. This helps resolve possible conflict/downgrade issues.)
The conda environment ptycho_production
is activated under the hood using the run-ptycho
script to be installed in the last step.fix_conda_privileges.sh
sudo -i
(switch to root
)/opt/conda_envs/ptycho_production/bin/pip install 'cupy-cudaXX>=6.0.0b3'
, where XX
is your CUDA toolkit version, available from nvcc --version
run-ptycho
in the root of this repo to /usr/local/bin/
: sudo cp ./run-ptycho /usr/local/bin/
To update the software, simple do sudo conda update -n ptycho_production nsls2ptycho
ptycho_production
: sudo conda create -n ptycho_production -c conda-forge python=3.9 pyfftw pyqt=5 'numpy<2' scipy matplotlib pillow h5py 'databroker<=1.999' openmpi mpi4py cython
. If you need beamline-specific packages, such as hxntools
for HXN, append the package names in the conda create
command. This helps resolve possible conflict/downgrade issues.
The conda environment ptycho_production
is activated under the hood using the run-ptycho
script to be installed in Step 9.conda activate ptycho_production
.pip install posix_ipc
.mkdir /tmp/build_ptycho; cd /tmp/build_ptycho
git clone --recursive https://github.com/NSLS-II/ptycho_gui.git
(During the process git
may prompt you to enter your GitHub login and password for cloning the backend.)/usr/local/
: sudo mv ./ptycho_gui /usr/local/; cd /usr/local/ptycho_gui; rmdir /tmp/build_ptycho
sudo /opt/conda_envs/ptycho_production/bin/pip install -e .
run-ptycho
to /usr/local/bin/
: sudo cp ./run-ptycho /usr/local/bin/
To update the software, simple go to the code location and do git pull
there. Since we installed in the develop mode (with -e
flag) the files are symlinked to the conda env, so any updates we do to the code will be immediately up online. This can also work as a way to do "hot fixes".
cd /usr/local/ptycho_gui/
sudo git pull origin master # update frontend
cd ./nsls2ptycho/core/ptycho/
sudo git pull origin master # update backend
The procedure is similar to Manual Installation outlined above, except that it does not require sudo
:
git clone --recursive https://github.com/NSLS-II/ptycho_gui.git
(during the process git
will prompt you to enther your GitHub id and password for cloning the backend)sudo
). Alternatively, the needed packages may be installed in the existing Conda environment.cd ./ptycho_gui
.pip install .
(or pip install -e .
).run-ptycho
mpirun -n 2 run-ptycho-backend input_file
~/.ptycho_gui/
working_dir/recon_results/SXXXXX/
, where XXXXX
is the scan-number string..cubin
files are stored with the Python codeFor users using the new solvers mADMM, PM, and APG, you are advised to cite additionlly the following paper:
MIT (subject to change)
Users are encouraged to cite the references above.