From 1c8918c487d00f4e506e950408472ad671286fc6 Mon Sep 17 00:00:00 2001 From: "Hood, Jonathan D" Date: Fri, 12 Feb 2021 09:17:09 -0500 Subject: [PATCH] routine --- .gitignore | 3 ++ .../__pycache__/aqctl_flir.cpython-38.pyc | Bin 1698 -> 1685 bytes .../flir/__pycache__/driver.cpython-38.pyc | Bin 4214 -> 4253 bytes flir_repo/flir/aqctl_flir.py | 2 +- flir_repo/flir/driver.py | 39 ++++++++++-------- .../picomotor_driver.cpython-38.pyc | Bin 3684 -> 3782 bytes picomotor_repo/picomotor/picomotor_driver.py | 4 +- 7 files changed, 27 insertions(+), 21 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a45af2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ + +*.pyc +*.pyc diff --git a/flir_repo/flir/__pycache__/aqctl_flir.cpython-38.pyc b/flir_repo/flir/__pycache__/aqctl_flir.cpython-38.pyc index 79addbb93176996bb32590f7fbd98bcafbd3b68e..df7d04240421cf8b8f4e384537c6c22e8b007421 100644 GIT binary patch delta 304 zcmYjMJx{|h5Urcm2{Z;O5Nn5uAxy9$7}$_lSXit`AtWX-N^Nv@kQn#_tQH#+Vu1zm zXBe`TAHl!^=XT+SchdW~r+a3PjGZ&K+QXS%?_At}uqQ&edn2ca-{feGqSDd4uu>}s z-Ese6J3*Sn*98z;JQ*Ie4G&pcJ<}#)Pd4-6|_!(X)iu zy$ttvx6s{1SvJe1%Cck({zV=(x~inAy1?8SSVs!R?ss@L<0sdQ*vVTlJoOY5@S;H%8FwWi%K#JV{$T+Vu~|MQgsUwld}`kQ=#IM)0p!Zg(hER zekgp4B`qhjsE8Y6tw50wkh(SbB+GjFTg)k`Wl=mOMWrPf$@!&uC84 diff --git a/flir_repo/flir/__pycache__/driver.cpython-38.pyc b/flir_repo/flir/__pycache__/driver.cpython-38.pyc index d9182ba87e3ee3ec844d9a28fb3c2ee82ff4d94d..e135a7910ecff72b89fc1be0221e6aff31feb5f9 100644 GIT binary patch delta 507 zcmYk2L2DC16vt;~cazOFyRkIXOTnqK)&yEnq)KuSG$nelD8WMmLf6bBCT`L=I}0Wz z^pH}#cpAJ2$}V^l1nCFxwUSnlP`@0&q)nBh_-Lg0A ibyX={$2ZkMY3JgylOC2C(IjeHqj)%;h^qQj`uPvy7=_RP delta 395 zcmYjLO-lk{5Ps*~RoB(sCHgpoklGh|FhsJbOVCPmks_iJ3Z>md!L?rBqGYAObEmiH z6u2F`MEDB|`U9Q9AJC<{=Vm)K56?3*&&kE*0YIdP#2COKT|NG_>Ek9wpdyR;{9xgK!kUeF^JSoD_mLf9!D zK@EH4gnHls_?_wzAZPmDb;Pe-x<_^}`)L33#i%l}6t$!--W?E!?h_05QgX2rJg+%C zn@>S0VDYO{yPYX8)@1RT6F+V`7dGQ!R-2mC1_4%asy0jD|E1`L&5QOW-)vN>f~#hT z#nEO-@un7Lx>&YiClly1MlKfHzR2rvqfL>B4MNhIVGlyi7jIRvf{?bKt{Y6<1jBijIUpV&0JCd diff --git a/flir_repo/flir/aqctl_flir.py b/flir_repo/flir/aqctl_flir.py index c5c73ac..f6b74da 100644 --- a/flir_repo/flir/aqctl_flir.py +++ b/flir_repo/flir/aqctl_flir.py @@ -59,7 +59,7 @@ def main(): truthcounter=1 finally: print("Closing server...") - #dev.close() + # dev.reset() if __name__ == "__main__": main() diff --git a/flir_repo/flir/driver.py b/flir_repo/flir/driver.py index 0ec0a05..46e40ef 100644 --- a/flir_repo/flir/driver.py +++ b/flir_repo/flir/driver.py @@ -53,7 +53,8 @@ def __init__(self): # try: # Set camera serial numbers - serial_1 = '20343286' + serial_1 = '20343286' # abs camera + #serial_2 = '20409335'# fluorescence camera # Get system self.system = PySpin.System.GetInstance() @@ -129,23 +130,25 @@ def await_trigger(self, EXPOSURE_TIME): def convert_image(self,num_of_im): - try: - # Acquire images - images=[] - for i in range(num_of_im): - image = self.cam_1.GetNextImage() - #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() - - self.cam_1.EndAcquisition() - return images - except: - try: - self.cam_1.EndAcquisition() - except: - pass - print("Error in convert_image(), try restarting artiq") + # try: + # Acquire images + images=[] + for i in range(num_of_im): + print("Before GetNextImage") + image = self.cam_1.GetNextImage(5000) #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() + time.sleep(0.01) + + self.cam_1.EndAcquisition() + return images + # except: + # try: + # self.cam_1.EndAcquisition() + # except: + # pass + # print("Error in convert_image(), try restarting artiq") def save_image(self, imagearray):#,image_1, image_2): diff --git a/picomotor_repo/picomotor/__pycache__/picomotor_driver.cpython-38.pyc b/picomotor_repo/picomotor/__pycache__/picomotor_driver.cpython-38.pyc index 7b7441937cc442b486415744c4fb799ec7f3c31d..b3186b6e9ce1c20881f83f36f91dcfea4cffb7bd 100644 GIT binary patch delta 913 zcmZXSzi-n(6vtyHaU3U3^P_=*v`s^j)=AqGA%2P>5~34ZTU0rfO5j8-p^;F&l?@(3n-B0##-cu&^4?mg%O@Xt&n!y!lXf z1^wiSpP%b395!(6iz{|Eet4eYH!r8Z?}?4CUg$pS!>gW-z0h+exaaq{K6)plgs3j9 z8pLe2b^2Z07Sf|e@Ro2%SBTMst$}5mZ7ocati%c4?0^$$o0g$V#IT3WHc2r*Ngp7C zN*>AKM?x;aOZql(!lXN}zzH^Q^huOw&{tAHNYb%%IyrSv%-du}nMhukoj`AeL5uRc z$sE(V-0SvD+w59Iqib?4Ie(;j4MU5FB}5J3dkEc$ z{<+MDEn=jEkQtnyY1vxH?G|DVUFvj)rqyynwsFVyx4@DzeXTq!$5E;XTnZm(PjFlK zuWZB~P5}w2NK|}A z^cDto$Q+5SE3C|K12MwL&bu#CYe0B7_xOI!JMY?`X1-VaTfXlo;`utN-F^AS|FUa? zy{*Fk(0XUKba24kQ(6Xi;EQNN9g0xeBP|OWP=-LT9L&Qs92LxlV{lw_IdB3_is(WG zW<>O07EX!iLltTw=3#DA2^ZKFx$VSnFDXj=Y(r7Tb+t%rZf-_2Zg)6a*LF#HysteZ zYuuqx8}1B~H1323Es0BT?S2=y-iecln>0#y+8ugC{AttzP%F?&`(Xv?$dqToE&?+xNK?j>}IeatNv z&ipmYe&ya@U&bkop2Hd{P}B;oLm4W^maw#fu!?XVA!CDmvwvKbW=~@!M8HqUwKz#b zeWIp|M9b{uK~j%}U@%lNH?;3wfkd2)Gn!XhbFw*(3Me=M^+NQZr_=4O`yR zU=0=45wew^-lK+xNomRT*w#WS{-T8`7TK+%)#!g(o|_ wfb1ed6X7y~_<d&Tuu5^#rA(XKjdeB1DRT(<^TWy diff --git a/picomotor_repo/picomotor/picomotor_driver.py b/picomotor_repo/picomotor/picomotor_driver.py index 12008e9..964509a 100644 --- a/picomotor_repo/picomotor/picomotor_driver.py +++ b/picomotor_repo/picomotor/picomotor_driver.py @@ -9,8 +9,8 @@ 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": [15000, 16000], "MOTz_y":[16000, 16000], "MOTy_x": [16000, 16000], "MOTy_y": [16000, 16000], - "MOTx_x": [16000, 16000], "MOTx_y": [16000, 16000]} # [CW, CCW] number of steps for 1 turn + 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], + "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 def __init__(self, COM_port):