Metadata-Version: 2.2
Name: specsanalyzer
Version: 0.6.0a1
Summary: Python package for loading and converting SPECS Phoibos analyzer data.
Author-email: Laurenz Rettig <rettig@fhi-berlin.mpg.de>, Michele Puppin <michele.puppin@epfl.ch>, Abeer Arora <arora@fhi-berlin.mpg.de>
License: MIT
Project-URL: repository, https://github.com/OpenCOMPES/specsanalyzer
Project-URL: documentation, https://opencompes.github.io/docs/specsanalyzer/latest/
Keywords: specs,phoibos,arpes
Requires-Python: <3.13,>=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: elabapi-python>=5.0
Requires-Dist: h5py>=3.6.0
Requires-Dist: imutils>=0.5.4
Requires-Dist: ipympl>=0.9.1
Requires-Dist: ipywidgets>=7.7.1
Requires-Dist: matplotlib>=3.5.1
Requires-Dist: numpy>=1.21.6
Requires-Dist: opencv-python>=4.8.1.78
Requires-Dist: pynxtools-mpes>=0.2.1
Requires-Dist: pynxtools>=0.9.3
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pyyaml>=6.0
Requires-Dist: xarray>=0.20.2
Requires-Dist: tifffile>=2022.5.4
Requires-Dist: tqdm>=4.62.3
Requires-Dist: scipy>=1.8.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.1; extra == "dev"
Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
Requires-Dist: pytest-xdist>=2.5.0; extra == "dev"
Requires-Dist: pytest-clarity>=1.0.1; extra == "dev"
Requires-Dist: ruff<0.3.0,>=0.1.7; extra == "dev"
Requires-Dist: mypy<1.10.0,>=1.6.0; extra == "dev"
Requires-Dist: types-pyyaml>=6.0.12.12; extra == "dev"
Requires-Dist: types-requests>=2.31.0.9; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.1.2; extra == "docs"
Requires-Dist: tomlkit>=0.12.0; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=1.17.0; extra == "docs"
Requires-Dist: nbsphinx>=0.9.3; extra == "docs"
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme>=0.15.0; extra == "docs"
Provides-Extra: notebook
Requires-Dist: jupyter>=1.0.0; extra == "notebook"
Requires-Dist: ipykernel>=6.9.1; extra == "notebook"
Requires-Dist: jupyterlab>=4.0; extra == "notebook"
Requires-Dist: jupyterlab-h5web>=7.0.0; extra == "notebook"

[![Documentation Status](https://github.com/OpenCOMPES/specsanalyzer/actions/workflows/documentation.yml/badge.svg)](https://opencompes.github.io/specsanalyzer/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![](https://github.com/OpenCOMPES/specsanalyzer/actions/workflows/linting.yml/badge.svg)
![](https://github.com/OpenCOMPES/specsanalyzer/actions/workflows/testing_multiversion.yml/badge.svg?branch=main)
![](https://img.shields.io/pypi/pyversions/specsanalyzer)
![](https://img.shields.io/pypi/l/specsanalyzer)
[![](https://img.shields.io/pypi/v/specsanalyzer)](https://pypi.org/project/specsanalyzer)
[![Coverage Status](https://coveralls.io/repos/github/OpenCOMPES/specsanalyzer/badge.svg?branch=main&kill_cache=1)](https://coveralls.io/github/OpenCOMPES/specsanalyzer?branch=main)

# specsanalyzer
This is the package `specsanalyzer` for conversion and handling of SPECS Phoibos analyzer data.

This package contains two modules:
`specsanalyzer` is a package to import and convert MCP analyzer images from SPECS Phoibos analyzers into energy and emission angle/physical coordinates.
`specsscan` is a Python package for loading Specs Phoibos scans acquired with the labview software developed at FHI/EPFL

Tutorials for usage and the API documentation can be found in the [Documentation](https://opencompes.github.io/specsanalyzer/)

## Installation

### Pip (for users)

- Create a new virtual environment using either venv, pyenv, conda, etc. See below for an example.

```bash
python -m venv .specs-venv
```

- Activate your environment:

```bash
source .specs-venv/bin/activate
```

- Install `specsanalyzer` from PyPI:

```bash
pip install specsanalyzer
```

- This should install all the requirements to run `specsanalyzer` and `specsscan`in your environment.

- If you intend to work with Jupyter notebooks, it is helpful to install a Jupyter kernel for your environment. This can be done, once your environment is activated, by typing:

```bash
python -m ipykernel install --user --name=specs_kernel
```

#### Configuration and calib2d file
The conversion procedures require to set up several configuration parameters in a config file. An example config file is provided as part of the package (see documentation). Configuration files can either be passed to the class constructors, or are read from system-wide or user-defined locations (see documentation).

Most importantly, conversion of analyzer data to energy/angular coordinates requires detector calibration data provided by the manufacturer. The corresponding *.calib2d file (e.g. phoibos150.calib2d) are provided together with the spectrometer software, and need to be set in the config file.

### For Contributors

To contribute to the development of `specsanalyzer`, you can follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/OpenCOMPES/specsanalyzer.git
cd specsanalyzer
```

2. Check out test data (optional, requires access rights):

```bash
git submodule sync --recursive
git submodule update --init --recursive
```

2. Install the repository in editable mode:

```bash
pip install -e .
```

Now you have the development version of `specsanalyzer` installed in your local environment. Feel free to make changes and submit pull requests.

### Poetry (for maintainers)

- Prerequisites:
  + Poetry: https://python-poetry.org/docs/

- Create a virtual environment by typing:

```bash
poetry shell
```

- A new shell will be spawned with the new environment activated.

- Install the dependencies from the `pyproject.toml` by typing:

```bash
poetry install --with dev, docs
```

- If you wish to use the virtual environment created by Poetry to work in a Jupyter notebook, you first need to install the optional notebook dependencies and then create a Jupyter kernel for that.

  + Install the optional dependencies `ipykernel` and `jupyter`:

  ```bash
  poetry install -E notebook
  ```

  + Make sure to run the command below within your virtual environment (`poetry run` ensures this) by typing:

  ```bash
  poetry run ipython kernel install --user --name=specs_poetry
  ```

  + The new kernel will now be available in your Jupyter kernels list.
