daplis 1.1.1__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.
Files changed (42) hide show
  1. daplis-1.1.1/LICENSE +21 -0
  2. daplis-1.1.1/MANIFEST.in +2 -0
  3. daplis-1.1.1/PKG-INFO +164 -0
  4. daplis-1.1.1/README.md +138 -0
  5. daplis-1.1.1/pyproject.toml +41 -0
  6. daplis-1.1.1/setup.cfg +4 -0
  7. daplis-1.1.1/src/daplis/__init__.py +0 -0
  8. daplis-1.1.1/src/daplis/functions/__init__.py +0 -0
  9. daplis-1.1.1/src/daplis/functions/calc_diff.py +399 -0
  10. daplis-1.1.1/src/daplis/functions/calibrate.py +807 -0
  11. daplis-1.1.1/src/daplis/functions/compact_share.py +514 -0
  12. daplis-1.1.1/src/daplis/functions/cross_talk.py +1460 -0
  13. daplis-1.1.1/src/daplis/functions/data_quality.py +843 -0
  14. daplis-1.1.1/src/daplis/functions/delta_t.py +2458 -0
  15. daplis-1.1.1/src/daplis/functions/fits.py +1311 -0
  16. daplis-1.1.1/src/daplis/functions/mp_analysis.py +583 -0
  17. daplis-1.1.1/src/daplis/functions/sensor_plot.py +995 -0
  18. daplis-1.1.1/src/daplis/functions/unpack.py +414 -0
  19. daplis-1.1.1/src/daplis/functions/utils.py +413 -0
  20. daplis-1.1.1/src/daplis/params/__init__.py +0 -0
  21. daplis-1.1.1/src/daplis/params/calibration_data/TDC_A5_#36_2212b.csv +257 -0
  22. daplis-1.1.1/src/daplis/params/calibration_data/TDC_B7d_#28_2212b.csv +257 -0
  23. daplis-1.1.1/src/daplis/params/calibration_data/TDC_B7d_#28_2212s.csv +257 -0
  24. daplis-1.1.1/src/daplis/params/calibration_data/TDC_D2b_#4_2212s.csv +257 -0
  25. daplis-1.1.1/src/daplis/params/calibration_data/TDC_NL11_#21_2212b.csv +257 -0
  26. daplis-1.1.1/src/daplis/params/calibration_data/TDC_NL11_#21_2212s.csv +257 -0
  27. daplis-1.1.1/src/daplis/params/calibration_data/TDC_NL11_#33_2212b.csv +257 -0
  28. daplis-1.1.1/src/daplis/params/calibration_data/TDC_NL11_#33_2212s.csv +257 -0
  29. daplis-1.1.1/src/daplis/params/masks/mask_A5_#36.txt +9 -0
  30. daplis-1.1.1/src/daplis/params/masks/mask_B7d_#28.txt +8 -0
  31. daplis-1.1.1/src/daplis/params/masks/mask_D2b_#4.txt +10 -0
  32. daplis-1.1.1/src/daplis/params/masks/mask_NL11_#21.txt +8 -0
  33. daplis-1.1.1/src/daplis/params/masks/mask_NL11_#33.txt +11 -0
  34. daplis-1.1.1/src/daplis.egg-info/PKG-INFO +164 -0
  35. daplis-1.1.1/src/daplis.egg-info/SOURCES.txt +40 -0
  36. daplis-1.1.1/src/daplis.egg-info/dependency_links.txt +1 -0
  37. daplis-1.1.1/src/daplis.egg-info/requires.txt +8 -0
  38. daplis-1.1.1/src/daplis.egg-info/top_level.txt +1 -0
  39. daplis-1.1.1/tests/test_cross_talk.py +139 -0
  40. daplis-1.1.1/tests/test_delta_t.py +325 -0
  41. daplis-1.1.1/tests/test_plot_tmsp.py +79 -0
  42. daplis-1.1.1/tests/test_unpack.py +36 -0
