- Phase was the wrong way around in the chart
- L and C components in calibration had their orders of magnitude swapped
pull/17/head
Rune B. Broberg 2019-09-14 17:48:19 +02:00
rodzic 4e80fcb6f0
commit 2a8f82d8e0
2 zmienionych plików z 14 dodań i 14 usunięć

Wyświetl plik

@ -200,17 +200,17 @@ class CalibrationWindow(QtWidgets.QWidget):
self.app.calibration.useIdealLoad = True
else:
# We are using custom calibration standards
self.app.calibration.shortL0 = float(self.short_l0_input.text())/10**15
self.app.calibration.shortL1 = float(self.short_l1_input.text())/10**27
self.app.calibration.shortL2 = float(self.short_l2_input.text())/10**36
self.app.calibration.shortL3 = float(self.short_l3_input.text())/10**45
self.app.calibration.shortL0 = float(self.short_l0_input.text())/10**12
self.app.calibration.shortL1 = float(self.short_l1_input.text())/10**24
self.app.calibration.shortL2 = float(self.short_l2_input.text())/10**33
self.app.calibration.shortL3 = float(self.short_l3_input.text())/10**42
self.app.calibration.shortLength = float(self.short_length.text())/10**12
self.app.calibration.useIdealShort = False
self.app.calibration.openC0 = float(self.open_c0_input.text())/10**12
self.app.calibration.openC1 = float(self.open_c1_input.text())/10**24
self.app.calibration.openC2 = float(self.open_c2_input.text())/10**33
self.app.calibration.openC3 = float(self.open_c3_input.text())/10**42
self.app.calibration.openC0 = float(self.open_c0_input.text())/10**15
self.app.calibration.openC1 = float(self.open_c1_input.text())/10**27
self.app.calibration.openC2 = float(self.open_c2_input.text())/10**36
self.app.calibration.openC3 = float(self.open_c3_input.text())/10**45
self.app.calibration.openLength = float(self.open_length.text())/10**12
self.app.calibration.useIdealOpen = False
@ -320,7 +320,7 @@ class Calibration:
if divisor != 0:
Zop = np.complex(0, -1) / divisor
gammaOpen = ((Zop/50) - 1) / ((Zop/50) + 1)
g2 = gammaOpen * np.exp(np.complex(0, 1) * 2 * 2 * math.pi * f * self.shortLength)
g2 = gammaOpen * np.exp(np.complex(0, 1) * 2 * 2 * math.pi * f * self.shortLength * -1)
else:
g2 = self.openIdeal
if self.useIdealLoad:

Wyświetl plik

@ -211,7 +211,7 @@ class PhaseChart(Chart):
qp.setPen(pen)
for i in range(len(self.data)):
angle = -self.angle(self.data[i])
angle = self.angle(self.data[i])
x = self.leftMargin + 1 + round(self.chartWidth/len(self.data) * i)
y = 30 + round((angle-minAngle)/span*(self.chartHeight-10))
qp.drawPoint(int(x), int(y))
@ -227,12 +227,12 @@ class PhaseChart(Chart):
for i in range(len(self.reference)):
if self.reference[i].freq < fstart or self.reference[i].freq > fstop:
continue
angle = -self.angle(self.reference[i])
angle = self.angle(self.reference[i])
x = self.leftMargin + 1 + round(self.chartWidth*(self.reference[i].freq - fstart)/fspan)
y = 30 + round((angle-minAngle)/span*(self.chartHeight-10))
qp.drawPoint(int(x), int(y))
if self.drawLines and i > 0:
angle = -self.angle(self.reference[i-1])
angle = self.angle(self.reference[i-1])
prevx = x = self.leftMargin + 1 + round(self.chartWidth*(self.reference[i-1].freq - fstart)/fspan)
prevy = 30 + round((angle - minAngle) / span * (self.chartHeight - 10))
qp.setPen(line_pen)
@ -243,7 +243,7 @@ class PhaseChart(Chart):
if m.location != -1:
highlighter.setColor(m.color)
qp.setPen(highlighter)
angle = -self.angle(self.data[m.location])
angle = self.angle(self.data[m.location])
x = self.leftMargin + 1 + round(self.chartWidth/len(self.data) * m.location)
y = 30 + round((angle - minAngle) / span * (self.chartHeight - 10))
qp.drawLine(int(x), int(y) + 3, int(x) - 3, int(y) - 3)
@ -255,7 +255,7 @@ class PhaseChart(Chart):
return self.leftMargin + 1 + round(self.chartWidth * (d.freq - self.fstart) / span)
def getYPosition(self, d: Datapoint) -> int:
angle = -self.angle(d)
angle = self.angle(d)
return 30 + round((angle - self.minAngle) / self.span * (self.chartHeight - 10))
def mouseMoveEvent(self, a0: QtGui.QMouseEvent) -> None: