Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
cryvisil/transferimage_save.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 lines (23 sloc)
606 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#all imports | |
import pvaccess | |
import time | |
from datetime import datetime | |
import numpy as np | |
import epics | |
from epics import caget ,cainfo ,caput ,camonitor | |
import matplotlib.pyplot as plt | |
import os | |
import PIL | |
from PIL import Image | |
#get data from pv | |
channel = pvaccess.Channel("CRYVISIL:13PS2:image1:ArrayData") | |
dict = channel.get("field(value)") | |
arr = dict["value"] | |
#create image | |
img = arr.reshape(964,1292) | |
x = plt.imshow(img, cmap='gray') | |
#plt.show() | |
#save image | |
timestamp = time.strftime("%Y-%m-%d-%H:%M:%S") | |
print timestamp | |
plt.savefig('cryvisil/Transfer_images/Transfer_image_' + timestamp + '.png') |