Updated scrips
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
@@ -70,15 +70,17 @@ class ClientMdsThin():
|
|||||||
adc_bits = data[:, 0].astype(int)
|
adc_bits = data[:, 0].astype(int)
|
||||||
adc_bits &= 0x3
|
adc_bits &= 0x3
|
||||||
ch_trg = np.zeros(adc_bits.shape, dtype='int')
|
ch_trg = np.zeros(adc_bits.shape, dtype='int')
|
||||||
ch_trg[adc_bits==1] = 2
|
ch_trg[adc_bits == 1] = 2 # trigger bits
|
||||||
ch_trg[adc_bits==2] = 1
|
ch_trg[adc_bits == 2] = 1
|
||||||
ch_trg[adc_bits==3] = 3
|
ch_trg[adc_bits == 3] = 3
|
||||||
# breakpoint()
|
# breakpoint()
|
||||||
|
"""
|
||||||
for i, a in enumerate(adc_bits):
|
for i, a in enumerate(adc_bits):
|
||||||
if a == 1:
|
if a == 1:
|
||||||
print(f"found Trigger in {i}")
|
print(f"found Trigger in {i}")
|
||||||
elif a == 3:
|
elif a == 3:
|
||||||
print(f"found Trigger in {i}")
|
print(f"found Trigger in {i}")
|
||||||
|
"""
|
||||||
self.choppTrigg = ch_trg
|
self.choppTrigg = ch_trg
|
||||||
|
|
||||||
def calcEoWo(self):
|
def calcEoWo(self):
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
This script plots the MARTe2 ATCAIop samples stored in MDSplus
|
This script plots the MARTe2 ATCAIop samples stored in MDSplus
|
||||||
|
caput -a ISTTOK:central:ATCAIOP1-EO 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
caput -a ISTTOK:central:ATCAIOP1-WO 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
"""
|
"""
|
||||||
# import numpy as np
|
# import numpy as np
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
glay.addWidget(pw1, 0, 0)
|
glay.addWidget(pw1, 0, 0)
|
||||||
# self.setCentralWidget(gr_wid)
|
# self.setCentralWidget(gr_wid)
|
||||||
self.setCentralWidget(cw)
|
self.setCentralWidget(cw)
|
||||||
self.setWindowTitle('pyqtgraph ISTTOK')
|
self.setWindowTitle(f"pyqtgraph ISTTOK shot: {args.shot}")
|
||||||
|
|
||||||
# p1 = gr_wid.addPlot(0,0, 1,1, title="raw data")
|
# p1 = gr_wid.addPlot(0,0, 1,1, title="raw data")
|
||||||
start_ch = args.crange[0] - 1
|
start_ch = args.crange[0] - 1
|
||||||
@@ -86,7 +86,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
for i in range(start_ch, end_ch):
|
for i in range(start_ch, end_ch):
|
||||||
dataAdc = self.mclient.adcRawData[i]
|
dataAdc = self.mclient.adcRawData[i]
|
||||||
pw1.plot(dataAdc[:args.maxpoints], pen=pg.mkPen(i, width=1),
|
pw1.plot(dataAdc[:args.maxpoints], pen=pg.mkPen(i, width=1),
|
||||||
name="ch {}".format(i))
|
name="ch {}".format(i + 1))
|
||||||
|
|
||||||
pw2 = pg.PlotWidget(name='Integ data')
|
pw2 = pg.PlotWidget(name='Integ data')
|
||||||
pw2.addLegend()
|
pw2.addLegend()
|
||||||
@@ -100,7 +100,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
if (args.zero):
|
if (args.zero):
|
||||||
data -= data[0] # / 2.0e6 # LSB * sec
|
data -= data[0] # / 2.0e6 # LSB * sec
|
||||||
pw2.plot(data[:args.maxpoints], pen=pg.mkPen(i, width=1),
|
pw2.plot(data[:args.maxpoints], pen=pg.mkPen(i, width=1),
|
||||||
name="ch {}".format(i))
|
name="ch {}".format(i + 1))
|
||||||
|
|
||||||
ylim = args.yrange
|
ylim = args.yrange
|
||||||
if (ylim > 0.0):
|
if (ylim > 0.0):
|
||||||
@@ -117,7 +117,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
#, pen=(255,0,0), name="Red curve")
|
#, pen=(255,0,0), name="Red curve")
|
||||||
|
|
||||||
# sub1 = gr_wid.addLayout(0,2, 1,2)
|
# sub1 = gr_wid.addLayout(0,2, 1,2)
|
||||||
pw3 = pg.PlotWidget(name='Chop Trigg')
|
pw3 = pg.PlotWidget(name='Chop Trigger')
|
||||||
pw3.setXLink('Plot1')
|
pw3.setXLink('Plot1')
|
||||||
data = self.mclient.choppTrigg
|
data = self.mclient.choppTrigg
|
||||||
pw3.plot(data[:args.maxpoints], pen=pg.mkPen(i, width=1))
|
pw3.plot(data[:args.maxpoints], pen=pg.mkPen(i, width=1))
|
||||||
|
|||||||
Reference in New Issue
Block a user