Files
caplot/prototypes/capicget.py
2021-05-08 13:51:56 +02:00

39 lines
655 B
Python

#!/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()