Skip to content

AdvancedPhotonSource/pyXpcsViewer

Repository files navigation

pyXPCSViewer

A python-based interactive visualization tool to view XPCS dataset.

To cite pyXPCSViewer:

Chu et al., "pyXPCSviewer: an open-source interactive tool for X-ray photon correlation spectroscopy visualization and analysis", Journal of Synchrotron Radiation, (2022) 29, 1122–1129.

Supported Format

This tools supports the customized nexus fileformat developed at APS-8IDI's XPCS data format for both multi-tau and two-time correlation.

Install and Uninstall

Updated 03/11/2025

It is highly recommended to set up a new virtual environment to isolate pyXPCSViewer, so it does not interfere with dependencies of your existing applications.

  1. Install conda following the instructions at link.

  2. Create a brand-new environment with conda:

    conda create -n your_env_name python==3.10.16

    Replace your_env_name with your preferred environment name.

  3. Activate the new environment:

    conda activate your_env_name
  4. Install pyXPCSViewer:

    pip install xpcs-viewer

    Note: Running conda and pip commands together is generally not recommended. pyXPCSViewer will only use pip or conda once compatibility issues are resolved.

  5. Launch pyXPCSViewer:

    1. Activate your environment if you have not already.

    2. Run:

      pyxpcsviewer path_to_hdf_directory   # Run the viewer from the hdf directory
      pyxpcsviewer                         # Run in the current directory

    run_viewer, an alias to pyxpcsviewer, can also be used to luanch the viewer.

  6. To upgrade:

    1. Activate your environment if you have not already.

    2. Run:

      pip install -U xpcs-viewer
  7. To uninstall:

    1. Activate your environment if you have not already.

    2. Run:

      pip uninstall xpcs-viewer
    3. If you want to remove the environment altogether, first deactivate it:

      conda deactivate

      Then remove it:

      conda remove -n your_env_name --all

Gallery

  1. The integrated scattering pattern over the whole time series.

    docs/images/saxs2d.png
  2. The reduced one-dimensional small-angle scattering data.

    docs/images/saxs1d.png
  3. The sample's stability against X-ray beam damage. The time series is divided into 10 sections. The SAXS-1D curve is plotted for each section.

    docs/images/stability.png
  4. Intensity fluctuation vs. Time.

    docs/images/intt.png
  5. Average Tool box.

    docs/images/average.png
  6. g2 plot for multitau analysis. Users can fit the time scale using a single exponential function, with options to specify the fitting range and fitting flags (fix or fit).

    docs/images/g2mod.png
  7. Diffusion analysis. g2 fitting in the previous panel is required to plot \tau \mbox{vs.} q.

    docs/images/diffusion.png
  8. Two-time correlation. Users can select two q indexes either on the q-map or on the SAXS-2D image.

    docs/images/twotime.png
  9. Experiment condition viewer. It reads the file structure and string entries of the selected HDF file.

    docs/images/hdf_info.png

About

A python-based interactive visualization tool to view XPCS dataset

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages