Metadata-Version: 2.4
Name: dioptas
Version: 0.10.0
Summary: GUI program for reduction and exploration of 2D X-ray diffraction data
Author-email: Clemens Prescher <clemens.prescher@gmail.com>
License: MIT
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: EXtra-data<2.0,>=1.13.0; sys_platform == "linux"
Requires-Dist: h5py<4.0,>=3.13.0
Requires-Dist: hdf5plugin<6.0,>=5.0.0
Requires-Dist: lmfit<2.0,>=1.3.3
Requires-Dist: pandas<3.0,>=2.1.1
Requires-Dist: psutil<6.0,>=5.9.5
Requires-Dist: PyQt6<7.0,>=6.8
Requires-Dist: pyfai>=2025.12.1
Requires-Dist: pyqtgraph<0.14,>=0.13.7
Requires-Dist: pyshortcuts<2.0,>=1.8.1
Requires-Dist: QtPy<3.0,>=2.4.3
Requires-Dist: scikit-image<0.27,>=0.26.0
Requires-Dist: sharedmem<0.4,>=0.3.8
Requires-Dist: watchdog<7.0,>=6.0.0
Requires-Dist: pyopengl<4.0,>=3.1.7
Requires-Dist: pyopengl-accelerate<4.0,>=3.1.7
Requires-Dist: xypattern<2.0,>=1.2.2
Requires-Dist: numpy<3.0,>=2.0
Requires-Dist: scipy<2.0,>=1.16.3
Requires-Dist: numexpr<3.0,>=2.10.2
Requires-Dist: qt-material<3.0,>=2.14
Requires-Dist: bitshuffle>=0.5.1
Requires-Dist: xraydb>=4.5.8
Requires-Dist: psygnal<0.16,>=0.15.1
Requires-Dist: peritheos<1.0,>=0.4.0
Requires-Dist: phasesmith<0.5,>=0.4.1
Provides-Extra: test
Requires-Dist: pytest<10.0,>=7.4.0; extra == "test"
Requires-Dist: pytest-cov<7.0,>=6.0; extra == "test"
Requires-Dist: pytest-qt<5.0,>=4.4.0; extra == "test"
Requires-Dist: mock<6.0,>=5.1.0; extra == "test"
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
Dynamic: license-file

# Dioptas

A GUI program for fast analysis of powder X-ray diffraction images. It provides the capability of calibrating,
creating masks, having pattern overlays and showing phase lines.

## Documentation

The full user manual is hosted on Read the Docs:

https://dioptas.readthedocs.io/

## Maintainer

Clemens Prescher (clemens.prescher@gmail.com)

## Requirements

- Python 3.11, 3.12, or 3.13

Dioptas runs on 64-bit Windows, macOS, and Linux.

## Installation

### Executables

Executable versions for Windows, macOS, and Linux can be downloaded from:

https://github.com/Dioptas/Dioptas/releases

The executable versions are self-contained and do not need a Python installation.
Under Windows and Linux the program can be started by running the executable (e.g. Dioptas.exe or Dioptas).
On macOS, open the `.dmg` and drag Dioptas to Applications. A `.tar.gz` archive of the application is also available.

If macOS shows a warning that the app "cannot be verified", you need to remove the quarantine attribute by running the following command in the Terminal:

```bash
find Dioptas_*.app -exec xattr -c {} \;
```

### Python Package

The easiest way to install the dioptas python package is using pip.

```bash
pip install dioptas
```

and then run Dioptas by typing:

```bash
dioptas
```

on the command line.

Dioptas is also available from conda-forge:

```bash
conda config --add channels conda-forge
conda install dioptas
```

## Running the Program from source

In order to run the program from source, the easiest way is to use the uv package manager.
Clone the repository from github and navigate to the repository:

```bash
git clone https://github.com/Dioptas/Dioptas.git
cd Dioptas
```

Note: This will clone the `develop` branch by default, which contains the latest development version.
If you want to use the latest stable release instead, switch to the `main` branch after cloning:

```bash
git checkout main
```

Install uv and the dependencies by running:

```bash
python -m pip install uv
uv sync
```

This will create a new environment with all the required python packages in `.venv`.

Afterward the program can be started by running:

```bash
uv run dioptas
```

In order to run the program without uv, you need to install the required packages yourself.
The packages are listed in the file `pyproject.toml`. The program can then be started by running:

```bash
python run.py
```

## Scripting API

Dioptas can also be used as a Python library for headless integration from scripts and Jupyter notebooks.
Set up your experiment in the GUI, save a `.dio` project file, then use it in code:

```python
from dioptas.pipeline import Pipeline

# Load full setup (calibration, mask, corrections, etc.) from a project file
p = Pipeline.from_project("experiment.dio")

# Override the mask if needed
p.load_mask("new_beamstop.mask")

# Integrate a single image
pattern = p.integrate("sample_001.tiff")
pattern.save("sample_001.xy")

# Batch integrate with a glob pattern
patterns = p.integrate_batch("data/sample_*.tif")
```

See the [scripting API documentation](docs/source/scripting_api.rst) for the full reference.
