EDCal
(E)nergy-(D)ispersive X-ray detector (Cal)ibration GUI
Python GUI software for energy and q calibration of energy-dispersive X-ray detectors, built on Algodif, PySide6 and pyqtgraph.
Features
The GUI has two main tabs, switchable at any time:
- Q calibration.
- Energy calibration.
Each tab keeps its own data, results and status bar. The colour theme is shared. Plots: mouse wheel to zoom, drag to pan, the 'A' button (bottom-left of a plot) to show the full view. The Reset button in the Image display group resets the contrast and zooms out the plots of the current tab.
Q calibration
Workflow (based on the q_calibration_*.py scripts in Algodif examples):
- Load data (image, HDF, or GeRM dat file; multiple files are averaged).
- Reference pattern: select a calibrant shipped with algodif (Al2O3, CeO2,
Cr2O3, LaB6, Si) and/or input d-spacings manually. Choose how the q-step
(q per pixel) is obtained:
- Constant q-step: same for all strips (can be estimated from two peaks in the Processing tab).
- GeRM geometry, q-step per strip: estimated from the detector geometry, two-theta and the energy step. The reference pattern then varies between strips.
- GeRM geometry, energy matching: peaks are matched in energy space using energies estimated from the geometry.
- Single-strip calibration: preprocess, detect/edit peaks, locate them with sub-pixel accuracy, match to reference q-values, and fit.
- Multiple-strip calibration: calibrate groups of strips with their own parameters, check and correct the image to a uniform q-grid.
- Data correction: correct new data with the calibrated coefficients.
Energy calibration
Workflow (based on the calibrate_energy_*.py scripts in Algodif examples):
- Load data (image, HDF, or GeRM dat file; multiple files are averaged, e.g. measurements of different calibrants).
- Reference spectrum: fluorescence lines of the calibrants from the xraydb database and/or manual lines (keV), broadened on the energy grid given by the energy step (keV per pixel).
- Single-strip calibration: preprocess, detect/edit peaks, locate them with sub-pixel accuracy, match to reference energies, and fit. Add the results of calibrated strips and save them (JSON, CSV).
- Multiple-strip calibration: calibrate groups of strips with their own parameters, check and correct the image to a uniform energy grid, and save the coefficients and energy maps.
- Data correction: correct new data with the calibrated coefficients.
Design
The software is structured based on the RUI (Rendering-Utilities-Interactions) concept, a user-friendly adaptation of the MVC design pattern:
edcal/lib/utilities.py: constants and helper methods without GUI dependencies.edcal/lib/rendering.py: themes, plot helpers, and window layouts.edcal/lib/interactions.py: user actions, calculations, and the application controller.edcal/main.py: application entry.
Installation
Install Miniconda, Anaconda or Miniforge, then open a Linux terminal or the Miniconda/Anaconda PowerShell prompt and use the following commands for installation.
Using pip:
pip install edcal
Using conda:
conda install -c algotom -c conda-forge edcal
Once installed, launch EDCal with
edcal
Installing from source:
- Create a conda environment
conda create -n edcal python=3.11 conda activate edcal
- Clone the source (git needs to be installed)
git clone https://github.com/algotom/edcal.git
- Navigate to the cloned directory (having the pyproject.toml file)
pip install .
- Or run without installing, from the cloned directory, in an environment
having the packages in requirements.txt:
python -m edcal.main
Building a conda package from the recipe:
conda install conda-build
conda build -c algotom -c conda-forge recipe
Generating the executable application
- Install the packages in requirements.txt, PyInstaller, and Pillow (to convert the PNG icon) in your environment.
- From the repository root, run:
python build_exe_app.py
- The application is generated in the build_app/EDCal folder. To move the app to a different place, move the entire folder.
Metadata
Release files for edcal 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| edcal-1.0.0.tar.gz | 80.7 kB | Without provenance | Details for edcal-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| edcal-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for edcal-1.0.0-py3-none-any.whl |
Total release size: 160.5 kB
Release files / edcal-1.0.0.tar.gz
| Download URL | edcal-1.0.0.tar.gz |
|---|---|
| Size | 80.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
246573821076d256573c02697cecf00cc3077fdf738ccdbd6af3aac349a83983
|
|
BLAKE2b-256 checksum How to use checksums |
685b5638b5b6d924b5348f9e79cc15041926ed314ae637e8a76dc6fe204baf6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Release files / edcal-1.0.0-py3-none-any.whl
| Download URL | edcal-1.0.0-py3-none-any.whl |
|---|---|
| Size | 79.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
060049c57af15187bf013b6bb78b97d74c6d714e2062c9577b3be2cfb429ff09
|
|
BLAKE2b-256 checksum How to use checksums |
0ec351bacbd33a228f249b581761059449805f826bcef46af6f55e7e147c2197
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for edcal 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.