eemkit 0.4.2__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {eemkit-0.4.2 → eemkit-0.6.0}/CHANGELOG.md +47 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/CITATION.cff +2 -2
- {eemkit-0.4.2 → eemkit-0.6.0}/PKG-INFO +25 -6
- {eemkit-0.4.2 → eemkit-0.6.0}/README.md +24 -5
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/api.md +1 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/app-guide.md +1 -1
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/corrections.md +27 -0
- eemkit-0.6.0/docs/download.md +82 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/gui.md +21 -1
- eemkit-0.6.0/docs/img/logo-256.png +0 -0
- eemkit-0.6.0/docs/img/logo.svg +10 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/index.md +3 -0
- eemkit-0.6.0/src/eemkit/__init__.py +91 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/cli.py +14 -1
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/__init__.py +4 -2
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/inner_filter.py +32 -0
- eemkit-0.6.0/src/eemkit/gui/__init__.py +74 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/corrections_tab.py +46 -6
- eemkit-0.6.0/src/eemkit/gui/icons/eemkit-128.png +0 -0
- eemkit-0.6.0/src/eemkit/gui/icons/eemkit-16.png +0 -0
- eemkit-0.6.0/src/eemkit/gui/icons/eemkit-24.png +0 -0
- eemkit-0.6.0/src/eemkit/gui/icons/eemkit-256.png +0 -0
- eemkit-0.6.0/src/eemkit/gui/icons/eemkit-32.png +0 -0
- eemkit-0.6.0/src/eemkit/gui/icons/eemkit-48.png +0 -0
- eemkit-0.6.0/src/eemkit/gui/icons/eemkit-64.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/main_window.py +3 -1
- eemkit-0.6.0/src/eemkit/gui/splash.py +92 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/pipeline.py +35 -5
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_cli.py +19 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_corrections.py +24 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_gui.py +62 -0
- eemkit-0.6.0/tests/test_package.py +30 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_pipeline.py +41 -1
- eemkit-0.4.2/src/eemkit/__init__.py +0 -51
- eemkit-0.4.2/src/eemkit/gui/__init__.py +0 -30
- {eemkit-0.4.2 → eemkit-0.6.0}/.gitignore +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/LICENSE +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/absorbance.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/campaigns.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/cli.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/data_model.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/0_readme_parafac_app.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/1_project.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/2_corrections.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/3_indices.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/4a_parafac_ranks.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/4b_parafac_outliers.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/4c_parafac_final.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/4d_parafac_by_model.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/5a_rivers_time.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/5b_rivers_composition.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/5c_rivers_tests.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/img/app/6_export.png +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/indices.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/instruments.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/parafac.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/plotting.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/docs/quickstart.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/pyproject.toml +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/__main__.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/absorbance.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/campaigns.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/core/__init__.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/core/dataset.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/core/grid.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/core/history.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/_common.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/blank.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/crop.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/dilution.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/instrument.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/raman.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/scatter.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/spectral.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/corrections/zap.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/errors.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/__main__.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/campaigns_tab.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/common.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/export_tab.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/indices_tab.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/parafac_tab.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/project_tab.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/state.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/gui/theme.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/indices.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/__init__.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/_cary_csv.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/cary60.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/cary_eclipse.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/discover.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/instruments.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/loader.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/io/pairing.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/__init__.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/_cp.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/channels.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/compare.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/diagnostics.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/export.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/model.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/outliers.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/parafac/validation.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/plot.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/src/eemkit/report.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/conftest.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/README.md +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/aqualog/sample4.dat +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/eemR_DESCRIPTION.txt +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/fluoromax4/f1.dat +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/fluoromax4/f2.dat +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/fluoromax4/f3.dat +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/hitachi-f7000-fl/hitachi1.TXT +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/hitachi-f7000-fl/hitachi2.TXT +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/data/eemR/shimadzu/shimadzu.TXT +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_absorbance.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_campaigns.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_cary60.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_cary_eclipse.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_channels.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_dataset.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_dilution_zap.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_grid.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_indices.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_instruments.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_outliers_report.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_pairing.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_parafac.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_parafac_compare.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_plot.py +0 -0
- {eemkit-0.4.2 → eemkit-0.6.0}/tests/test_real_data.py +0 -0
|
@@ -3,6 +3,53 @@
|
|
|
3
3
|
All notable changes are listed here. Versions follow
|
|
4
4
|
[semantic versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## 0.6.0 (2026-11-30)
|
|
7
|
+
|
|
8
|
+
Fluorescence data without absorbance spectra. Projects that correct the
|
|
9
|
+
inner filter give the same results as in 0.5.0.
|
|
10
|
+
|
|
11
|
+
* **Data without absorbance spectra.** A fluorometer used on its own (e.g. a
|
|
12
|
+
Cary Eclipse without a UV-Vis spectrophotometer) gives no absorbance, and
|
|
13
|
+
until now the inner-filter step stopped the corrections. With
|
|
14
|
+
`inner_filter.apply = false` and a `skip_reason`, or in the application by
|
|
15
|
+
unticking `Correct with the absorbance spectra` and saying why, the step is
|
|
16
|
+
left out and the reason is recorded in the processing history, the
|
|
17
|
+
processing record and the report (new function
|
|
18
|
+
`corrections.skip_inner_filter`). A reason is required: the correction is
|
|
19
|
+
never left out silently. The fluorescence path length is then not needed.
|
|
20
|
+
`eemkit check` reports the choice. Projects that correct the inner filter
|
|
21
|
+
do not change.
|
|
22
|
+
|
|
23
|
+
## 0.5.0 (2026-11-26)
|
|
24
|
+
|
|
25
|
+
The application for macOS and Linux, and a logo. Results do not change.
|
|
26
|
+
|
|
27
|
+
* **Stand-alone application for Windows, macOS and Linux.** Each release now
|
|
28
|
+
has, besides the Windows zip, a build for Apple-silicon Macs
|
|
29
|
+
(`eemkit-vX.Y.Z-macos-arm64.zip`, with `eemkit.app`) and for Linux x86-64
|
|
30
|
+
(`eemkit-vX.Y.Z-linux-x86_64.tar.gz`, glibc 2.35 or newer, with
|
|
31
|
+
`install-desktop-entry.sh` to add it to the applications menu). Every build
|
|
32
|
+
is checked to start before it is attached to the release. The builds are
|
|
33
|
+
not signed: the [download guide](https://lowcostsensor.github.io/eemkit/download/)
|
|
34
|
+
explains how to open them the first time (SmartScreen on Windows, Gatekeeper
|
|
35
|
+
on macOS) and which Qt system libraries Linux may need.
|
|
36
|
+
* **Logo and application icon.** eemkit has a logo, the contour plot of a
|
|
37
|
+
fluorescence peak. It is the icon of the window, the taskbar (also when
|
|
38
|
+
started with `python -m eemkit.gui`), `eemkit.exe` and `eemkit.app`, and the
|
|
39
|
+
logo of the documentation. `packaging/icons/make_icons.py` draws it and
|
|
40
|
+
writes the `.ico`, `.icns` and PNG files.
|
|
41
|
+
* **Start-up screen.** While the application loads (a few seconds), a window
|
|
42
|
+
shows the logo, the version and the institutions that support eemkit:
|
|
43
|
+
Università degli Studi di Siena, Università degli Studi di Palermo and
|
|
44
|
+
National Biodiversity Future Center (Italy); they are also named in
|
|
45
|
+
*Help > About*. `EEMKIT_NO_SPLASH=1` starts without it.
|
|
46
|
+
* `import eemkit` no longer loads every subpackage at once: `eemkit.pipeline`,
|
|
47
|
+
`eemkit.stack` and the other names of the package load on first use (so the
|
|
48
|
+
start-up screen appears before numpy, pandas, xarray and scipy are loaded).
|
|
49
|
+
Code that uses them does not change.
|
|
50
|
+
* The release workflow checks that the release tag matches the version of the
|
|
51
|
+
package and can be run by hand to build the applications without a release.
|
|
52
|
+
|
|
6
53
|
## 0.4.2 (2026-11-25)
|
|
7
54
|
|
|
8
55
|
One fix in the application. Results do not change.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: eemkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Excitation-emission matrix (EEM) processing and PARAFAC modelling of dissolved organic matter fluorescence
|
|
5
5
|
Project-URL: Homepage, https://github.com/LowCostSensor/eemkit
|
|
6
6
|
Project-URL: Documentation, https://lowcostsensor.github.io/eemkit/
|
|
@@ -42,7 +42,7 @@ Provides-Extra: plot
|
|
|
42
42
|
Requires-Dist: matplotlib>=3.8; extra == 'plot'
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
|
|
45
|
-
# eemkit
|
|
45
|
+
# <img src="https://raw.githubusercontent.com/LowCostSensor/eemkit/main/docs/img/logo-256.png" alt="" width="48" align="left"> eemkit
|
|
46
46
|
|
|
47
47
|
[](https://github.com/LowCostSensor/eemkit/actions/workflows/tests.yml)
|
|
48
48
|
[](https://lowcostsensor.github.io/eemkit/)
|
|
@@ -106,7 +106,28 @@ step recorded so that an analysis can be repeated exactly.
|
|
|
106
106
|
full processing history; one settings file drives both scripts and the
|
|
107
107
|
application.
|
|
108
108
|
|
|
109
|
-
##
|
|
109
|
+
## Download the application (no Python needed)
|
|
110
|
+
|
|
111
|
+
Each [release](https://github.com/LowCostSensor/eemkit/releases/latest) has a
|
|
112
|
+
stand-alone build of the desktop application; download the file for your
|
|
113
|
+
system from the *Assets* list:
|
|
114
|
+
|
|
115
|
+
| System | File | Start |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| Windows 10 or 11, 64-bit | `eemkit-vX.Y.Z-windows.zip` | Unzip, double-click `eemkit.exe` |
|
|
118
|
+
| macOS, Apple silicon (M1 or later) | `eemkit-vX.Y.Z-macos-arm64.zip` | Unzip, move `eemkit.app` to *Applications* |
|
|
119
|
+
| Linux, x86-64 (glibc 2.35 or newer) | `eemkit-vX.Y.Z-linux-x86_64.tar.gz` | `tar -xzf`, run `eemkit/eemkit` |
|
|
120
|
+
|
|
121
|
+
The builds are not signed. **Windows** may show *Windows protected your PC*:
|
|
122
|
+
click *More info*, then *Run anyway*. **macOS** blocks the first start
|
|
123
|
+
(Gatekeeper): right-click `eemkit.app` and choose *Open*; on macOS 15 and later
|
|
124
|
+
open it once, then click *Open Anyway* in *System Settings > Privacy &
|
|
125
|
+
Security*. **Linux** needs a few Qt system libraries that desktops usually have
|
|
126
|
+
(on Debian or Ubuntu, if it does not start:
|
|
127
|
+
`sudo apt install libxcb-cursor0 libxkbcommon-x11-0 libegl1`). Details are in
|
|
128
|
+
the [download guide](https://lowcostsensor.github.io/eemkit/download/).
|
|
129
|
+
|
|
130
|
+
## Install with Python
|
|
110
131
|
|
|
111
132
|
You need Python 3.11 or later (on Windows, tick *Add python.exe to PATH* when
|
|
112
133
|
installing it). The `[gui]` part adds the desktop application and the
|
|
@@ -123,9 +144,7 @@ python -m eemkit.gui
|
|
|
123
144
|
```
|
|
124
145
|
|
|
125
146
|
For the library alone, leave out `[gui]` (or use `[plot]` for figures
|
|
126
|
-
without the application).
|
|
127
|
-
which needs no Python, is attached to each
|
|
128
|
-
[release](https://github.com/LowCostSensor/eemkit/releases).
|
|
147
|
+
without the application).
|
|
129
148
|
|
|
130
149
|
To update to the latest release:
|
|
131
150
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# eemkit
|
|
1
|
+
# <img src="https://raw.githubusercontent.com/LowCostSensor/eemkit/main/docs/img/logo-256.png" alt="" width="48" align="left"> eemkit
|
|
2
2
|
|
|
3
3
|
[](https://github.com/LowCostSensor/eemkit/actions/workflows/tests.yml)
|
|
4
4
|
[](https://lowcostsensor.github.io/eemkit/)
|
|
@@ -62,7 +62,28 @@ step recorded so that an analysis can be repeated exactly.
|
|
|
62
62
|
full processing history; one settings file drives both scripts and the
|
|
63
63
|
application.
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## Download the application (no Python needed)
|
|
66
|
+
|
|
67
|
+
Each [release](https://github.com/LowCostSensor/eemkit/releases/latest) has a
|
|
68
|
+
stand-alone build of the desktop application; download the file for your
|
|
69
|
+
system from the *Assets* list:
|
|
70
|
+
|
|
71
|
+
| System | File | Start |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| Windows 10 or 11, 64-bit | `eemkit-vX.Y.Z-windows.zip` | Unzip, double-click `eemkit.exe` |
|
|
74
|
+
| macOS, Apple silicon (M1 or later) | `eemkit-vX.Y.Z-macos-arm64.zip` | Unzip, move `eemkit.app` to *Applications* |
|
|
75
|
+
| Linux, x86-64 (glibc 2.35 or newer) | `eemkit-vX.Y.Z-linux-x86_64.tar.gz` | `tar -xzf`, run `eemkit/eemkit` |
|
|
76
|
+
|
|
77
|
+
The builds are not signed. **Windows** may show *Windows protected your PC*:
|
|
78
|
+
click *More info*, then *Run anyway*. **macOS** blocks the first start
|
|
79
|
+
(Gatekeeper): right-click `eemkit.app` and choose *Open*; on macOS 15 and later
|
|
80
|
+
open it once, then click *Open Anyway* in *System Settings > Privacy &
|
|
81
|
+
Security*. **Linux** needs a few Qt system libraries that desktops usually have
|
|
82
|
+
(on Debian or Ubuntu, if it does not start:
|
|
83
|
+
`sudo apt install libxcb-cursor0 libxkbcommon-x11-0 libegl1`). Details are in
|
|
84
|
+
the [download guide](https://lowcostsensor.github.io/eemkit/download/).
|
|
85
|
+
|
|
86
|
+
## Install with Python
|
|
66
87
|
|
|
67
88
|
You need Python 3.11 or later (on Windows, tick *Add python.exe to PATH* when
|
|
68
89
|
installing it). The `[gui]` part adds the desktop application and the
|
|
@@ -79,9 +100,7 @@ python -m eemkit.gui
|
|
|
79
100
|
```
|
|
80
101
|
|
|
81
102
|
For the library alone, leave out `[gui]` (or use `[plot]` for figures
|
|
82
|
-
without the application).
|
|
83
|
-
which needs no Python, is attached to each
|
|
84
|
-
[release](https://github.com/LowCostSensor/eemkit/releases).
|
|
103
|
+
without the application).
|
|
85
104
|
|
|
86
105
|
To update to the latest release:
|
|
87
106
|
|
|
@@ -140,7 +140,7 @@ Parameters on the left, preview on the right. The order of the steps is fixed: i
|
|
|
140
140
|
| Box | Contents | Ombrone |
|
|
141
141
|
| --- | --- | --- |
|
|
142
142
|
| `Instrument spectral correction` | Excitation and emission correction factor files of the instrument (optional, see [below](#instrument-spectral-correction)). Empty = not applied. | not applied |
|
|
143
|
-
| `Inner filter` | Path length of the two cuvettes in cm. **Required**, with no default: while they are empty (red) the corrections do not run. Kothawala et al. 2013. | 1 and 1 |
|
|
143
|
+
| `Inner filter` | Path length of the two cuvettes in cm. **Required**, with no default: while they are empty (red) the corrections do not run. Kothawala et al. 2013. Without absorbance spectra, untick `Correct with the absorbance spectra` and say why in `Why not corrected`: the reason is written in the processing record (see [Corrections](corrections.md#without-absorbance-spectra)). | 1 and 1 |
|
|
144
144
|
| `Raman units` | Excitation and emission range of the Raman area of the blank; optional baseline subtraction. Lawaetz & Stedmon 2009. | Ex 350, Em 381–426, no |
|
|
145
145
|
| `Scatter removal` | Water Raman shift and width (below/above, in nm) of the four bands: first- and second-order Rayleigh and Raman. `Zeros below Rayleigh` sets to zero the region where emission is below excitation minus the offset (Thygesen et al. 2004). `Interpolate removed bands`: `no` keeps the bands as missing data, as PARAFAC needs; `em`, `ex` or `both` interpolate them. | 3400 cm⁻¹; 10/10, 8/8, 12/12, 10/10; zeros at 10 nm; no |
|
|
146
146
|
| `Crop` | Excitation and emission limits to keep. Empty = no limit. | Ex ≥ 240 |
|
|
@@ -13,6 +13,7 @@ always passed explicitly.
|
|
|
13
13
|
| 2 | `subtract_absorbance_blank` | `absorbance - blank_absorbance` | |
|
|
14
14
|
| 2b | `match_absorbance_dilution` | diluted samples only: absorbance rescaled to the EEM's dilution | Beer–Lambert |
|
|
15
15
|
| 3 | `correct_inner_filter` | `F * 10**((A_ex + A_em) / 2)`, path lengths required | Kothawala et al. 2013; Lakowicz 2006 |
|
|
16
|
+
| 3* | `skip_inner_filter` | no absorbance spectra: nothing computed, the reason recorded ([below](#without-absorbance-spectra)) | |
|
|
16
17
|
| 4 | `subtract_blank` | `intensity - blank_intensity` | |
|
|
17
18
|
| 5 | `normalize_raman` | divides by the blank's water Raman area | Lawaetz & Stedmon 2009 |
|
|
18
19
|
| 5b | `correct_dilution` | diluted samples only: `intensity * dilution_factor` | staRdom `eem_dilution` |
|
|
@@ -32,6 +33,32 @@ Samples lacking an input (blank, absorbance) make a correction fail unless
|
|
|
32
33
|
`missing="keep"` (leave them uncorrected, flagged in a coordinate) or
|
|
33
34
|
`missing="drop"` is passed.
|
|
34
35
|
|
|
36
|
+
## Without absorbance spectra
|
|
37
|
+
|
|
38
|
+
A fluorometer used on its own (a Cary Eclipse without a UV-Vis
|
|
39
|
+
spectrophotometer, for example) gives no absorbance, so the inner filter
|
|
40
|
+
cannot be corrected. eemkit does not skip the step silently:
|
|
41
|
+
`skip_inner_filter(ds, reason=...)` takes its place in the order, changes
|
|
42
|
+
nothing and records the reason in the history (and so in
|
|
43
|
+
`processing_record.json` and the report); `ife_corrected` is False for every
|
|
44
|
+
sample. In a project file:
|
|
45
|
+
|
|
46
|
+
```toml
|
|
47
|
+
[inner_filter]
|
|
48
|
+
apply = false
|
|
49
|
+
skip_reason = "no absorbance measured; samples diluted to A254 < 0.05"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The fluorescence path length is then not needed; the absorbance one is
|
|
53
|
+
still needed if absorbance files are paired (for the CDOM metrics).
|
|
54
|
+
Uncorrected fluorescence is too low where the sample absorbs, and more so
|
|
55
|
+
for the most concentrated samples, which can distort PARAFAC scores and
|
|
56
|
+
components. The correction is commonly left out only for samples of low
|
|
57
|
+
absorbance or diluted to it (Kothawala et al. 2013); the reason should say
|
|
58
|
+
which. The pairing table still pairs each EEM with its water blank, needed
|
|
59
|
+
for the blank subtraction and the Raman units; the absorbance columns stay
|
|
60
|
+
empty.
|
|
61
|
+
|
|
35
62
|
## Spectral correction
|
|
36
63
|
|
|
37
64
|
`ds.attrs["spectral_correction"]` is `"none"` until
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Download the application
|
|
2
|
+
|
|
3
|
+
Each [release](https://github.com/LowCostSensor/eemkit/releases/latest) has a
|
|
4
|
+
stand-alone build of the desktop application for Windows, macOS and Linux. It
|
|
5
|
+
needs no Python: download the file for your system from the *Assets* list of
|
|
6
|
+
the release, unpack it and start the application. (To use eemkit from Python
|
|
7
|
+
scripts as well, install it with pip instead: see the
|
|
8
|
+
[quick start](quickstart.md) and [installation](gui.md).)
|
|
9
|
+
|
|
10
|
+
| System | File | Start |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| Windows 10 or 11, 64-bit | `eemkit-vX.Y.Z-windows.zip` | Unzip, then double-click `eemkit.exe` in the `eemkit` folder |
|
|
13
|
+
| macOS on Apple silicon (M1 or later) | `eemkit-vX.Y.Z-macos-arm64.zip` | Unzip, move `eemkit.app` to *Applications*, open it as below |
|
|
14
|
+
| Linux, x86-64 | `eemkit-vX.Y.Z-linux-x86_64.tar.gz` | `tar -xzf eemkit-*.tar.gz`, then `eemkit/eemkit` |
|
|
15
|
+
|
|
16
|
+
Each build is about 150–200 MB unpacked. Keep the files together: on Windows
|
|
17
|
+
and Linux the program (`eemkit.exe`, `eemkit`) needs the `_internal` folder
|
|
18
|
+
next to it. The licence texts of eemkit and of every bundled library
|
|
19
|
+
(`LICENSE.txt`, `LGPL-3.0.txt`, `THIRD-PARTY-NOTICES.txt`) are in the same
|
|
20
|
+
folder, or in `eemkit.app/Contents/Resources/licenses` on macOS.
|
|
21
|
+
|
|
22
|
+
To update, download the build of the new release and replace the old folder
|
|
23
|
+
(or `eemkit.app`). Projects and settings are not stored in it.
|
|
24
|
+
|
|
25
|
+
## Windows
|
|
26
|
+
|
|
27
|
+
The application is not signed with a code-signing certificate, so the first
|
|
28
|
+
time Windows may show *Windows protected your PC* (SmartScreen). Click
|
|
29
|
+
*More info*, then *Run anyway*. To have it in the Start menu, right-click
|
|
30
|
+
`eemkit.exe` and choose *Pin to Start* (or create a shortcut).
|
|
31
|
+
|
|
32
|
+
## macOS
|
|
33
|
+
|
|
34
|
+
The application is not signed with an Apple Developer ID nor notarised, so
|
|
35
|
+
Gatekeeper blocks it the first time ("Apple could not verify that eemkit is
|
|
36
|
+
free of malware", or "the developer cannot be verified"):
|
|
37
|
+
|
|
38
|
+
* **macOS 14 (Sonoma) and earlier:** in *Applications*, right-click (or
|
|
39
|
+
Control-click) `eemkit.app`, choose *Open*, then *Open* again in the dialog.
|
|
40
|
+
* **macOS 15 (Sequoia) and later:** double-click `eemkit.app` once and close the
|
|
41
|
+
message; then go to *System Settings > Privacy & Security*, scroll to
|
|
42
|
+
*Security*, click *Open Anyway* next to the message about eemkit, and confirm
|
|
43
|
+
with your password.
|
|
44
|
+
|
|
45
|
+
macOS remembers the choice: later the application opens with a double-click.
|
|
46
|
+
Alternatively, in Terminal:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
xattr -dr com.apple.quarantine /Applications/eemkit.app
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The build is for Apple silicon Macs (M1 and later). On an Intel Mac install
|
|
53
|
+
eemkit with pip (`python -m pip install "eemkit[gui]"`, then
|
|
54
|
+
`python -m eemkit.gui`).
|
|
55
|
+
|
|
56
|
+
## Linux
|
|
57
|
+
|
|
58
|
+
The build is made on Ubuntu 22.04 and runs on distributions with glibc 2.35 or
|
|
59
|
+
newer (Ubuntu 22.04, Debian 12, Fedora 36, or later). Qt needs a few system
|
|
60
|
+
libraries that a desktop installation usually has; if the application does not
|
|
61
|
+
start, install them:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Debian, Ubuntu and derivatives
|
|
65
|
+
sudo apt install libxcb-cursor0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-keysyms1 libxcb-shape0 libegl1
|
|
66
|
+
# Fedora
|
|
67
|
+
sudo dnf install xcb-util-cursor libxkbcommon-x11 xcb-util-wm xcb-util-keysyms
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`QT_DEBUG_PLUGINS=1 eemkit/eemkit` names the library that is missing. To add
|
|
71
|
+
eemkit to the applications menu (with its icon), run once, from the unpacked
|
|
72
|
+
folder:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
eemkit/install-desktop-entry.sh
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## If the application closes at start-up
|
|
79
|
+
|
|
80
|
+
The reason is written to `eemkit-crash.log` in the temporary folder
|
|
81
|
+
(`%TEMP%` on Windows, `$TMPDIR` on macOS, `/tmp` on Linux). Please attach it to
|
|
82
|
+
an [issue](https://github.com/LowCostSensor/eemkit/issues).
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# Desktop application
|
|
2
2
|
|
|
3
|
+
A stand-alone build for Windows, macOS and Linux, which needs no Python, can
|
|
4
|
+
be [downloaded](download.md) from each release. With Python:
|
|
5
|
+
|
|
3
6
|
```bash
|
|
4
7
|
python -m pip install "eemkit[gui]"
|
|
5
8
|
python -m eemkit.gui # optionally followed by a project.toml
|
|
6
9
|
```
|
|
7
10
|
|
|
8
11
|
The `eemkit-gui` command does the same as `python -m eemkit.gui` when Python's
|
|
9
|
-
`Scripts` folder is on the PATH.
|
|
12
|
+
`Scripts` folder is on the PATH. While it loads, a start-up screen shows the
|
|
13
|
+
logo, the version and the institutions that support eemkit (Università degli
|
|
14
|
+
Studi di Siena, Università degli Studi di Palermo, National Biodiversity
|
|
15
|
+
Future Center, Italy); set the environment variable `EEMKIT_NO_SPLASH=1` to
|
|
16
|
+
start without it.
|
|
10
17
|
|
|
11
18
|
The application is a front end to `eemkit.pipeline`: it does no processing
|
|
12
19
|
of its own. Its project file is the pipeline's settings TOML, so an analysis
|
|
@@ -90,3 +97,16 @@ on the PATH. On Windows use a short `--distpath` (Qt plugin paths exceed the
|
|
|
90
97
|
260-character limit in deep folders). The Windows build is about 160 MB. If the
|
|
91
98
|
application closes at start-up, the reason is written to `eemkit-crash.log`
|
|
92
99
|
in the temporary folder.
|
|
100
|
+
|
|
101
|
+
Build on each system for that system. The result is `dist/eemkit` (with
|
|
102
|
+
`eemkit.exe` or `eemkit`) on Windows and Linux, and `dist/eemkit.app` on macOS
|
|
103
|
+
(signed ad hoc, without an Apple identity). The release workflow
|
|
104
|
+
(`.github/workflows/release.yml`) does the same on GitHub for Windows, macOS
|
|
105
|
+
on Apple silicon and Linux, checks that each build starts, and attaches the
|
|
106
|
+
archives to the release; run it by hand from the *Actions* tab to build them
|
|
107
|
+
without a release.
|
|
108
|
+
|
|
109
|
+
The icons (`eemkit.ico`, `eemkit.icns`, PNGs) are in `packaging/icons`, made
|
|
110
|
+
from the logo by `python packaging/icons/make_icons.py` (needs Pillow), which
|
|
111
|
+
also writes the window icons in `src/eemkit/gui/icons` and the logo in
|
|
112
|
+
`docs/img`.
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<title>eemkit</title>
|
|
3
|
+
<rect width="64" height="64" rx="14" fill="#14243d"/>
|
|
4
|
+
<g transform="rotate(-35 32 32)">
|
|
5
|
+
<ellipse cx="32" cy="32" rx="26" ry="15" fill="#2a6fb8"/>
|
|
6
|
+
<ellipse cx="34" cy="32" rx="18" ry="10.5" fill="#22a39a"/>
|
|
7
|
+
<ellipse cx="36" cy="32" rx="10.5" ry="6.5" fill="#9bd645"/>
|
|
8
|
+
<ellipse cx="37" cy="32" rx="4.5" ry="3" fill="#fde34a"/>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -7,6 +7,9 @@ step recorded so that an analysis can be repeated exactly.
|
|
|
7
7
|
|
|
8
8
|

|
|
9
9
|
|
|
10
|
+
The desktop application can be [downloaded](download.md) for Windows, macOS
|
|
11
|
+
and Linux and needs no Python.
|
|
12
|
+
|
|
10
13
|
## Principles
|
|
11
14
|
|
|
12
15
|
* **Nothing silent.** Samples, blanks and absorbance spectra are paired in an
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""eemkit: EEM processing and PARAFAC modelling of dissolved organic matter fluorescence."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.6.0"
|
|
4
|
+
|
|
5
|
+
import importlib
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from eemkit.errors import (
|
|
9
|
+
Cancelled,
|
|
10
|
+
CorrectionError,
|
|
11
|
+
EEMKitError,
|
|
12
|
+
EEMKitWarning,
|
|
13
|
+
FileFormatError,
|
|
14
|
+
GridError,
|
|
15
|
+
PairingError,
|
|
16
|
+
SettingsError,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
#: Subpackages and functions available as ``eemkit.<name>``. They are imported on
|
|
20
|
+
#: first use (PEP 562), so that ``import eemkit.gui`` can show the start-up screen
|
|
21
|
+
#: before numpy, pandas, xarray and scipy are loaded.
|
|
22
|
+
_SUBMODULES = ("corrections", "indices", "parafac", "pipeline")
|
|
23
|
+
_FUNCTIONS = {
|
|
24
|
+
"stack": "eemkit.core.dataset",
|
|
25
|
+
"infer_common_grid": "eemkit.core.grid",
|
|
26
|
+
"regular_grid": "eemkit.core.grid",
|
|
27
|
+
"resample": "eemkit.core.grid",
|
|
28
|
+
"get_history": "eemkit.core.history",
|
|
29
|
+
"mean_cycles": "eemkit.io.cary60",
|
|
30
|
+
"read_cary60": "eemkit.io.cary60",
|
|
31
|
+
"read_cary_eclipse": "eemkit.io.cary_eclipse",
|
|
32
|
+
"scan_folder": "eemkit.io.discover",
|
|
33
|
+
"suggest_pairing": "eemkit.io.discover",
|
|
34
|
+
"load_dataset": "eemkit.io.loader",
|
|
35
|
+
"read_pairing": "eemkit.io.pairing",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __getattr__(name: str):
|
|
40
|
+
if name in _SUBMODULES:
|
|
41
|
+
value = importlib.import_module(f"eemkit.{name}")
|
|
42
|
+
elif name in _FUNCTIONS:
|
|
43
|
+
value = getattr(importlib.import_module(_FUNCTIONS[name]), name)
|
|
44
|
+
else:
|
|
45
|
+
raise AttributeError(f"module 'eemkit' has no attribute {name!r}")
|
|
46
|
+
globals()[name] = value
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def __dir__() -> list[str]:
|
|
51
|
+
return sorted(set(globals()) | set(__all__))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if TYPE_CHECKING: # the same names, for type checkers and editors
|
|
55
|
+
from eemkit import corrections, indices, parafac, pipeline
|
|
56
|
+
from eemkit.core.dataset import stack
|
|
57
|
+
from eemkit.core.grid import infer_common_grid, regular_grid, resample
|
|
58
|
+
from eemkit.core.history import get_history
|
|
59
|
+
from eemkit.io.cary60 import mean_cycles, read_cary60
|
|
60
|
+
from eemkit.io.cary_eclipse import read_cary_eclipse
|
|
61
|
+
from eemkit.io.discover import scan_folder, suggest_pairing
|
|
62
|
+
from eemkit.io.loader import load_dataset
|
|
63
|
+
from eemkit.io.pairing import read_pairing
|
|
64
|
+
|
|
65
|
+
__all__ = [
|
|
66
|
+
"Cancelled",
|
|
67
|
+
"CorrectionError",
|
|
68
|
+
"EEMKitError",
|
|
69
|
+
"EEMKitWarning",
|
|
70
|
+
"FileFormatError",
|
|
71
|
+
"GridError",
|
|
72
|
+
"PairingError",
|
|
73
|
+
"SettingsError",
|
|
74
|
+
"__version__",
|
|
75
|
+
"corrections",
|
|
76
|
+
"get_history",
|
|
77
|
+
"indices",
|
|
78
|
+
"infer_common_grid",
|
|
79
|
+
"load_dataset",
|
|
80
|
+
"mean_cycles",
|
|
81
|
+
"parafac",
|
|
82
|
+
"pipeline",
|
|
83
|
+
"read_cary60",
|
|
84
|
+
"read_cary_eclipse",
|
|
85
|
+
"read_pairing",
|
|
86
|
+
"regular_grid",
|
|
87
|
+
"resample",
|
|
88
|
+
"scan_folder",
|
|
89
|
+
"stack",
|
|
90
|
+
"suggest_pairing",
|
|
91
|
+
]
|
|
@@ -81,6 +81,7 @@ def check(args: argparse.Namespace) -> int:
|
|
|
81
81
|
settings, base = _project(args.project)
|
|
82
82
|
problems: list[str] = []
|
|
83
83
|
notes: list[str] = []
|
|
84
|
+
table = None
|
|
84
85
|
proj = settings["project"]
|
|
85
86
|
for key in ("data_root", "pairing"):
|
|
86
87
|
if not proj.get(key):
|
|
@@ -106,7 +107,19 @@ def check(args: argparse.Namespace) -> int:
|
|
|
106
107
|
notes.append(f"pairing table: {len(table)} rows, {n_in} included")
|
|
107
108
|
if n_in == 0:
|
|
108
109
|
problems.append("no row of the pairing table is included")
|
|
109
|
-
|
|
110
|
+
try:
|
|
111
|
+
skip = pipeline.inner_filter_skip_reason(settings)
|
|
112
|
+
except EEMKitError as e:
|
|
113
|
+
problems.append(str(e))
|
|
114
|
+
skip = ""
|
|
115
|
+
keys = ["absorbance_path_length_cm", "fluorescence_path_length_cm"]
|
|
116
|
+
if skip is not None:
|
|
117
|
+
if skip:
|
|
118
|
+
notes.append(f"inner filter: not corrected ({skip})")
|
|
119
|
+
paired_abs = table is not None and bool((table.loc[table["include"], "abs_file"]
|
|
120
|
+
!= "").any())
|
|
121
|
+
keys = ["absorbance_path_length_cm"] if paired_abs else []
|
|
122
|
+
for key in keys:
|
|
110
123
|
if settings["inner_filter"].get(key) in (None, ""):
|
|
111
124
|
problems.append(f"inner_filter.{key} is not set (it depends on your cuvettes)")
|
|
112
125
|
try:
|
|
@@ -4,7 +4,8 @@ Recommended order (each function refuses to run after a step that must follow it
|
|
|
4
4
|
|
|
5
5
|
1. :func:`apply_spectral_correction` (instrument response; optional)
|
|
6
6
|
2. :func:`subtract_absorbance_blank`
|
|
7
|
-
3. :func:`correct_inner_filter`
|
|
7
|
+
3. :func:`correct_inner_filter` (or :func:`skip_inner_filter`, with the reason, when
|
|
8
|
+
there are no absorbance spectra)
|
|
8
9
|
4. :func:`subtract_blank`
|
|
9
10
|
5. :func:`normalize_raman`, then :func:`correct_dilution` (diluted samples) and
|
|
10
11
|
:func:`zap` (regions removed by hand)
|
|
@@ -17,7 +18,7 @@ With diluted samples, :func:`match_absorbance_dilution` goes between steps 2 and
|
|
|
17
18
|
from eemkit.corrections.blank import subtract_absorbance_blank, subtract_blank
|
|
18
19
|
from eemkit.corrections.crop import crop
|
|
19
20
|
from eemkit.corrections.dilution import correct_dilution, match_absorbance_dilution
|
|
20
|
-
from eemkit.corrections.inner_filter import correct_inner_filter
|
|
21
|
+
from eemkit.corrections.inner_filter import correct_inner_filter, skip_inner_filter
|
|
21
22
|
from eemkit.corrections.raman import normalize_raman, raman_area
|
|
22
23
|
from eemkit.corrections.scatter import (
|
|
23
24
|
interpolate_missing,
|
|
@@ -45,6 +46,7 @@ __all__ = [
|
|
|
45
46
|
"read_correction_file",
|
|
46
47
|
"remove_scatter",
|
|
47
48
|
"scatter_mask",
|
|
49
|
+
"skip_inner_filter",
|
|
48
50
|
"spectral_correction_status",
|
|
49
51
|
"subtract_absorbance_blank",
|
|
50
52
|
"subtract_blank",
|
|
@@ -31,6 +31,8 @@ from eemkit.corrections._common import (
|
|
|
31
31
|
from eemkit.errors import CorrectionError, EEMKitWarning
|
|
32
32
|
|
|
33
33
|
KOTHAWALA_MAX_A254 = 1.5
|
|
34
|
+
#: History step written when the correction is deliberately not applied.
|
|
35
|
+
SKIP_STEP = "skip_inner_filter"
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
def correct_inner_filter(
|
|
@@ -65,6 +67,7 @@ def correct_inner_filter(
|
|
|
65
67
|
step = "correct_inner_filter"
|
|
66
68
|
require_vars(ds, "intensity", "absorbance", step=step)
|
|
67
69
|
require_not_done(ds, step)
|
|
70
|
+
require_not_done(ds, SKIP_STEP)
|
|
68
71
|
# The water Raman signal inside the sample is attenuated like the DOM
|
|
69
72
|
# fluorescence, so IFE must be corrected before the blank is subtracted.
|
|
70
73
|
for later in ("subtract_blank", "normalize_raman", "remove_scatter"):
|
|
@@ -110,6 +113,35 @@ def correct_inner_filter(
|
|
|
110
113
|
)
|
|
111
114
|
|
|
112
115
|
|
|
116
|
+
def skip_inner_filter(ds: xr.Dataset, *, reason: str) -> xr.Dataset:
|
|
117
|
+
"""Record that the inner-filter correction is not applied, and why.
|
|
118
|
+
|
|
119
|
+
For data without absorbance spectra, e.g. from a fluorometer used on its
|
|
120
|
+
own. The intensities are not changed: the step only writes a history entry
|
|
121
|
+
with ``reason`` (so the processing record says the correction is missing),
|
|
122
|
+
sets ``ife_corrected`` to False for every sample and prevents a later
|
|
123
|
+
:func:`correct_inner_filter`. Without the correction, fluorescence is
|
|
124
|
+
underestimated where the sample absorbs; it is commonly neglected only for
|
|
125
|
+
samples of low absorbance or diluted to it (Kothawala et al. 2013), which
|
|
126
|
+
is what ``reason`` should state.
|
|
127
|
+
"""
|
|
128
|
+
step = SKIP_STEP
|
|
129
|
+
require_vars(ds, "intensity", step=step)
|
|
130
|
+
require_not_done(ds, step)
|
|
131
|
+
require_not_done(ds, "correct_inner_filter")
|
|
132
|
+
for later in ("subtract_blank", "normalize_raman", "remove_scatter"):
|
|
133
|
+
require_not_after(ds, step, later, allow_instrument=later == "subtract_blank")
|
|
134
|
+
reason = str(reason or "").strip()
|
|
135
|
+
if not reason:
|
|
136
|
+
raise CorrectionError(f"{step}: give the reason why the inner-filter correction is not "
|
|
137
|
+
"applied (it is written in the processing record)")
|
|
138
|
+
flags = xr.DataArray(np.zeros(ds.sizes[SAMPLE_DIM], dtype=bool), dims=SAMPLE_DIM)
|
|
139
|
+
out = ds.assign_coords(ife_corrected=flags)
|
|
140
|
+
n_abs = int(has_data(ds["absorbance"]).sum()) if "absorbance" in ds else 0
|
|
141
|
+
return with_history(out, step, reason=reason, n_samples=int(ds.sizes[SAMPLE_DIM]),
|
|
142
|
+
n_with_absorbance=n_abs)
|
|
143
|
+
|
|
144
|
+
|
|
113
145
|
def _at(a: xr.DataArray, wavelengths: xr.DataArray) -> xr.DataArray:
|
|
114
146
|
"""Absorbance at the given wavelengths, linear interpolation, renamed to their dim."""
|
|
115
147
|
dim = wavelengths.dims[0]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Desktop application for eemkit (requires ``pip install eemkit[gui]``).
|
|
2
|
+
|
|
3
|
+
Start it with ``eemkit-gui [project.toml]`` or ``python -m eemkit.gui``.
|
|
4
|
+
The application is a front end to :mod:`eemkit.pipeline`: all processing
|
|
5
|
+
is done by the library, and the project file it saves is the same settings
|
|
6
|
+
TOML that scripts can run.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
import sys
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
#: PNG renderings of the logo (made by packaging/icons/make_icons.py).
|
|
16
|
+
ICON_DIR = Path(__file__).resolve().parent / "icons"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def app_icon():
|
|
20
|
+
"""The eemkit logo as a QIcon, with one image per size so that small icons stay sharp."""
|
|
21
|
+
from PySide6.QtGui import QIcon
|
|
22
|
+
|
|
23
|
+
icon = QIcon()
|
|
24
|
+
for png in sorted(ICON_DIR.glob("eemkit-*.png")):
|
|
25
|
+
icon.addFile(str(png))
|
|
26
|
+
return icon
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _windows_taskbar_id() -> None:
|
|
30
|
+
"""Give the process its own taskbar identity on Windows.
|
|
31
|
+
|
|
32
|
+
Started with ``python -m eemkit.gui``, the window would otherwise be grouped
|
|
33
|
+
under python.exe and show the Python icon in the taskbar.
|
|
34
|
+
"""
|
|
35
|
+
if sys.platform == "win32":
|
|
36
|
+
try:
|
|
37
|
+
import ctypes
|
|
38
|
+
|
|
39
|
+
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("eemkit.gui")
|
|
40
|
+
except (AttributeError, OSError): # pragma: no cover
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def main(argv: list[str] | None = None) -> int:
|
|
45
|
+
try:
|
|
46
|
+
from PySide6.QtWidgets import QApplication
|
|
47
|
+
except ImportError as exc: # pragma: no cover
|
|
48
|
+
print(f"The eemkit desktop application needs PySide6 (pip install eemkit[gui]): {exc}",
|
|
49
|
+
file=sys.stderr)
|
|
50
|
+
return 1
|
|
51
|
+
from eemkit.gui import theme
|
|
52
|
+
|
|
53
|
+
argv = sys.argv if argv is None else argv
|
|
54
|
+
_windows_taskbar_id()
|
|
55
|
+
app = QApplication.instance() or QApplication(argv)
|
|
56
|
+
app.setApplicationName("eemkit")
|
|
57
|
+
app.setDesktopFileName("eemkit") # Linux (Wayland): matches eemkit.desktop
|
|
58
|
+
icon = app_icon()
|
|
59
|
+
app.setWindowIcon(icon)
|
|
60
|
+
splash = None
|
|
61
|
+
if not os.environ.get("EEMKIT_NO_SPLASH"):
|
|
62
|
+
from eemkit.gui import splash as start_screen
|
|
63
|
+
|
|
64
|
+
splash = start_screen.show_splash()
|
|
65
|
+
# The main window loads numpy, pandas, xarray, scipy and matplotlib: the slow part.
|
|
66
|
+
from eemkit.gui.main_window import MainWindow
|
|
67
|
+
|
|
68
|
+
theme.apply_theme(app, theme.saved_theme())
|
|
69
|
+
window = MainWindow(argv[1] if len(argv) > 1 else None)
|
|
70
|
+
window.setWindowIcon(icon)
|
|
71
|
+
window.show()
|
|
72
|
+
if splash is not None:
|
|
73
|
+
start_screen.close_splash(splash, window)
|
|
74
|
+
return app.exec()
|