some first tests
This commit is contained in:
27
camon.py
Executable file
27
camon.py
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("pvname")
|
||||||
|
clargs = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
from time import sleep
|
||||||
|
from epics import PV
|
||||||
|
|
||||||
|
|
||||||
|
pvname = clargs.pvname
|
||||||
|
pv = PV(pvname)
|
||||||
|
|
||||||
|
def update(value=None, **kwargs):
|
||||||
|
print(value)
|
||||||
|
|
||||||
|
pv.add_callback(update)
|
||||||
|
|
||||||
|
|
||||||
|
while True:
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
38
capicget.py
Normal file
38
capicget.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("pvname")
|
||||||
|
parser.add_argument("height", type=int)
|
||||||
|
parser.add_argument("width", type=int)
|
||||||
|
clargs = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
from matplotlib import pyplot as plt
|
||||||
|
from matplotlib.animation import FuncAnimation
|
||||||
|
from epics import PV
|
||||||
|
|
||||||
|
|
||||||
|
pvname = clargs.pvname
|
||||||
|
height = clargs.height
|
||||||
|
width = clargs.width
|
||||||
|
|
||||||
|
|
||||||
|
pv = PV(pvname)
|
||||||
|
img = pv.value.reshape(height, width)
|
||||||
|
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
isp = plt.imshow(img)
|
||||||
|
|
||||||
|
def update(*args):
|
||||||
|
img = pv.value.reshape(height, width)
|
||||||
|
isp.set_array(img)
|
||||||
|
return isp,
|
||||||
|
|
||||||
|
ani = FuncAnimation(fig, update, blit=True)
|
||||||
|
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
37
capicmon.py
Executable file
37
capicmon.py
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("pvname")
|
||||||
|
parser.add_argument("height", type=int)
|
||||||
|
parser.add_argument("width", type=int)
|
||||||
|
clargs = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
from matplotlib import pyplot as plt
|
||||||
|
from epics import PV
|
||||||
|
|
||||||
|
|
||||||
|
pvname = clargs.pvname
|
||||||
|
height = clargs.height
|
||||||
|
width = clargs.width
|
||||||
|
|
||||||
|
|
||||||
|
pv = PV(pvname)
|
||||||
|
img = pv.value.reshape(height, width)
|
||||||
|
|
||||||
|
fig, ax = plt.subplots()
|
||||||
|
isp = plt.imshow(img)
|
||||||
|
|
||||||
|
def update(value=None, **kwargs):
|
||||||
|
img = value.reshape(height, width)
|
||||||
|
isp.set_array(img)
|
||||||
|
plt.draw()
|
||||||
|
|
||||||
|
pv.add_callback(update)
|
||||||
|
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user