def __init__(self, parent_directory='/data/cryocon/',dfname=None,frame_len=10):
     self.par_dir=parent_directory
     self.frame_len=frame_len
     if dfname==None:
        self.dfname=str(int(time.time()))
     else:
         self.dfname=dfname
     self.dirname=os.path.join(self.par_dir,self.dfname)
     if os.path.isdir(self.dirname):
         raise Exception('Cannot create dirfile %s. Directory already exists.\n' % self.dirname)
     os.mkdir(self.dirname)
     fmt_file=file(os.path.join(self.dirname,'format'),'w')
     fmt_file.write('time RAW FLOAT64 '+str(self.frame_len)+'\n')
     fmt_file.write('temp_cryocon RAW FLOAT64 '+str(self.frame_len)+'\n')
     fmt_file.write('time_keith1 RAW FLOAT64 '+str(self.frame_len)+'\n')
     fmt_file.write('time_keith2 RAW FLOAT64 '+str(self.frame_len)+'\n')
     fmt_file.write('/REFERENCE time\n')
     fmt_file.close()
     self.time_array=array.array('d',[0.0]*self.frame_len)
     self.temp_array_cryocon=array.array('d',[0.0]*self.frame_len)
     self.time_array_keith1=array.array('d',[0.0]*self.frame_len)
     self.time_array_keith2=array.array('d',[0.0]*self.frame_len)
     self.cc=cryocon.Cryocon()
     self.keith1=keithley.Keithley('Keithley1')
     self.keith2=keithley.Keithley('Keithley2')
     self.pid=np.zeros(1)
示例#2
0
 def run(self):
     cc = cryocon.Cryocon()
     cc.connect()
     f = open("/data/cryocon/temperature.txt", "w")
     start = time.time()
     while True:
         data = cc.temp()
         f.write(data.split('\r')[0] + ' ')
         f.write(str(time.time() - start) + '\n')
     f.close()
     cc.close()
 def __init__(self):
     threading.Thread.__init__(self)
     self.cc = cryocon.Cryocon()