pqopen-lib 0.8.0__tar.gz → 0.8.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.
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/PKG-INFO +1 -1
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/powersystem.py +2 -7
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/zcd.py +14 -3
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pyproject.toml +1 -1
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/.gitignore +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/LICENSE +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/README.md +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/__init__.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/eventdetector.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/goertzel.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/helper.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/powerquality.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/pqopen/storagecontroller.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/data_files/event_data_level_low.csv +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/eventdetector-test.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/goertzel-test.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/helper-test.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/powerquality-test.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/powersystem-test.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/storagecontroller-test.py +0 -0
- {pqopen_lib-0.8.0 → pqopen_lib-0.8.1}/test/zcd-test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pqopen-lib
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: A power quality processing library for calculating parameters from waveform data
|
|
5
5
|
Project-URL: Homepage, https://github.com/DaqOpen/pqopen-lib
|
|
6
6
|
Project-URL: Issues, https://github.com/DaqOpen/pqopen-lib/issues
|
|
@@ -672,13 +672,8 @@ class PowerSystem(object):
|
|
|
672
672
|
self._calculation_mode = "FALLBACK"
|
|
673
673
|
else:
|
|
674
674
|
self._calculation_mode = "NORMAL"
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
filtered_zero_crossings = []
|
|
678
|
-
for idx,zc in enumerate(zero_crossings):
|
|
679
|
-
if (int(zc)+start_acq_sidx) >= self._zero_crossings[-1] or np.isnan(self._zero_crossings[-1]):
|
|
680
|
-
filtered_zero_crossings.append(zc)
|
|
681
|
-
return filtered_zero_crossings
|
|
675
|
+
|
|
676
|
+
return zero_crossings
|
|
682
677
|
|
|
683
678
|
def get_aggregated_data(self, start_acq_sidx: int, stop_acq_sidx: int) -> dict:
|
|
684
679
|
"""
|
|
@@ -48,6 +48,7 @@ class ZeroCrossDetector:
|
|
|
48
48
|
self._last_zc_p = None
|
|
49
49
|
self._last_zc_n = None
|
|
50
50
|
self._last_zc_n_val = None
|
|
51
|
+
self._last_zc = None
|
|
51
52
|
|
|
52
53
|
# Calculate the filter delay in samples
|
|
53
54
|
w, h = signal.freqz(self._filter_coeff[0], self._filter_coeff[1], worN=[self.f_cutoff], fs=self.samplerate)
|
|
@@ -111,9 +112,15 @@ class ZeroCrossDetector:
|
|
|
111
112
|
k = (y2 - y1) / (x2 - x1)
|
|
112
113
|
d = y1 - k * x1
|
|
113
114
|
real_zc = -d/k
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
if np.isnan(real_zc):
|
|
116
|
+
logger.warning("Detection Error: real_zc is NaN, ignoring")
|
|
117
|
+
else:
|
|
118
|
+
if self._last_zc and (real_zc <= self._last_zc):
|
|
119
|
+
logger.warning("Detected ZC before last one, ignoring")
|
|
120
|
+
else:
|
|
121
|
+
zero_crossings.append(real_zc + self.filter_delay_samples)
|
|
122
|
+
last_used_p_idx = p_idx
|
|
123
|
+
self._last_zc = real_zc
|
|
117
124
|
|
|
118
125
|
# Update the last negative threshold-crossing for the next block
|
|
119
126
|
if last_used_p_idx < len(threshold_p_cross) and len(threshold_n_cross) > 0:
|
|
@@ -126,4 +133,8 @@ class ZeroCrossDetector:
|
|
|
126
133
|
else:
|
|
127
134
|
self._last_zc_n = None
|
|
128
135
|
|
|
136
|
+
# Update Last Valid ZC Index
|
|
137
|
+
if self._last_zc:
|
|
138
|
+
self._last_zc -= len(data)
|
|
139
|
+
|
|
129
140
|
return zero_crossings
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|