daplis-1.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Sergei Kulkov
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 all
13
+ 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,2 @@
1
+ include src/daplis/params/masks/*.txt
2
+ include src/daplis/params/calibration_data/*.csv
daplis-1.1.1/PKG-INFO ADDED
@@ -0,0 +1,164 @@
1
+ Metadata-Version: 2.2
2
+ Name: daplis
3
+ Version: 1.1.1
4
+ Summary: Data Analysis Package for LInoSpad
5
+ Author-email: Sergei Kulkov <sergei.kulkov23@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/rngKomorebi/daplis
8
+ Keywords: timestamp,analysis,LinoSPAD2
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: lmfit>=0.9.1
19
+ Requires-Dist: matplotlib>=3.5.0
20
+ Requires-Dist: numpy>=1.22.4
21
+ Requires-Dist: pandas>=1.4.0
22
+ Requires-Dist: pyarrow>=17.0.0
23
+ Requires-Dist: scipy>=1.7.0
24
+ Requires-Dist: seaborn>=0.9.0
25
+ Requires-Dist: tqdm>=4.67.0
26
+
27
+ ## Data Analysis Package for LInoSpad (DAPLIS)
28
+
29
+ Package for unpacking and analyzing the binary data from the timestamping mode of the LinoSPAD2 detector.
30
+
31
+ ![Tests](https://github.com/rngKomorebi/LinoSPAD2/actions/workflows/tests.yml/badge.svg)
32
+ ![Documentation](https://github.com/rngKomorebi/LinoSPAD2/actions/workflows/documentation.yml/badge.svg)
33
+ ![PyPI - Version](https://img.shields.io/pypi/v/daplis)
34
+ ![PyPI - License](https://img.shields.io/pypi/l/daplis)
35
+
36
+ ## Introduction
37
+
38
+ This package was written for data analysis for LinoSPAD2, mainly for
39
+ analysis of the timestamp output. The key functions are ones for
40
+ unpacking the binary output of the detector that utilizes the numpy
41
+ Python library for quick unpacking of .dat files to matrices,
42
+ dictionaries, or data frames.
43
+
44
+ This library greatly streamlines working with raw timestamps from
45
+ the LinoSPAD2 camera. With this package, one can analyze dark current
46
+ rate, cross-talk probability, plot sensor population, and analyze the
47
+ raw data to look for photon coincidences.
48
+
49
+ ## Structure of the package
50
+
51
+ The "functions" folder holds all functions from unpacking to plotting
52
+ numerous types of graphs (pixel population, histograms of timestamp
53
+ differences, etc.)
54
+
55
+ The "params" folder holds masks (used to mask some of the noisiest
56
+ pixels) and calibration data (compensating for TDC nonlinearities and
57
+ offset) for LinoSPAD2 daughterboards.
58
+
59
+ The "archive" folder is a collection of scripts for debugging, tests,
60
+ older versions of functions, etc.
61
+
62
+ The "examples" folder contains a few jupyter notebooks with examples
63
+ on how to use the main functions, showcasing how to work with the
64
+ most important function parameters.
65
+
66
+ Full documentation, including examples and full documentation of
67
+ modules and functions, can be found [here](https://rngkomorebi.github.io/daplis/).
68
+
69
+ Some functions (mainly the plotting ones) save plots as pictures in the
70
+ .png format, creating a folder for the output in the same folder that
71
+ holds the data. Others (such as delta_t.py for collecting timestamp differences
72
+ in the given time window) save .csv or .feather files with the processed data for
73
+ easier and faster plotting.
74
+
75
+ Additionally, a standalone repo with an application for online plotting
76
+ of the sensor population can be found [here](https://github.com/rngKomorebi/LinoSPAD2-app).
77
+
78
+ ## Installation and usage
79
+
80
+ A fresh, separate virtual environment is highly recommended before installing the package.
81
+ This can be done using pip, see, e.g., [this](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/).
82
+ This can help to avoid any dependency conflicts and ensure smooth operation of the
83
+ package.
84
+
85
+ First, check if the virtualenv package is installed. To do this, one can run:
86
+ ```
87
+ pip show virtualenv
88
+ ```
89
+ If the package was not found, it can be installed using:
90
+ ```
91
+ pip install virtualenv
92
+ ```
93
+ To create a new environment, run the following:
94
+ ```
95
+ virtualenv PATH/TO/NEW/ENVIRONMENT
96
+ ```
97
+ To activate the environment (on Windows):
98
+ ```
99
+ PATH/TO/NEW/ENVIRONMENTScripts/activate
100
+ ```
101
+ and on Linux:
102
+ ```
103
+ source PATH/TO/NEW/ENVIRONMENTbin/activate
104
+ ```
105
+
106
+ Then, package itself can be installed using pip inside the environment:
107
+ ```
108
+ pip install daplis
109
+ ```
110
+
111
+ Alternatively, to start using the package, one can download the whole repo. "requirements.txt"
112
+ lists all packages required for this project to run. One can create
113
+ an environment for this project either using conda or pip following the instruction
114
+ above. Once the new environmnt is activated, run the following to install
115
+ the required packages:
116
+ ```
117
+ cd PATH/TO/GITHUB/CODES/daplis
118
+ pip install -r requirements.txt
119
+ ```
120
+ Now, the package can be installed via
121
+ ```
122
+ pip install -e .
123
+ ```
124
+ where '-e' stands for editable: any changes introduced to the package will
125
+ instantly become a part of the package and can be used without the need
126
+ of reinstalling the whole thing. After that, one can import any function
127
+ from the daplis package:
128
+ ```
129
+ from daplis.functions import sensor_plot, delta_t, fits
130
+ ```
131
+
132
+ For conda users, the new environment can be installed using the 'requirements'
133
+ text file directly:
134
+ ```
135
+ conda create --name NEW_ENVIRONMENT_NAME --file /PATH/TO/requirements.txt -c conda-forge
136
+ ```
137
+ To install the package, first, switch to the created environment:
138
+ ```
139
+ conda activate NEW_ENVIRONMENT_NAME
140
+ ```
141
+ and run
142
+ ```
143
+ pip install -e .
144
+ ```
145
+
146
+ For a fast introduction on how to use the package, please see the
147
+ jupyter notebooks with examples on the main functions at "daplis/examples/".
148
+
149
+ ## How to contribute
150
+
151
+ This repo consists of two branches: 'main' serves as the release version
152
+ of the package, tested, proven to be functional, and ready to use, while
153
+ the 'develop' branch serves as the main hub for testing new stuff. To
154
+ contribute, the best way would be to fork the repository and use the 'develop'
155
+ branch for new introductions, submitting the results via pull requests.
156
+ Everyone willing to contribute is kindly asked to follow the
157
+ [PEP 8](https://peps.python.org/pep-0008/) and
158
+ [PEP 257](https://peps.python.org/pep-0257/) conventions.
159
+
160
+ ## License and contact info
161
+
162
+ This package is available under the MIT license. See LICENSE for more
163
+ information. If you'd like to contact me, the author, feel free to
164
+ write at sergei.kulkov23@gmail.com.
daplis-1.1.1/README.md ADDED
@@ -0,0 +1,138 @@
1
+ ## Data Analysis Package for LInoSpad (DAPLIS)
2
+
3
+ Package for unpacking and analyzing the binary data from the timestamping mode of the LinoSPAD2 detector.
4
+
5
+ ![Tests](https://github.com/rngKomorebi/LinoSPAD2/actions/workflows/tests.yml/badge.svg)
6
+ ![Documentation](https://github.com/rngKomorebi/LinoSPAD2/actions/workflows/documentation.yml/badge.svg)
7
+ ![PyPI - Version](https://img.shields.io/pypi/v/daplis)
8
+ ![PyPI - License](https://img.shields.io/pypi/l/daplis)
9
+
10
+ ## Introduction
11
+
12
+ This package was written for data analysis for LinoSPAD2, mainly for
13
+ analysis of the timestamp output. The key functions are ones for
14
+ unpacking the binary output of the detector that utilizes the numpy
15
+ Python library for quick unpacking of .dat files to matrices,
16
+ dictionaries, or data frames.
17
+
18
+ This library greatly streamlines working with raw timestamps from
19
+ the LinoSPAD2 camera. With this package, one can analyze dark current
20
+ rate, cross-talk probability, plot sensor population, and analyze the
21
+ raw data to look for photon coincidences.
22
+
23
+ ## Structure of the package
24
+
25
+ The "functions" folder holds all functions from unpacking to plotting
26
+ numerous types of graphs (pixel population, histograms of timestamp
27
+ differences, etc.)
28
+
29
+ The "params" folder holds masks (used to mask some of the noisiest
30
+ pixels) and calibration data (compensating for TDC nonlinearities and
31
+ offset) for LinoSPAD2 daughterboards.
32
+
33
+ The "archive" folder is a collection of scripts for debugging, tests,
34
+ older versions of functions, etc.
35
+
36
+ The "examples" folder contains a few jupyter notebooks with examples
37
+ on how to use the main functions, showcasing how to work with the
38
+ most important function parameters.
39
+
40
+ Full documentation, including examples and full documentation of
41
+ modules and functions, can be found [here](https://rngkomorebi.github.io/daplis/).
42
+
43
+ Some functions (mainly the plotting ones) save plots as pictures in the
44
+ .png format, creating a folder for the output in the same folder that
45
+ holds the data. Others (such as delta_t.py for collecting timestamp differences
46
+ in the given time window) save .csv or .feather files with the processed data for
47
+ easier and faster plotting.
48
+
49
+ Additionally, a standalone repo with an application for online plotting
50
+ of the sensor population can be found [here](https://github.com/rngKomorebi/LinoSPAD2-app).
51
+
52
+ ## Installation and usage
53
+
54
+ A fresh, separate virtual environment is highly recommended before installing the package.
55
+ This can be done using pip, see, e.g., [this](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/).
56
+ This can help to avoid any dependency conflicts and ensure smooth operation of the
57
+ package.
58
+
59
+ First, check if the virtualenv package is installed. To do this, one can run:
60
+ ```
61
+ pip show virtualenv
62
+ ```
63
+ If the package was not found, it can be installed using:
64
+ ```
65
+ pip install virtualenv
66
+ ```
67
+ To create a new environment, run the following:
68
+ ```
69
+ virtualenv PATH/TO/NEW/ENVIRONMENT
70
+ ```
71
+ To activate the environment (on Windows):
72
+ ```
73
+ PATH/TO/NEW/ENVIRONMENTScripts/activate
74
+ ```
75
+ and on Linux:
76
+ ```
77
+ source PATH/TO/NEW/ENVIRONMENTbin/activate
78
+ ```
79
+
80
+ Then, package itself can be installed using pip inside the environment:
81
+ ```
82
+ pip install daplis
83
+ ```
84
+
85
+ Alternatively, to start using the package, one can download the whole repo. "requirements.txt"
86
+ lists all packages required for this project to run. One can create
87
+ an environment for this project either using conda or pip following the instruction
88
+ above. Once the new environmnt is activated, run the following to install
89
+ the required packages:
90
+ ```
91
+ cd PATH/TO/GITHUB/CODES/daplis
92
+ pip install -r requirements.txt
93
+ ```
94
+ Now, the package can be installed via
95
+ ```
96
+ pip install -e .
97
+ ```
98
+ where '-e' stands for editable: any changes introduced to the package will
99
+ instantly become a part of the package and can be used without the need
100
+ of reinstalling the whole thing. After that, one can import any function
101
+ from the daplis package:
102
+ ```
103
+ from daplis.functions import sensor_plot, delta_t, fits
104
+ ```
105
+
106
+ For conda users, the new environment can be installed using the 'requirements'
107
+ text file directly:
108
+ ```
109
+ conda create --name NEW_ENVIRONMENT_NAME --file /PATH/TO/requirements.txt -c conda-forge
110
+ ```
111
+ To install the package, first, switch to the created environment:
112
+ ```
113
+ conda activate NEW_ENVIRONMENT_NAME
114
+ ```
115
+ and run
116
+ ```
117
+ pip install -e .
118
+ ```
119
+
120
+ For a fast introduction on how to use the package, please see the
121
+ jupyter notebooks with examples on the main functions at "daplis/examples/".
122
+
123
+ ## How to contribute
124
+
125
+ This repo consists of two branches: 'main' serves as the release version
126
+ of the package, tested, proven to be functional, and ready to use, while
127
+ the 'develop' branch serves as the main hub for testing new stuff. To
128
+ contribute, the best way would be to fork the repository and use the 'develop'
129
+ branch for new introductions, submitting the results via pull requests.
130
+ Everyone willing to contribute is kindly asked to follow the
131
+ [PEP 8](https://peps.python.org/pep-0008/) and
132
+ [PEP 257](https://peps.python.org/pep-0257/) conventions.
133
+
134
+ ## License and contact info
135
+
136
+ This package is available under the MIT license. See LICENSE for more
137
+ information. If you'd like to contact me, the author, feel free to
138
+ write at sergei.kulkov23@gmail.com.
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires = ["setuptools>=70.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "daplis"
7
+ version = "1.1.1"
8
+ description = "Data Analysis Package for LInoSpad"
9
+ authors = [{ name = "Sergei Kulkov", email = "sergei.kulkov23@gmail.com" }]
10
+ license = { text = "MIT" }
11
+ readme = "README.md"
12
+ requires-python = ">=3.8"
13
+ classifiers = [
14
+ "Programming Language :: Python :: 3.8",
15
+ "Programming Language :: Python :: 3.9",
16
+ "Programming Language :: Python :: 3.10",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ ]
21
+ keywords = ["timestamp", "analysis", "LinoSPAD2"]
22
+
23
+ dependencies = [
24
+ "lmfit>=0.9.1",
25
+ "matplotlib>=3.5.0",
26
+ "numpy>=1.22.4",
27
+ "pandas>=1.4.0",
28
+ "pyarrow>=17.0.0",
29
+ "scipy>=1.7.0",
30
+ "seaborn>=0.9.0",
31
+ "tqdm>=4.67.0",
32
+ ]
33
+
34
+ [tool.setuptools.packages.find]
35
+ where = ["src"]
36
+
37
+ [tool.setuptools.package-data]
38
+ daplis = ["*.txt", "*.csv"]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/rngKomorebi/daplis"
daplis-1.1.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
File without changes