barsukov 1.3.4__tar.gz → 1.3.5__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.
Potentially problematic release.
This version of barsukov might be problematic. Click here for more details.
- {barsukov-1.3.4/src/barsukov.egg-info → barsukov-1.3.5}/PKG-INFO +1 -1
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/data/Lock_in_emulator.py +1 -9
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/data/__init__.py +2 -1
- {barsukov-1.3.4/src/barsukov/app → barsukov-1.3.5/src/barsukov/data}/lock_in_emulator_app.py +26 -22
- {barsukov-1.3.4 → barsukov-1.3.5/src/barsukov.egg-info}/PKG-INFO +1 -1
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov.egg-info/SOURCES.txt +1 -1
- {barsukov-1.3.4 → barsukov-1.3.5}/.github/workflows/versioning.yml +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/.gitignore +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/MANIFEST.in +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/README.md +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/pyproject.toml +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/setup.cfg +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/__init__.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/data/Change_phase.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/data/constants.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/data/fft.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/data/noise.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/exp/__init__.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/exp/exp_utils.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/exp/mwHP.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/exp/smKE.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/logger.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/obj2file.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/script.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov/time.py +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov.egg-info/dependency_links.txt +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov.egg-info/requires.txt +0 -0
- {barsukov-1.3.4 → barsukov-1.3.5}/src/barsukov.egg-info/top_level.txt +0 -0
|
@@ -44,16 +44,9 @@ class Lock_in_emulator:
|
|
|
44
44
|
self.x_plot = self.x_arr(self.t_plot)
|
|
45
45
|
|
|
46
46
|
self.original_signal = self.signal_arr(self.x_plot)
|
|
47
|
-
self.
|
|
47
|
+
self.expected_signal = 0.5 * self.x_amp * np.gradient(self.original_signal, self.x_plot)
|
|
48
48
|
self.output_signal = self.signal_output_arr(self.t_plot)
|
|
49
49
|
|
|
50
|
-
#Symbolic feature:
|
|
51
|
-
x, p, w, a = sp.symbols('x p w a')
|
|
52
|
-
f = a / ((x - p)**2 + w**2)
|
|
53
|
-
dfdx = sp.diff(f, x)
|
|
54
|
-
f_prime = sp.lambdify((x, p, w, a), dfdx, 'numpy')
|
|
55
|
-
self.expected_signal = 0.5 * self.x_amp * f_prime(self.x_plot, 2, 1, 1e-6)
|
|
56
|
-
|
|
57
50
|
self.fit()
|
|
58
51
|
#self.plot()
|
|
59
52
|
|
|
@@ -165,7 +158,6 @@ class Lock_in_emulator:
|
|
|
165
158
|
self.axes[0].plot(self.x_plot, self.original_signal, 'r-', label='Original Signal')[0],
|
|
166
159
|
self.axes[1].plot(self.x_plot, self.output_signal, 'b-', label='Demodulated Signal (Lock-In)')[0],
|
|
167
160
|
self.axes[1].plot(self.x_plot, self.expected_signal, 'r-', label='Demodulated Signal (Expected)')[0],
|
|
168
|
-
self.axes[1].plot(self.x_plot, self.expected_signal_num, 'm-', label='Demodulated Signal (Expected Numerical)')[0],
|
|
169
161
|
self.axes[1].plot(self.x_plot, self.adjusted_signal, 'g-', label=f'Demodulated Signal (Adjusted)\n Diminish: {self.diminish}\n Stretch:{self.stretch}\n Shift: {self.shift}')[0],
|
|
170
162
|
]
|
|
171
163
|
|
{barsukov-1.3.4/src/barsukov/app → barsukov-1.3.5/src/barsukov/data}/lock_in_emulator_app.py
RENAMED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
from PyQt5 import QtWidgets
|
|
2
2
|
import pyqtgraph as pg
|
|
3
|
+
import numpy as np
|
|
3
4
|
import sys
|
|
4
5
|
|
|
5
6
|
from barsukov.data import Lock_in_emulator, noise
|
|
6
7
|
|
|
7
|
-
def make_lorentzian(center,
|
|
8
|
+
def make_lorentzian(center, HW, amp):
|
|
8
9
|
def l(x):
|
|
9
|
-
return amp / ((x - center)**2 +
|
|
10
|
+
return amp / ((x - center)**2 + HW**2)
|
|
10
11
|
return l
|
|
11
12
|
|
|
12
|
-
def
|
|
13
|
-
def
|
|
14
|
-
return amp / ((x - center)
|
|
15
|
-
return
|
|
13
|
+
def make_antilorentzian(center, HW, amp):
|
|
14
|
+
def al(x):
|
|
15
|
+
return amp * (x - center) / np.abs(HW) / (1 + ( (x - center) / HW)**2)
|
|
16
|
+
return al
|
|
16
17
|
|
|
17
18
|
params = [
|
|
18
19
|
("l_center", 2, "Center:", float),
|
|
19
|
-
("
|
|
20
|
+
("l_HW", 1, "HW:", float),
|
|
20
21
|
("l_amp", 1e-6, "Amplitude:", float),
|
|
21
|
-
("
|
|
22
|
-
("
|
|
23
|
-
("
|
|
22
|
+
("al_center", 4, "Center:", float),
|
|
23
|
+
("al_HW", 2, "HW:", float),
|
|
24
|
+
("al_amp", 2e-6, "Amplitude:", float),
|
|
24
25
|
("jT", 300, "Temperature (K):", float),
|
|
25
26
|
("jR", 200, "Resistance (Ohms):", float),
|
|
26
27
|
("sI", 1e-3, "Current (Amps):", float),
|
|
@@ -70,7 +71,7 @@ class MyWindow(QtWidgets.QWidget):
|
|
|
70
71
|
|
|
71
72
|
# Signal Type Selector
|
|
72
73
|
signal_combo = QtWidgets.QComboBox()
|
|
73
|
-
signal_combo.addItems(["Lorentzian", "
|
|
74
|
+
signal_combo.addItems(["Lorentzian", "Anti-Lorentzian"])
|
|
74
75
|
#signal_combo.currentIndexChanged.connect(self.update_plot)
|
|
75
76
|
self.inputs["signal_type"] = (signal_combo, lambda w: str(w.currentText()))
|
|
76
77
|
left_layout.addWidget(QtWidgets.QLabel("<b>Signal Type:</b>"))
|
|
@@ -84,17 +85,17 @@ class MyWindow(QtWidgets.QWidget):
|
|
|
84
85
|
lorentz_widget = QtWidgets.QWidget()
|
|
85
86
|
lorentz_layout = QtWidgets.QFormLayout(lorentz_widget)
|
|
86
87
|
lorentz_layout.addRow("<b>Center:</b>", self.line_edits["l_center"])
|
|
87
|
-
lorentz_layout.addRow("<b>
|
|
88
|
+
lorentz_layout.addRow("<b>HW:</b>", self.line_edits["l_HW"])
|
|
88
89
|
lorentz_layout.addRow("<b>Amplitude:</b>", self.line_edits["l_amp"])
|
|
89
90
|
signal_stack.addWidget(lorentz_widget)
|
|
90
91
|
|
|
91
92
|
#Guassian Inputs
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
signal_stack.addWidget(
|
|
93
|
+
antilorentz_widget = QtWidgets.QWidget()
|
|
94
|
+
antilorentz_layout = QtWidgets.QFormLayout(antilorentz_widget)
|
|
95
|
+
antilorentz_layout.addRow("<b>Center:</b>", self.line_edits["al_center"])
|
|
96
|
+
antilorentz_layout.addRow("<b>HW:</b>", self.line_edits["al_HW"])
|
|
97
|
+
antilorentz_layout.addRow("<b>Amplitude:</b>", self.line_edits["al_amp"])
|
|
98
|
+
signal_stack.addWidget(antilorentz_widget)
|
|
98
99
|
|
|
99
100
|
signal_combo.currentIndexChanged.connect(signal_stack.setCurrentIndex)
|
|
100
101
|
|
|
@@ -229,9 +230,9 @@ class MyWindow(QtWidgets.QWidget):
|
|
|
229
230
|
#Signal Setup
|
|
230
231
|
signal = 0
|
|
231
232
|
if v["signal_type"] == "Lorentzian":
|
|
232
|
-
signal = make_lorentzian(v["l_center"], v["
|
|
233
|
+
signal = make_lorentzian(v["l_center"], v["l_HW"], v["l_amp"])
|
|
233
234
|
else:
|
|
234
|
-
signal =
|
|
235
|
+
signal = make_antilorentzian(v["al_center"], v["al_HW"], v["al_amp"])
|
|
235
236
|
|
|
236
237
|
#Noise Setup
|
|
237
238
|
jT = jR = sI = sR = oRMS = rTU = rTD = rSU = rSD = bD = bMIN = bMAX = 0
|
|
@@ -286,8 +287,11 @@ class MyWindow(QtWidgets.QWidget):
|
|
|
286
287
|
self.line_edits[name].setText(str(default))
|
|
287
288
|
self.update_plot()
|
|
288
289
|
|
|
289
|
-
|
|
290
|
+
def run():
|
|
290
291
|
app = QtWidgets.QApplication(sys.argv)
|
|
291
292
|
w = MyWindow()
|
|
292
293
|
w.show()
|
|
293
|
-
sys.exit(app.exec_())
|
|
294
|
+
sys.exit(app.exec_())
|
|
295
|
+
|
|
296
|
+
if __name__ == "__main__":
|
|
297
|
+
run()
|
|
@@ -13,12 +13,12 @@ src/barsukov.egg-info/SOURCES.txt
|
|
|
13
13
|
src/barsukov.egg-info/dependency_links.txt
|
|
14
14
|
src/barsukov.egg-info/requires.txt
|
|
15
15
|
src/barsukov.egg-info/top_level.txt
|
|
16
|
-
src/barsukov/app/lock_in_emulator_app.py
|
|
17
16
|
src/barsukov/data/Change_phase.py
|
|
18
17
|
src/barsukov/data/Lock_in_emulator.py
|
|
19
18
|
src/barsukov/data/__init__.py
|
|
20
19
|
src/barsukov/data/constants.py
|
|
21
20
|
src/barsukov/data/fft.py
|
|
21
|
+
src/barsukov/data/lock_in_emulator_app.py
|
|
22
22
|
src/barsukov/data/noise.py
|
|
23
23
|
src/barsukov/exp/__init__.py
|
|
24
24
|
src/barsukov/exp/exp_utils.py
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|