def run(self, initV=0.0, finV=8.0, interval=0.1, onoff='cnf', lo=None, filefmt='csv'): # Print Welcome massage # ---------------------- print('\n\n' ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n' ' C4 NASCO RX : SIS IV curve Measurement \n' ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n' ' ver - {}\n' '\n\n'.format(self.ver)) # Input value check # ----------------- repeat = self.input_value_check(initV=initV, finV=finV, interval=interval) # Check available unit # -------------------- if onoff == 'cnf': onoff = config_handler.Config_handler.check_sis_state() else: pass # Set Driver # ---------- self.driver = sis.multi_box() print('\n' ' PCI board drivers are set.\n' '\n') # == Main ======== # Lo setting # ---------- if lo is None: pass else: self.driver.set_loatt(att=lo) # Measurement part # ---------------- AD_data = self.measure(repeat=repeat, initV=initV, interval=interval, onoff=onoff) # Data saving part # ---------------- datetime = time.strftime('%Y%m%d-%H%M') filename = self.savedir + 'SISIV_{}.{}'.format(datetime, filefmt) header = 'D/A-SISV,' \ '1L-V,1L-I,1R-V,1R-I,2L-V,2L-I,2R-V,2R-I,' \ '3L-V,3L-I,3R-V,3R-I,4L-V,4L-I,4R-V,4R-I,' \ 'LCP-USB-V,LCP-USB-I,LCP-LSB-V,LCP-LSB-I,' \ 'RCP-USB-V,RCP-USB-I,RCP-LSB-V,RCP-LSB-I' numpy.savetxt(filename, AD_data, fmt='%.5f', header=header, delimiter=',') # close sis driver # ---------------- self.driver.close_box() # Data loading # ------------ AD_data = numpy.loadtxt(filename, skiprows=1, delimiter=',') # Plot part # --------- self.ttlplot(AD_data=AD_data, initV=initV, finV=finV, datetime=datetime) # Output information on terminal # ------------------------------ print('\n' ' ======== SIS IV Curve MEASUREMENT ========\n' ' Time Stamp : {}\n' ' Start SIS-V : {} [mV]\n' ' Finish SIS-V : {} [mV]\n' ' Lo Attenuation: !!coming soon!! [mA]\n\n'.format( datetime, initV, finV)) return
def run(self, initV=0.0, finV=8.0, interval=0.1, driver=None, onoff='cnf', reconfigure=False, integ=0.1, filefmt='csv'): # Print Welcome massage # ---------------------- print('\n\n' ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n' ' NASCO RX : SIS Tsys curve Measurement \n' ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n' ' ver - {}\n' '\n\n'.format(self.ver)) # Input value check # ----------------- repeat = self.input_value_check(initV=initV, finV=finV, interval=interval) # Check available unit # -------------------- if onoff == 'cnf': onoff = config_handler.Config_handler.check_sis_state() else: pass # XFFTS client # ------------ client = data_client() # Set Driver # ---------- if driver is None: self.driver = sis.multi_box() else: self.driver = driver print('PCI board drivers are set.') # == Main ======== # Measurement part # ---------------- data = self.Trx_measure(repeat=repeat, initV=initV, interval=interval, onoff=onoff, integ=integ) lo_att = self.driver.query_loatt() # Calculate Y-factor and Tsys # --------------------------- data = self.Trx_calculate(data=data) # Data saving # ----------- datetime = time.strftime('%Y%m%d-%H%M%S') filename = self.savedir + 'SIS_Tsys_curve_{}.{}'.format( datetime, filefmt) header = 'D/A-V,' \ '{0}-V,{0}-I,{1}-V,{1}-I,{2}-V,{2}-I,{3}-V,{3}-I,{4}-V,{4}-I,{5}-V,{5}-I,' \ '{6}-V,{6}-I,{7}-V,{7}-I,{8}-V,{8}-I,{9}-V,{9}-I,{10}-V,{10}-I,{11}-V,{11}-I,' \ 'Phot1,Phot2,Phot3,Phot4,Phot5,Phot6,Phot7,Phot8,' \ 'Phot9,Phot10,Phot11,Phot12,Phot13,Phot14,Phot15,Phot16' \ '{0}-V,{0}-I,{1}-V,{1}-I,{2}-V,{2}-I,{3}-V,{3}-I,{4}-V,{4}-I,{5}-V,{5}-I,' \ '{6}-V,{6}-I,{7}-V,{7}-I,{8}-V,{8}-I,{9}-V,{9}-I,{10}-V,{10}-I,{11}-V,{11}-I,' \ 'Psky1,Psky2,Psky3,Psky4,Psky5,Psky6,Psky7,Psky8,' \ 'Psky9,Psky10,Psky11,Psky12,Psky13,Psky14,Psky15,Psky16' \ 'Yfac1,Yfac2,Yfac3,Yfac4,Yfac5,Yfac6,Yfac7,Yfac8,' \ 'Yfac9,Yfac10,Yfac11,Yfac12,Yfac13,Yfac14,Yfac15,Yfac16,' \ 'Tsys1,Tsys2,Tsys3,Tsys4,Tsys5,Tsys6,Tsys7,Tsys8,' \ 'Tsys9,Tsys10,Tsys11,Tsys12,Tsys13,Tsys14,Tsys15,Tsys16' numpy.savetxt(filename, data, fmt='%.5f', header=header, delimiter=',') # Reconfigure SIS bias setting # ---------------------------- if driver is None: self.driver.close_box() if reconfigure is True: self.Trx_recofigure() # Data loading # ------------ data = numpy.loadtxt(filename, skiprows=1, delimiter=',') return
def run(self, initV=0.0, finV=8.0, interval=0.1, onoff='cnf', lo=[0] * 10): # Print Welcome massage # ---------------------- print('\n\n' ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n' ' NASCO RX : SIS VSWEEP Measurement \n' ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n' ' ver - {}\n' '\n\n'.format(self.ver)) # get using channel and Lo att # ---------------------------- print('== SIS CHANNEL LIST ==\n' ' CH1 : Beam2-L\n' ' CH2 : Beam2-R\n' ' CH3 : Beam3-L\n' ' CH4 : Beam3-R\n' ' CH5 : Beam4-L\n' ' CH6 : Beam4-R\n' ' CH7 : Beam5-L\n' ' CH8 : Beam5-R\n' ' CH9 : Beam1-LU\n' ' CH10 : Beam1-LL\n' ' CH11 : Beam1-RU\n' ' CH12 : Beam1-RL\n') ch1 = int(input(' IF1 ? : ')) ch2 = int(input(' IF2 ? : ')) lo1 = float(input(' IF1 - Lo att [mA] ? : ')) lo2 = float(input(' IF2 - Lo att [mA] ? : ')) # channel handling # ---------------- if lo1 == 9 or lo1 == 10: loch1 = 9 elif lo1 == 11 or lo1 == 12: loch1 = 10 else: loch1 = ch1 pass if lo2 == 9 or lo2 == 10: loch2 = 9 elif lo2 == 11 or lo2 == 12: loch2 = 10 else: loch2 = ch2 pass # create onoff and Lo-list # ------------------------ onoff = [0] * 12 onoff[ch1 - 1] = 1 onoff[ch2 - 1] = 1 lo = [0] * 10 lo[loch1 - 1] = lo1 lo[loch2 - 2] = lo2 # Input value check # ----------------- repeat = self.input_value_check(initV=initV, finV=finV, interval=interval) """ # Check available unit # -------------------- if onoff == 'cnf': onoff = config_handler.Config_handler.check_sis_state() else: pass """ # Set Driver # ---------- self.driver = sis.multi_box() print('PCI board drivers are set.') # set PowerMeter # -------------- self.setup_powermeter() # == Main ======== # Lo setting # ---------- if lo is None: pass else: self.driver.set_loatt(att=lo) # HEMT setting # ------------ self.driver.set_Vd(voltage=[1.1] * 8) self.driver.set_Vg1(voltage=[1.6] * 8) self.driver.set_Vg2(voltage=[1.6] * 8) # Measurement part # ---------------- data = self.measure(repeat=repeat, initV=initV, interval=interval, onoff=onoff) # Calculate Y-factor and Tsys # --------------------------- data = self.trx_calculate(data=data) # Data saving # ----------- datetime = time.strftime('%Y%m%d-%H%M%S') filename = self.savedir + 'c4sis_vsweep_{}.csv'.format(datetime) header = 'D/A-V,' \ '2L-V,2L-I,2R-V,2R-I,3L-V,3L-I,3R-V,3R-I,4L-V,4L-I,4R-V,4R-I,5L-V,5L-I,5R-V,5R-I,' \ '1LU-V,1LU-I,1LL-V,1LL-I,1RU-V,1RU-I,1RL-V,1RL-I,Phot1,Phot2,' \ '2L-V,2L-I,2R-V,2R-I,3L-V,3L-I,3R-V,3R-I,4L-V,4L-I,4R-V,4R-I,5L-V,5L-I,5R-V,5R-I,' \ '1LU-V,1LU-I,1LL-V,1LL-I,1RU-V,1RU-I,1RL-V,1RL-I,Pcold1,Pcold2,Yfac1,Yfac2,Trx1,Trx2' numpy.savetxt(filename, data, fmt='%.5f', header=header, delimiter=',') # Reconfigure SIS bias setting # ---------------------------- self.driver.close_box() # Data loading # ------------ data = numpy.loadtxt(filename, skiprows=1, delimiter=',') # plot part # --------- self.ttlplot(data=data, initV=initV, finV=finV, datetime=datetime, lo=lo1, IF=1, ch=ch1) self.ttlplot(data=data, initV=initV, finV=finV, datetime=datetime, lo=lo2, IF=2, ch=ch2) # Output on Terminal # ------------------ print('\n\n') print('Datetime : {}'.format(datetime)) print('IF1 : ch{}'.format(ch1)) print('IF1 : ch{}'.format(ch2)) print('Lo1 : {} [mA]'.format(lo1)) print('Lo2 : {} [mA]'.format(lo2)) return
def run(self, initI=0.0, finI=2.0, interval=0.05, integ=0.1, hemt=None): # Print Welcome massage # ---------------------- print('\n\n' '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-' 'NASCO RX : Lo Sweep Measurement' '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-' 'ver{}' '\n\n'.format(self.ver)) # get using channel and Lo att # ---------------------------- print('== SIS CHANNEL LIST ==\n' ' CH1 : Beam2-L\n' ' CH2 : Beam2-R\n' ' CH3 : Beam3-L\n' ' CH4 : Beam3-R\n' ' CH5 : Beam4-L\n' ' CH6 : Beam4-R\n' ' CH7 : Beam5-L\n' ' CH8 : Beam5-R\n' ' CH9 : Beam1-LU\n' ' CH10 : Beam1-LL\n' ' CH11 : Beam1-RU\n' ' CH12 : Beam1-RL\n') ch1 = int(input(' IF1 ? : ')) ch2 = int(input(' IF2 ? : ')) sisv1 = float(input(' IF1 - SIS bias [mV] ? : ')) sisv2 = float(input(' IF2 - SIS bias [mV] ? : ')) # input value check # ----------------- repeat = self.input_value_check(initI=initI, finI=finI, interval=interval) # create setV-list # ---------------- setVlist = [0] * 12 setVlist[ch1 - 1] = sisv1 setVlist[ch2 - 1] = sisv2 # Set Driver # ---------- self.driver = sis.multi_box() print('PCI board drivers are set.') # set PowerMeter # -------------- self.setup_powermeter() # == Main ======== # HEMT setting # ------------ if hemt is True: self.driver.set_Vd(voltage=[1.2] * 8) self.driver.set_Vg1(voltage=[0.5] * 8) self.driver.set_Vg2(voltage=[-0.5] * 8) elif hemt is None: pass # Lo setting # ---------- if lo is None: pass else: _ = [50] * 10 self.driver.set_loatt(att=_) input('If setting the SG, input Y') # SIS bias setting # ---------------- self.driver.set_sisv(Vmix=setVlist) # Measurement part # ---------------- result = self.measure(repeat=repeat, initI=initI, interval=interval, integ=integ) # Calculate Y-Factor and Tsys # --------------------------- result = self.trx_calculate(data=result) # Data saving part # ---------------- datetime = time.strftime('%Y%m%d-%H%M') filename = self.savedir + 'c4sis_losweep_{}.csv'.format(datetime) header = 'Loatt,' \ '2L-V,2L-I,2R-V,2R-I,3L-V,3L-I,3R-V,3R-I,4L-V,4L-I,4R-V,4R-I,5L-V,5L-I,5R-V,5R-I,' \ '1LU-V,1LU-I,1LL-V,1LL-I,1RU-V,1RU-I,1RL-V,1RL-I,Phot1,Phot2,' \ '2L-V,2L-I,2R-V,2R-I,3L-V,3L-I,3R-V,3R-I,4L-V,4L-I,4R-V,4R-I,5L-V,5L-I,5R-V,5R-I,' \ '1LU-V,1LU-I,1LL-V,1LL-I,1RU-V,1RU-I,1RL-V,1RL-I,Pcold1,Pcold2,Yfac1,Yfac2,Trx1,Trx2' numpy.savetxt(filename, result, fmt='%.5f', header=header, delimiter=',') # Close sis driver # ---------------------------- self.driver.close_box() # Data loading # ------------ data = numpy.loadtxt(filename, skiprows=1, delimiter=',') # Plot part # --------- self.ttlplot(data=data, initI=initI, finI=finI, datetime=datetime, sisv=sisv1, IF=1, ch=ch1) self.ttlplot(data=data, initI=initI, finI=finI, datetime=datetime, sisv=sisv2, IF=2, ch=ch2) return