proadv 2.0.2__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 (39) hide show
  1. proadv-2.0.2/PKG-INFO +167 -0
  2. proadv-2.0.2/README.md +141 -0
  3. proadv-2.0.2/proadv/__init__.py +0 -0
  4. proadv-2.0.2/proadv/filtration/__init__.py +0 -0
  5. proadv-2.0.2/proadv/filtration/detection/__init__.py +0 -0
  6. proadv-2.0.2/proadv/filtration/detection/acceleration.py +65 -0
  7. proadv-2.0.2/proadv/filtration/detection/bivariatekernel.py +53 -0
  8. proadv-2.0.2/proadv/filtration/detection/correlation.py +78 -0
  9. proadv-2.0.2/proadv/filtration/detection/phasespace.py +173 -0
  10. proadv-2.0.2/proadv/filtration/detection/poincare.py +46 -0
  11. proadv-2.0.2/proadv/filtration/detection/pollution.py +32 -0
  12. proadv-2.0.2/proadv/filtration/detection/spherical.py +181 -0
  13. proadv-2.0.2/proadv/filtration/detection/trivariatekernel.py +521 -0
  14. proadv-2.0.2/proadv/filtration/replacement/__init__.py +0 -0
  15. proadv-2.0.2/proadv/filtration/replacement/replacements.py +187 -0
  16. proadv-2.0.2/proadv/kernel/__init__.py +0 -0
  17. proadv-2.0.2/proadv/kernel/bivariate.py +437 -0
  18. proadv-2.0.2/proadv/statistics/__init__.py +0 -0
  19. proadv-2.0.2/proadv/statistics/descriptive.py +328 -0
  20. proadv-2.0.2/proadv/statistics/distributions/__init__.py +1 -0
  21. proadv-2.0.2/proadv/statistics/distributions/normal.py +126 -0
  22. proadv-2.0.2/proadv/statistics/moment.py +122 -0
  23. proadv-2.0.2/proadv/statistics/series.py +337 -0
  24. proadv-2.0.2/proadv/statistics/spread.py +119 -0
  25. proadv-2.0.2/proadv/tests/__init__.py +0 -0
  26. proadv-2.0.2/proadv/tests/statistics/__init__.py +0 -0
  27. proadv-2.0.2/proadv/tests/statistics/descriptive/__init__.py +0 -0
  28. proadv-2.0.2/proadv/tests/statistics/descriptive/test_max.py +36 -0
  29. proadv-2.0.2/proadv/tests/statistics/descriptive/test_mean.py +37 -0
  30. proadv-2.0.2/proadv/tests/statistics/descriptive/test_median.py +26 -0
  31. proadv-2.0.2/proadv/tests/statistics/descriptive/test_min.py +36 -0
  32. proadv-2.0.2/proadv/tests/statistics/descriptive/test_mode.py +34 -0
  33. proadv-2.0.2/proadv.egg-info/PKG-INFO +167 -0
  34. proadv-2.0.2/proadv.egg-info/SOURCES.txt +37 -0
  35. proadv-2.0.2/proadv.egg-info/dependency_links.txt +1 -0
  36. proadv-2.0.2/proadv.egg-info/requires.txt +3 -0
  37. proadv-2.0.2/proadv.egg-info/top_level.txt +1 -0
  38. proadv-2.0.2/setup.cfg +4 -0
  39. proadv-2.0.2/setup.py +51 -0
