Skip to content

Commit

Permalink
Routine Push
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodjd committed Mar 4, 2021
1 parent dd44771 commit 29fa21c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Binary file modified flir_repo/flir/__pycache__/driver.cpython-38.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion flir_repo/flir/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def get_image(self,num_of_im):
images=[]
for i in range(num_of_im):
# print("Before GetNextImage")
image = self.cam_1.GetNextImage(10000) #timeout (ms) 10000
image = self.cam_1.GetNextImage(20000) #timeout (ms) 10000
# print("Picture Successfully taken at: ",time.strftime("%d %b %Y %H:%M:%S", time.localtime()))
images.append(np.array(image.GetData(),dtype="uint16").reshape((image.GetHeight(),image.GetWidth()))) #convert PySpin ImagePtr into numpy array
image.Release()
Expand Down
Binary file not shown.
11 changes: 6 additions & 5 deletions picomotor_repo/picomotor/picomotor_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
import numpy as np
#import os

# 'sipyco_rpctool ::1 3210 list-methods' will list the methods of this driver. use 'sipyco_rpctool ::1 3210 call <method> <argument1 argument2 ...>' e.g. sipyco_rpctool ::1 3210 call move 'MOTx_x' <value>

class picomotor:
axis_names = { "MOTz_x": "112", "MOTz_y": "122", "MOTy_x": "232", "MOTy_y": "242", "MOTx_x": "212", "MOTx_y": "222"}
steps_in_turn = { "MOTz_x": [45650/3, 48500/3], "MOTz_y":[58000/3, 59400/3], "MOTy_x": [90150/3, 69000/3], "MOTy_y": [87400/3, 62500/3],
steps_in_turn = { "MOTz_x": [45650/3, 48500/3], "MOTz_y":[58000/3, 71400/3], "MOTy_x": [90150/3, 69000/3], "MOTy_y": [65500/3, 62500/3],
"MOTx_x": [45300/3, 51000/3], "MOTx_y": [51100/3, 51900/3]} # [CW, CCW] number of steps for 1 turn, using numbers from OneNote 2/8/20 calibration


# Original MOTY values: "MOTy_x": [90150/3, 69000/3], "MOTy_y": [87400/3, 62500/3],
# "MOTz_y":[58000/3, 59400/3] [58000/3, 69400/3]
def __init__(self, COM_port):
"""Open serial connection for NewFocus 8732 controller"""
"""COM_port: ie 'COM3' (check device manager) """
Expand Down Expand Up @@ -68,7 +69,7 @@ def move(self, axis="MOTx_x", steps=1000, velocity=1500):
cmd4 = ":SOUR:PULS:COUN " + str(round(abs(steps)))

cmd = cmd1 + "; " + cmd2 + "; " + cmd3 #+ "; " + cmd4
print(cmd)
# print(cmd)
self.sendreceive(cmd)
time.sleep(0.01)
self.sendreceive(cmd4)
Expand Down Expand Up @@ -108,7 +109,7 @@ def wait_for_move(self):
""" Wait for picomotor to finish moving """
timeout = 120 # timeout seconds
moving = 0
print("ran wait successfully")
# print("ran wait successfully")
while moving==0: #OPC returns 1 if all channels are finished
time.sleep(0.2)
text = self.sendreceive("*OPC?")
Expand Down

0 comments on commit 29fa21c

Please sign in to comment.