racer-raman 0.1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jason W. Yu and Doeke R. Hekstra
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,79 @@
1
+ Metadata-Version: 2.4
2
+ Name: racer-raman
3
+ Version: 0.1.0
4
+ Summary: Readout-aware empirical-Bayes correction of cosmic rays in detector images and spectra
5
+ Author: Jason W. Yu, Doeke R. Hekstra
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/JasonYu1/racer-raman
8
+ Project-URL: Repository, https://github.com/JasonYu1/racer-raman
9
+ Project-URL: Issues, https://github.com/JasonYu1/racer-raman/issues
10
+ Keywords: raman,spectroscopy,cosmic ray,despiking,ccd,empirical bayes
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
20
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
21
+ Classifier: Topic :: Scientific/Engineering :: Physics
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: numpy>=1.24
26
+ Requires-Dist: scipy>=1.10
27
+ Provides-Extra: io
28
+ Requires-Dist: pandas>=2.0; extra == "io"
29
+ Requires-Dist: zarr<3,>=2.15; extra == "io"
30
+ Provides-Extra: demos
31
+ Requires-Dist: jupyter>=1.0; extra == "demos"
32
+ Requires-Dist: matplotlib>=3.7; extra == "demos"
33
+ Requires-Dist: pandas>=2.0; extra == "demos"
34
+ Requires-Dist: zarr<3,>=2.15; extra == "demos"
35
+ Dynamic: license-file
36
+
37
+ # RACER
38
+
39
+ Readout-aware cosmic-ray event removal for Raman spectroscopy.
40
+
41
+ Two methods, one per detector readout mode:
42
+
43
+ - **RACER-2D** corrects two-dimensional detector frames. It tests each pixel
44
+ against the calibrated optical row profile, so a particle is separated from
45
+ Raman signal by where its charge sits across the detector rows.
46
+ - **RACER-1D** corrects row-summed (full vertical binning) spectra, where the
47
+ row coordinate has been summed away. It relies instead on measured charge
48
+ distributions and local spectral structure, switching between an
49
+ empirical-Bayes branch and a masked-baseline branch on bright bands.
50
+
51
+ Install from the repository root with `pip install -e .`.
52
+
53
+ ```python
54
+ from racer_raman import ImageCalibrator, SpectrumCalibrator
55
+ ```
56
+
57
+ ## Workflow
58
+
59
+ 1. Supply matching closed-shutter and open-shutter calibration acquisitions.
60
+ The image path also requires a per-pixel instrumental background map
61
+ (`instrument_background_adu`), fitted separately over an open-shutter
62
+ exposure series; the calibration performs no exposure-series fit of its
63
+ own and will not run without it.
64
+ 2. Fit an image or spectrum calibrator.
65
+ 3. Pass it one or more raw measurements.
66
+ 4. Receive corrected output when an event is detected, or an unchanged copy when no correction is needed.
67
+
68
+ Calibration and measurement data must use the same exposure, detector readout, binning, gain, and region of interest.
69
+
70
+ ## Examples
71
+
72
+ - [RACER-2D, image readout](https://github.com/JasonYu1/racer-raman/blob/main/notebooks/racer-2d.ipynb)
73
+ - [RACER-1D, batch row-summed spectra](https://github.com/JasonYu1/racer-raman/blob/main/notebooks/racer-1d.ipynb)
74
+
75
+ Measured closed-shutter and polystyrene Zarr data are included under [data](https://github.com/JasonYu1/racer-raman/tree/main/data).
76
+
77
+ ## License
78
+
79
+ MIT. See [LICENSE](https://github.com/JasonYu1/racer-raman/blob/main/LICENSE).
@@ -0,0 +1,43 @@
1
+ # RACER
2
+
3
+ Readout-aware cosmic-ray event removal for Raman spectroscopy.
4
+
5
+ Two methods, one per detector readout mode:
6
+
7
+ - **RACER-2D** corrects two-dimensional detector frames. It tests each pixel
8
+ against the calibrated optical row profile, so a particle is separated from
9
+ Raman signal by where its charge sits across the detector rows.
10
+ - **RACER-1D** corrects row-summed (full vertical binning) spectra, where the
11
+ row coordinate has been summed away. It relies instead on measured charge
12
+ distributions and local spectral structure, switching between an
13
+ empirical-Bayes branch and a masked-baseline branch on bright bands.
14
+
15
+ Install from the repository root with `pip install -e .`.
16
+
17
+ ```python
18
+ from racer_raman import ImageCalibrator, SpectrumCalibrator
19
+ ```
20
+
21
+ ## Workflow
22
+
23
+ 1. Supply matching closed-shutter and open-shutter calibration acquisitions.
24
+ The image path also requires a per-pixel instrumental background map
25
+ (`instrument_background_adu`), fitted separately over an open-shutter
26
+ exposure series; the calibration performs no exposure-series fit of its
27
+ own and will not run without it.
28
+ 2. Fit an image or spectrum calibrator.
29
+ 3. Pass it one or more raw measurements.
30
+ 4. Receive corrected output when an event is detected, or an unchanged copy when no correction is needed.
31
+
32
+ Calibration and measurement data must use the same exposure, detector readout, binning, gain, and region of interest.
33
+
34
+ ## Examples
35
+
36
+ - [RACER-2D, image readout](https://github.com/JasonYu1/racer-raman/blob/main/notebooks/racer-2d.ipynb)
37
+ - [RACER-1D, batch row-summed spectra](https://github.com/JasonYu1/racer-raman/blob/main/notebooks/racer-1d.ipynb)
38
+
39
+ Measured closed-shutter and polystyrene Zarr data are included under [data](https://github.com/JasonYu1/racer-raman/tree/main/data).
40
+
41
+ ## License
42
+
43
+ MIT. See [LICENSE](https://github.com/JasonYu1/racer-raman/blob/main/LICENSE).
@@ -0,0 +1,61 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "racer-raman"
7
+ version = "0.1.0"
8
+ description = "Readout-aware empirical-Bayes correction of cosmic rays in detector images and spectra"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.10"
13
+ authors = [
14
+ {name = "Jason W. Yu"},
15
+ {name = "Doeke R. Hekstra"},
16
+ ]
17
+ keywords = [
18
+ "raman",
19
+ "spectroscopy",
20
+ "cosmic ray",
21
+ "despiking",
22
+ "ccd",
23
+ "empirical bayes",
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 4 - Beta",
27
+ "Intended Audience :: Science/Research",
28
+ "Operating System :: OS Independent",
29
+ "Programming Language :: Python :: 3",
30
+ "Programming Language :: Python :: 3.10",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Programming Language :: Python :: 3.12",
33
+ "Programming Language :: Python :: 3.13",
34
+ "Topic :: Scientific/Engineering :: Chemistry",
35
+ "Topic :: Scientific/Engineering :: Image Processing",
36
+ "Topic :: Scientific/Engineering :: Physics",
37
+ ]
38
+ dependencies = [
39
+ "numpy>=1.24",
40
+ "scipy>=1.10",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/JasonYu1/racer-raman"
45
+ Repository = "https://github.com/JasonYu1/racer-raman"
46
+ Issues = "https://github.com/JasonYu1/racer-raman/issues"
47
+
48
+ [project.optional-dependencies]
49
+ io = [
50
+ "pandas>=2.0",
51
+ "zarr>=2.15,<3",
52
+ ]
53
+ demos = [
54
+ "jupyter>=1.0",
55
+ "matplotlib>=3.7",
56
+ "pandas>=2.0",
57
+ "zarr>=2.15,<3",
58
+ ]
59
+
60
+ [tool.setuptools.packages.find]
61
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,54 @@
1
+ """Readout-aware cosmic-ray correction for spectroscopic measurements."""
2
+
3
+ from .calibration import (
4
+ ImageCalibration,
5
+ SpectrumDarkCalibration,
6
+ TemporalStatistics,
7
+ calibrate_image,
8
+ calibrate_spectrum_dark,
9
+ calibrate_spectrum_reference,
10
+ estimate_temporal_statistics,
11
+ )
12
+ from .image import (
13
+ ImageConfig,
14
+ ImageModel,
15
+ ParticlePrior,
16
+ build_image_model,
17
+ clean_image,
18
+ )
19
+ from .spectrum import (
20
+ BayesianSpectrumConfig,
21
+ HybridSpectrumConfig,
22
+ MaskedBaselineConfig,
23
+ SpectrumCalibration,
24
+ build_spectrum_calibration,
25
+ clean_spectrum,
26
+ )
27
+ from .workflow import CorrectionInfo, ImageCalibrator, SpectrumCalibrator
28
+ from .zarr_io import read_image_zarr, read_spectrum_zarr
29
+
30
+ __all__ = [
31
+ "BayesianSpectrumConfig",
32
+ "CorrectionInfo",
33
+ "HybridSpectrumConfig",
34
+ "ImageCalibration",
35
+ "ImageCalibrator",
36
+ "ImageConfig",
37
+ "ImageModel",
38
+ "MaskedBaselineConfig",
39
+ "ParticlePrior",
40
+ "SpectrumCalibration",
41
+ "SpectrumCalibrator",
42
+ "SpectrumDarkCalibration",
43
+ "TemporalStatistics",
44
+ "build_image_model",
45
+ "build_spectrum_calibration",
46
+ "calibrate_image",
47
+ "calibrate_spectrum_dark",
48
+ "calibrate_spectrum_reference",
49
+ "clean_image",
50
+ "clean_spectrum",
51
+ "estimate_temporal_statistics",
52
+ "read_image_zarr",
53
+ "read_spectrum_zarr",
54
+ ]