proadv-2.0.2/PKG-INFO ADDED
@@ -0,0 +1,167 @@
1
+ Metadata-Version: 2.1
2
+ Name: proadv
3
+ Version: 2.0.2
4
+ Summary: Process Acoustic Doppler Velocimeter data with advanced despiking and analysis tools
5
+ Home-page: https://github.com/farzadasgari/proadv
6
+ Author: Farzad Asgari
7
+ Author-email: std_farzad.asgari@alumni.khu.ac.ir
8
+ Project-URL: Bug Tracker, https://github.com/farzadasgari/proadv/issues
9
+ Project-URL: Documentation, https://github.com/farzadasgari/proadv/tree/main/docs
10
+ Project-URL: Source Code, https://github.com/farzadasgari/proadv
11
+ Keywords: ProADV,python,signal processing,data processing,acoustic Doppler velocimeter,ADV,Denoising,Despiking
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.8
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: numpy>=1.0
24
+ Requires-Dist: scipy>=1.0
25
+ Requires-Dist: fastkde
26
+
27
+ # ProADV - Process Acoustic Doppler Velocimeter
28
+
29
+ [![GitHub stars](https://img.shields.io/github/stars/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/stargazers)
30
+ [![GitHub forks](https://img.shields.io/github/forks/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/network)
31
+ [![GitHub issues](https://img.shields.io/github/issues/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/issues)
32
+ [![GitHub license](https://img.shields.io/github/license/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/blob/main/LICENSE)
33
+ [![PyPI version](https://badge.fury.io/py/proadv.svg)](https://badge.fury.io/py/proadv)
34
+ [![conda](https://img.shields.io/conda/vn/conda-forge/proadv.svg)](https://anaconda.org/conda-forge/proadv)
35
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/proadv)](https://pypi.org/project/proadv/)
36
+ [![GitHub contributors](https://img.shields.io/github/contributors/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/graphs/contributors)
37
+ [![GitHub pull requests](https://img.shields.io/github/issues-pr/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls)
38
+ [![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls?q=is%3Apr+is%3Aclosed)
39
+ [![GitHub last commit](https://img.shields.io/github/last-commit/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/commits/main)
40
+
41
+
42
+ ## Streamline Your ADV Data Analysis
43
+
44
+ **ProADV** is a comprehensive Python package designed to empower researchers and engineers working with acoustic Doppler velocimeter (ADV) data. It offers a comprehensive suite of tools for efficient cleaning, analysis, and visualization of ADV data, streamlining your workflow and extracting valuable insights from your measurements.
45
+
46
+ ### Key Features
47
+
48
+ * **Despiking and Denoising:** ProADV tackles the challenge of spikes and noise in ADV data, providing a variety of robust algorithms for effective data cleaning.
49
+ * **Spike Detection:**
50
+ * **ACC (Acceleration Thresholding):** Identifies spikes based on exceeding a user-defined acceleration threshold.
51
+ * **PST (Phase-Space Thresholding):** Utilizes a combination of velocity and its temporal derivative to detect spikes.
52
+ * **mPST (Modified Phase-Space Thresholding):** An enhanced version of PST with improved sensitivity.
53
+ * **VC (Velocity Correlation):** Detects spikes based on deviations from the correlation between neighboring data points.
54
+ * **KDE (Kernel Density Estimation):** Employs a statistical approach to identify outliers based on the probability density function.
55
+ * **3d-KDE (Three-dimensional Kernel Density Estimation):** Extends KDE to three dimensions for more robust spike detection in complex data.
56
+ * **m3d-KDE (Modified Three-dimensional Kernel Density Estimation):** Further refines 3d-KDE for enhanced performance.
57
+ * **Replacement Methods:** ProADV offers several options to replace detected spikes with more reliable values:
58
+ * **LVD (Last Valid Data):** Replaces spikes with the last valid data point before the spike.
59
+ * **MV (Mean Value):** Replaces spikes with the mean value of velocity component.
60
+ * **LI (Linear Interpolation):** Uses linear interpolation between surrounding points to estimate the missing value.
61
+ * **12PP (12 Points Cubic Polynomial):** Employs a 12-point cubic polynomial to fit a smoother curve and replace spikes.
62
+
63
+ * **Statistical Analysis:** ProADV equips you with essential statistical tools to characterize your ADV data:
64
+ * **Minimum, Maximum:** Provides the range of measured velocities.
65
+ * **Mean, Median, Mode:** Calculates central tendency measures.
66
+ * **Skewness, Kurtosis:** Analyzes the distribution characteristics of your data.
67
+
68
+ * **Advanced Analysis:** In addition to cleaning and basic statistics, ProADV offers advanced functionalities for deeper insights:
69
+ * **Moving Average:** Smooths out data fluctuations for better visualization and trend analysis. Provided in simple moving average, exponential moving average, and weighted moving average methods.
70
+ * **SSA (Singular Spectrum Analysis):** Extracts underlying patterns and trends from time series data.
71
+ * **PR (Pollution Rate) Calculation:** Estimates the level of noise or pollution within the data.
72
+ * **Spectral Analysis:**
73
+ * **PSD (Power Spectral Density):** Analyzes the distribution of energy across different frequencies within the data.
74
+ * **PDF (Probability Density Function):** Provides the probability of encountering specific velocity values.
75
+ * **Normality Test:** Evaluates whether your data follows a normal distribution.
76
+ * **Normalization:** Scales data to a common range for further analysis or visualization.
77
+
78
+ ### Installation
79
+
80
+ There are three convenient ways to install ProADV:
81
+
82
+ 1. **Using pip (recommended):**
83
+ ```bash
84
+ pip install proadv
85
+ ```
86
+
87
+ 2. **Using conda-forge:**
88
+ ```bash
89
+ conda install -c conda-forge proadv
90
+ ```
91
+
92
+ 3. **From source code:**
93
+
94
+ a. Clone the repository:
95
+ ```bash
96
+ git clone https://github.com/farzadasgari/proadv.git
97
+ ```
98
+ b. Navigate to the project directory:
99
+ ```bash
100
+ cd proadv
101
+ ```
102
+ c. Install using setup.py:
103
+ ```bash
104
+ python setup.py install
105
+ ```
106
+
107
+ ### Collaboration
108
+
109
+ We encourage collaboration and contributions from the community to improve ProADV. Here's how to contribute:
110
+
111
+ 1. Fork the repository on GitHub.
112
+ 2. Clone your forked repository to your local machine.
113
+ 3. Create a new branch for your changes.
114
+ 4. Make your changes and commit them with descriptive messages.
115
+ 5. Push your changes to your forked repository.
116
+ 6. Submit a pull request for review and merging.
117
+
118
+ ### References
119
+
120
+ For further information and in-depth understanding of the algorithms employed in ProADV, refer to the following resources:
121
+
122
+ 1. [Exploring the role of signal pollution rate on the performance of despiking velocity time-series algorithms](https://doi.org/10.1016/j.flowmeasinst.2023.102485)
123
+ 2. [Unleashing the power of three-dimensional kernel density estimation for Doppler Velocimeter data despiking](https://doi.org/10.1016/j.measurement.2023.114053)
124
+
125
+
126
+ ### Acknowledgment
127
+ - This project was developed under the supervision of **[Dr. Seyed Hossein Mohaeri](https://khu.ac.ir/cv/1139/Seyed-Hossein-Mohajeri)** and **[Dr. Mojtaba Mehraein](https://khu.ac.ir/cv/279/Mojtaba-Mehraein)**.
128
+ - Special thanks to [Parvaneh Yaghoubi](https://github.com/parvanehyaghoubi), [Hossein Abazari](https://github.com/HossA12), [Narges Yaghoubi](https://github.com/nargesyaghoubi), [Mojtaba Karimi](https://github.com/mojikarimi), and [Hiva Yarandi](https://github.com/Hivayrn) for their valuable contributions to this project.
129
+
130
+
131
+ ### Contact
132
+ For any inquiries, please contact:
133
+ - std_farzad.asgari@alumni.khu.ac.ir
134
+ - khufarzadasgari@gmail.com
135
+
136
+ ### Links
137
+
138
+ ##### Farzad Asgari
139
+ [![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://farzadasgari.ir/)
140
+
141
+ [![Google Scholar Badge](https://img.shields.io/badge/Google%20Scholar-4285F4?logo=googlescholar&logoColor=fff&style=for-the-badge)](https://scholar.google.com/citations?user=Rhue_kkAAAAJ&hl=en)
142
+
143
+ [![ResearchGate Badge](https://img.shields.io/badge/ResearchGate-0CB?logo=researchgate&logoColor=fff&style=for-the-badge)](https://www.researchgate.net/profile/Farzad-Asgari)
144
+
145
+ [![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/farzad-asgari-5a90942b2/)
146
+
147
+
148
+ ##### Seyed Hossein Mohajeri
149
+ [![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://khu.ac.ir/cv/1139/Seyed-Hossein-Mohajeri)
150
+
151
+ [![Google Scholar Badge](https://img.shields.io/badge/Google%20Scholar-4285F4?logo=googlescholar&logoColor=fff&style=for-the-badge)](https://scholar.google.com/citations?user=E8PFUBEAAAAJ&hl=en)
152
+
153
+ [![ResearchGate Badge](https://img.shields.io/badge/ResearchGate-0CB?logo=researchgate&logoColor=fff&style=for-the-badge)](https://www.researchgate.net/profile/Seyed-Mohajeri-2)
154
+
155
+ [![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](
156
+ https://ir.linkedin.com/in/hossein-mohajeri)
157
+
158
+
159
+ ##### Mojtaba Mehraein
160
+ [![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://khu.ac.ir/cv/279/Mojtaba-Mehraein)
161
+
162
+ [![Google Scholar Badge](https://img.shields.io/badge/Google%20Scholar-4285F4?logo=googlescholar&logoColor=fff&style=for-the-badge)](https://scholar.google.com/citations?user=GwT49LIAAAAJ&hl=en)
163
+
164
+ [![ResearchGate Badge](https://img.shields.io/badge/ResearchGate-0CB?logo=researchgate&logoColor=fff&style=for-the-badge)](https://ir.linkedin.com/in/mojtaba-mehraein-002a03238)
165
+
166
+ [![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](
167
+ https://ir.linkedin.com/in/mojtaba-mehraein-002a03238)
proadv-2.0.2/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # ProADV - Process Acoustic Doppler Velocimeter
2
+
3
+ [![GitHub stars](https://img.shields.io/github/stars/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/stargazers)
4
+ [![GitHub forks](https://img.shields.io/github/forks/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/network)
5
+ [![GitHub issues](https://img.shields.io/github/issues/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/issues)
6
+ [![GitHub license](https://img.shields.io/github/license/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/blob/main/LICENSE)
7
+ [![PyPI version](https://badge.fury.io/py/proadv.svg)](https://badge.fury.io/py/proadv)
8
+ [![conda](https://img.shields.io/conda/vn/conda-forge/proadv.svg)](https://anaconda.org/conda-forge/proadv)
9
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/proadv)](https://pypi.org/project/proadv/)
10
+ [![GitHub contributors](https://img.shields.io/github/contributors/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/graphs/contributors)
11
+ [![GitHub pull requests](https://img.shields.io/github/issues-pr/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls)
12
+ [![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/pulls?q=is%3Apr+is%3Aclosed)
13
+ [![GitHub last commit](https://img.shields.io/github/last-commit/farzadasgari/proadv)](https://github.com/farzadasgari/proadv/commits/main)
14
+
15
+
16
+ ## Streamline Your ADV Data Analysis
17
+
18
+ **ProADV** is a comprehensive Python package designed to empower researchers and engineers working with acoustic Doppler velocimeter (ADV) data. It offers a comprehensive suite of tools for efficient cleaning, analysis, and visualization of ADV data, streamlining your workflow and extracting valuable insights from your measurements.
19
+
20
+ ### Key Features
21
+
22
+ * **Despiking and Denoising:** ProADV tackles the challenge of spikes and noise in ADV data, providing a variety of robust algorithms for effective data cleaning.
23
+ * **Spike Detection:**
24
+ * **ACC (Acceleration Thresholding):** Identifies spikes based on exceeding a user-defined acceleration threshold.
25
+ * **PST (Phase-Space Thresholding):** Utilizes a combination of velocity and its temporal derivative to detect spikes.
26
+ * **mPST (Modified Phase-Space Thresholding):** An enhanced version of PST with improved sensitivity.
27
+ * **VC (Velocity Correlation):** Detects spikes based on deviations from the correlation between neighboring data points.
28
+ * **KDE (Kernel Density Estimation):** Employs a statistical approach to identify outliers based on the probability density function.
29
+ * **3d-KDE (Three-dimensional Kernel Density Estimation):** Extends KDE to three dimensions for more robust spike detection in complex data.
30
+ * **m3d-KDE (Modified Three-dimensional Kernel Density Estimation):** Further refines 3d-KDE for enhanced performance.
31
+ * **Replacement Methods:** ProADV offers several options to replace detected spikes with more reliable values:
32
+ * **LVD (Last Valid Data):** Replaces spikes with the last valid data point before the spike.
33
+ * **MV (Mean Value):** Replaces spikes with the mean value of velocity component.
34
+ * **LI (Linear Interpolation):** Uses linear interpolation between surrounding points to estimate the missing value.
35
+ * **12PP (12 Points Cubic Polynomial):** Employs a 12-point cubic polynomial to fit a smoother curve and replace spikes.
36
+
37
+ * **Statistical Analysis:** ProADV equips you with essential statistical tools to characterize your ADV data:
38
+ * **Minimum, Maximum:** Provides the range of measured velocities.
39
+ * **Mean, Median, Mode:** Calculates central tendency measures.
40
+ * **Skewness, Kurtosis:** Analyzes the distribution characteristics of your data.
41
+
42
+ * **Advanced Analysis:** In addition to cleaning and basic statistics, ProADV offers advanced functionalities for deeper insights:
43
+ * **Moving Average:** Smooths out data fluctuations for better visualization and trend analysis. Provided in simple moving average, exponential moving average, and weighted moving average methods.
44
+ * **SSA (Singular Spectrum Analysis):** Extracts underlying patterns and trends from time series data.
45
+ * **PR (Pollution Rate) Calculation:** Estimates the level of noise or pollution within the data.
46
+ * **Spectral Analysis:**
47
+ * **PSD (Power Spectral Density):** Analyzes the distribution of energy across different frequencies within the data.
48
+ * **PDF (Probability Density Function):** Provides the probability of encountering specific velocity values.
49
+ * **Normality Test:** Evaluates whether your data follows a normal distribution.
50
+ * **Normalization:** Scales data to a common range for further analysis or visualization.
51
+
52
+ ### Installation
53
+
54
+ There are three convenient ways to install ProADV:
55
+
56
+ 1. **Using pip (recommended):**
57
+ ```bash
58
+ pip install proadv
59
+ ```
60
+
61
+ 2. **Using conda-forge:**
62
+ ```bash
63
+ conda install -c conda-forge proadv
64
+ ```
65
+
66
+ 3. **From source code:**
67
+
68
+ a. Clone the repository:
69
+ ```bash
70
+ git clone https://github.com/farzadasgari/proadv.git
71
+ ```
72
+ b. Navigate to the project directory:
73
+ ```bash
74
+ cd proadv
75
+ ```
76
+ c. Install using setup.py:
77
+ ```bash
78
+ python setup.py install
79
+ ```
80
+
81
+ ### Collaboration
82
+
83
+ We encourage collaboration and contributions from the community to improve ProADV. Here's how to contribute:
84
+
85
+ 1. Fork the repository on GitHub.
86
+ 2. Clone your forked repository to your local machine.
87
+ 3. Create a new branch for your changes.
88
+ 4. Make your changes and commit them with descriptive messages.
89
+ 5. Push your changes to your forked repository.
90
+ 6. Submit a pull request for review and merging.
91
+
92
+ ### References
93
+
94
+ For further information and in-depth understanding of the algorithms employed in ProADV, refer to the following resources:
95
+
96
+ 1. [Exploring the role of signal pollution rate on the performance of despiking velocity time-series algorithms](https://doi.org/10.1016/j.flowmeasinst.2023.102485)
97
+ 2. [Unleashing the power of three-dimensional kernel density estimation for Doppler Velocimeter data despiking](https://doi.org/10.1016/j.measurement.2023.114053)
98
+
99
+
100
+ ### Acknowledgment
101
+ - This project was developed under the supervision of **[Dr. Seyed Hossein Mohaeri](https://khu.ac.ir/cv/1139/Seyed-Hossein-Mohajeri)** and **[Dr. Mojtaba Mehraein](https://khu.ac.ir/cv/279/Mojtaba-Mehraein)**.
102
+ - Special thanks to [Parvaneh Yaghoubi](https://github.com/parvanehyaghoubi), [Hossein Abazari](https://github.com/HossA12), [Narges Yaghoubi](https://github.com/nargesyaghoubi), [Mojtaba Karimi](https://github.com/mojikarimi), and [Hiva Yarandi](https://github.com/Hivayrn) for their valuable contributions to this project.
103
+
104
+
105
+ ### Contact
106
+ For any inquiries, please contact:
107
+ - std_farzad.asgari@alumni.khu.ac.ir
108
+ - khufarzadasgari@gmail.com
109
+
110
+ ### Links
111
+
112
+ ##### Farzad Asgari
113
+ [![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://farzadasgari.ir/)
114
+
115
+ [![Google Scholar Badge](https://img.shields.io/badge/Google%20Scholar-4285F4?logo=googlescholar&logoColor=fff&style=for-the-badge)](https://scholar.google.com/citations?user=Rhue_kkAAAAJ&hl=en)
116
+
117
+ [![ResearchGate Badge](https://img.shields.io/badge/ResearchGate-0CB?logo=researchgate&logoColor=fff&style=for-the-badge)](https://www.researchgate.net/profile/Farzad-Asgari)
118
+
119
+ [![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/farzad-asgari-5a90942b2/)
120
+
121
+
122
+ ##### Seyed Hossein Mohajeri
123
+ [![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://khu.ac.ir/cv/1139/Seyed-Hossein-Mohajeri)
124
+
125
+ [![Google Scholar Badge](https://img.shields.io/badge/Google%20Scholar-4285F4?logo=googlescholar&logoColor=fff&style=for-the-badge)](https://scholar.google.com/citations?user=E8PFUBEAAAAJ&hl=en)
126
+
127
+ [![ResearchGate Badge](https://img.shields.io/badge/ResearchGate-0CB?logo=researchgate&logoColor=fff&style=for-the-badge)](https://www.researchgate.net/profile/Seyed-Mohajeri-2)
128
+
129
+ [![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](
130
+ https://ir.linkedin.com/in/hossein-mohajeri)
131
+
132
+
133
+ ##### Mojtaba Mehraein
134
+ [![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://khu.ac.ir/cv/279/Mojtaba-Mehraein)
135
+
136
+ [![Google Scholar Badge](https://img.shields.io/badge/Google%20Scholar-4285F4?logo=googlescholar&logoColor=fff&style=for-the-badge)](https://scholar.google.com/citations?user=GwT49LIAAAAJ&hl=en)
137
+
138
+ [![ResearchGate Badge](https://img.shields.io/badge/ResearchGate-0CB?logo=researchgate&logoColor=fff&style=for-the-badge)](https://ir.linkedin.com/in/mojtaba-mehraein-002a03238)
139
+
140
+ [![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](
141
+ https://ir.linkedin.com/in/mojtaba-mehraein-002a03238)
File without changes
File without changes
File without changes
@@ -0,0 +1,65 @@
1
+ import numpy as np
2
+ from proadv.statistics.spread import std
3
+
4
+
5
+ def acceleration_thresholding(velocities, frequency, tag, gravity=980, k_gravity=1.5, k_sigma=1):
6
+ """
7
+ Detects acceleration events based on velocity data.
8
+
9
+ This function calculates acceleration events based on velocity data, considering thresholds
10
+ for acceleration magnitude and velocity deviation from mean.
11
+
12
+ Parameters
13
+ ------
14
+ velocities (array_like): Array of velocity data.
15
+ An array-like object containing velocity values.
16
+ frequency (float): Sampling frequency.
17
+ The frequency at which the velocity data is sampled,
18
+ used to calculate acceleration from velocity differences.
19
+ tag (int): Tag for acceleration direction.
20
+ An integer indicating the direction of acceleration to detect:
21
+ - 1 for positive acceleration (increasing velocity)
22
+ - 2 for negative acceleration (decreasing velocity).
23
+ gravity (float): Value of gravity.
24
+ The acceleration due to gravity, used as a reference for acceleration thresholds.
25
+ Default is 980 (m/s^2).
26
+ k_gravity (float): Threshold multiplier for gravity.
27
+ A multiplier applied to the gravity value to determine the acceleration threshold.
28
+ Default is 1.5.
29
+ k_sigma (float, optional): Threshold multiplier for standard deviation.
30
+ A multiplier applied to the standard deviation of velocities to determine velocity deviation threshold.
31
+ Default is 1.
32
+
33
+ Returns
34
+ ------
35
+ accel_indices (array_like): Indices of acceleration events.
36
+ An array containing the indices of the detected acceleration events.
37
+
38
+ Raises
39
+ ------
40
+ ValueError: If invalid tag value is provided.
41
+ Raised when the tag value is not 1 or 2.
42
+
43
+ References
44
+ ------
45
+ Goring, Derek G., and Vladimir I. Nikora.
46
+ "Despiking acoustic Doppler velocimeter data."
47
+ Journal of hydraulic engineering 128.1 (2002): 117-126.
48
+ """
49
+ velocities = np.asarray(velocities)
50
+
51
+ # Calculate velocity differences and multiply by frequency to obtain acceleration
52
+ differences = np.concatenate((np.array([0]), np.diff(velocities) * frequency))
53
+
54
+ if tag == 1:
55
+ # Detect positive acceleration events
56
+ accel_indices = np.intersect1d(np.where(differences > k_gravity * gravity)[0],
57
+ np.where(velocities > np.mean(velocities) + k_sigma * std(velocities))[0])
58
+ elif tag == 2:
59
+ # Detect negative acceleration events
60
+ accel_indices = np.intersect1d(np.where(differences < -k_gravity * gravity)[0],
61
+ np.where(velocities < np.mean(velocities) - k_sigma * std(velocities))[0])
62
+ else:
63
+ raise ValueError("Invalid tag value. Expected 1 or 2.")
64
+
65
+ return accel_indices
@@ -0,0 +1,53 @@
1
+ import numpy as np
2
+
3
+
4
+ def _cutoff(density_profile, velocity_profile, c1_threshold, c2_threshold, force_profile, peak_index, grid):
5
+ """
6
+ Find the lower and upper cutoff velocities based on specified criteria.
7
+
8
+ Parameters
9
+ ------
10
+ density_profile (array_like): Density profile of the system.
11
+ velocity_profile (array_like): Velocity profile of the system.
12
+ c1_threshold (float): Threshold ratio for force compared to peak force.
13
+ c2_threshold (float): Threshold for absolute change in force.
14
+ force_profile (array_like): Force profile of the system.
15
+ peak_index (int): Index of the peak force in the force profile.
16
+ grid (int): Grid spacing or resolution.
17
+
18
+ Returns
19
+ ------
20
+ lower_cutoff_velocity, upper_cutoff_velocity: A tuple containing the lower and upper cutoff velocities.
21
+
22
+ Note
23
+ ------
24
+ This function assumes that the input arrays (density_profile, velocity_profile, and force_profile)
25
+ are of the same length.
26
+ length.
27
+ The density profile, velocity profile, and force profile should be consistent and correspond to
28
+ each other at each index.
29
+ """
30
+
31
+ profile_length = force_profile.size
32
+ delta_force = np.append([0], np.diff(force_profile)) * grid / density_profile
33
+
34
+ # Find lower cutoff index
35
+ for i in range(peak_index - 1, 0, -1):
36
+ if force_profile[i] / force_profile[peak_index] <= c1_threshold and abs(delta_force[i]) <= c2_threshold:
37
+ lower_cutoff_index = i
38
+ break
39
+ else:
40
+ lower_cutoff_index = 1
41
+
42
+ # Find upper cutoff index
43
+ for i in range(peak_index + 1, profile_length - 1):
44
+ if force_profile[i] / force_profile[peak_index] <= c1_threshold and abs(delta_force[i]) <= c2_threshold:
45
+ upper_cutoff_index = i
46
+ break
47
+ else:
48
+ upper_cutoff_index = profile_length - 1
49
+
50
+ lower_cutoff_velocity = velocity_profile[lower_cutoff_index]
51
+ upper_cutoff_velocity = velocity_profile[upper_cutoff_index]
52
+
53
+ return lower_cutoff_velocity, upper_cutoff_velocity
@@ -0,0 +1,78 @@
1
+ import numpy as np
2
+ from proadv.filtration.detection.poincare import calculate_ab, calculate_rho
3
+ from proadv.statistics.spread import std
4
+
5
+
6
+ def calculate_parameters(up, vp, wp):
7
+ """
8
+ Calculate parameters required for velocity correlation.
9
+
10
+ Parameters
11
+ ------
12
+ up (array_like): Array of the first velocity component.
13
+ vp (array_like): Array of the second velocity component.
14
+ wp (array_like): Array of the third velocity component.
15
+
16
+ Returns
17
+ ------
18
+ lambda_ (float): Lambda value used in velocity correlation detection.
19
+ std_u (float): Standard deviation of the longitudinal velocity component.
20
+ std_v (float): Standard deviation of the transverse velocity component.
21
+ std_w (float): Standard deviation of the vertical velocity component.
22
+ """
23
+ data_size = up.size
24
+ std_u = std(up)
25
+ std_v = std(vp)
26
+ std_w = std(wp)
27
+ lambda_ = np.sqrt(2 * np.log(data_size))
28
+ return lambda_, std_u, std_v, std_w
29
+
30
+
31
+ def velocity_correlation(ui, vi, wi):
32
+ """
33
+ Detect spikes using velocity correlation filter, based on three velocity components.
34
+
35
+ Parameters
36
+ ------
37
+ ui (array_like): Array of the longitudinal velocity component.
38
+ vi (array_like): Array of the transverse velocity component.
39
+ wi (array_like): Array of the vertical velocity component.
40
+
41
+ Returns
42
+ ------
43
+ correl_indices (array_like): Indices of spikes detected by velocity correlation.
44
+
45
+ References
46
+ ------
47
+ Cea, L., J. Puertas, and L. Pena.
48
+ "Velocity measurements on highly turbulent free surface flow using ADV."
49
+ Experiments in fluids 42 (2007): 333-348.
50
+ """
51
+ from proadv.statistics.descriptive import mean
52
+ ui, vi, wi = ui - mean(ui), vi - mean(vi), wi - mean(wi)
53
+ lambda_, std_u, std_v, std_w = calculate_parameters(ui, vi, wi)
54
+
55
+ # Calculate angles between velocity components
56
+ theta1 = np.arctan(np.sum(ui * vi) / np.sum(ui ** 2))
57
+ theta2 = np.arctan(np.sum(ui * wi) / np.sum(ui ** 2))
58
+ theta3 = np.arctan(np.sum(vi * wi) / np.sum(vi ** 2))
59
+
60
+ # Calculate 'a' and 'b' coefficients for each angle
61
+ a1, b1 = calculate_ab(std_u, std_v, theta1, lambda_)
62
+ a2, b2 = calculate_ab(std_u, std_w, theta2, lambda_)
63
+ a3, b3 = calculate_ab(std_v, std_w, theta3, lambda_)
64
+
65
+ # Calculate rho values for each component pair
66
+ rho1 = calculate_rho(ui, vi, theta1, a1, b1)
67
+ rho2 = calculate_rho(ui, wi, theta2, a2, b2)
68
+ rho3 = calculate_rho(vi, wi, theta3, a3, b3)
69
+
70
+ # Find indices where rho values exceed 1 (indicating correlation)
71
+ x1 = np.nonzero(rho1 > 1)[0]
72
+ x2 = np.nonzero(rho2 > 1)[0]
73
+ x3 = np.nonzero(rho3 > 1)[0]
74
+
75
+ # Combine all detected indices and remove duplicates
76
+ correl_indices = np.sort(np.unique(np.concatenate((x1, x2, x3))))
77
+
78
+ return correl_indices