def __init__(self, master, stage, sphere, lakeshore, bk): self.stop_exposures = False self.master = master self.stage = stage self.sphere = sphere self.bk = bk self.lakeshore = lakeshore self.vbb = 0.0 CfgFile = "/sandbox/lsst/lsst/GUI/UCDavis.cfg" if self.CheckIfFileExists(CfgFile): self.CfgFile = CfgFile else: print "Configuration file %s not found. Exiting.\n"%CfgFile sys.exit() return self.edtsaodir = eolib.getCfgVal(self.CfgFile,"EDTSAO_DIR") self.EDTdir = eolib.getCfgVal(self.CfgFile,"EDT_DIR") self.vendor = eolib.getCfgVal(self.CfgFile,"CCD_MANU").strip() self.ccd_sern = eolib.getCfgVal(self.CfgFile,"CCD_SERN").strip() if not (self.vendor == "ITL" or self.vendor == "E2V"): print "Vendor not recognized. Exiting." sys.exit() self.fitsfilename = "dummy.fits" # Just a dummy - not really used self.relay = InterfaceKit() return
def exp_acq(self, exptime=0.0, fitsfilename='test.fits'): """Python version of the CamCmd exp_acq script""" NoFlushFile = eolib.getCfgVal(self.CfgFile,"EXP_NO_FLUSH_FILE") if not self.CheckIfFileExists(NoFlushFile): print "No Flush File not found. Exiting exp_acq" return FlushFile = eolib.getCfgVal(self.CfgFile,"EXP_FLUSH_FILE") if not self.CheckIfFileExists(FlushFile): print "Flush File not found. Exiting exp_acq" return #print "Before fclr, time = ",time.time() self.runcmd([self.edtsaodir+"/fclr", "2"]) # clear the CCD #print "After fclr, time = ",time.time() self.runcmd([self.edtsaodir+"/edtwriten", "-c", "50000080"]) # setup for tens of millisecond exposure time #print "After edtwriten, time = ",time.time() self.runcmd([self.edtsaodir+"/edtwriteblk", "-f", NoFlushFile]) # load the signal file to stop parallel flushing #print "After edtwriteblk, time = ",time.time() self.runcmd([self.edtsaodir+"/expose", str(exptime)]) # do the exposure #print "After expose, time = ",time.time() time.sleep(1.0) # delay for shutter to close all the way? #print "Before image16, time = ",time.time() if self.vendor == "ITL": self.runcmd([self.edtsaodir+"/image16", "-F", "-f", fitsfilename, "-x", "542", "-y", "2022", "-n", "16"]) # readout elif self.vendor == "E2V": self.runcmd([self.edtsaodir+"/image16", "-F", "-f", fitsfilename, "-x", "572", "-y", "2048", "-n", "16"]) # readout self.runcmd([self.edtsaodir+"/edtwriteblk", "-f", FlushFile]) # load the signal file to re-start parallel flushing #print "After edtwriteblk, time = ",time.time() return
def ccd_timing(self): """Python version of the sta3800_timing script""" print "Setting up CCD default timing...\n" Par_Clk_Delay = int(eolib.getCfgVal(self.CfgFile,"PAR_CLK_DELAY")) print "Setting parallel clock delay to %d\n"%Par_Clk_Delay self.master.update() self.runcmd([self.edtsaodir+"/edtwriten", "-c", "46000%03x"%Par_Clk_Delay]) # Set parallel clock delay to 6 SigBFile = eolib.getCfgVal(self.CfgFile,"TIM_FILE") if not self.CheckIfFileExists(SigBFile): print "Signal file not found. May need to run Perl conversion routine. Exiting ccd_timing" return print "Loading serial readout signal file %s\n"%SigBFile self.master.update() self.runcmd([self.edtsaodir+"/edtwriteblk", "-f", SigBFile]) # load the signal file PatBFile = eolib.getCfgVal(self.CfgFile,"PAT_FILE") if not self.CheckIfFileExists(PatBFile): print "Pattern file not found. May need to run Perl conversion routine. Exiting ccd_timing" self.master.update() return print "Loading default pattern file %s\n"%PatBFile self.master.update() self.runcmd([self.edtsaodir+"/edtwriteblk", "-f", PatBFile]) # load the pattern file print "ccd_timing done.\n" self.master.update() return
def eoflat(self, acqcfgfile, CCDID): """ Acquire flat image pairs for linearity and gain measurement. For each 'flat' command in the config file a pair of flat field images are acquired :type self: Bench :type acqcfgfile: string :type CCDID: string :return: """ self.CCDready() B.PhD.setup_current_measurements(2e-6) # B.PhD.send() # TODO: to set PLC rate nplc = 1 # see if need to turn off vacuum gauge here too (electronic noise, glow) # print "Now collect some parameters from the config file" lo_lim = float(eolib.getCfgVal(acqcfgfile, "FLAT_LOLIM", default="0.1")) hi_lim = float(eolib.getCfgVal(acqcfgfile, "FLAT_HILIM", default="120.0")) bcount = float(eolib.getCfgVal(acqcfgfile, "FLAT_BCOUNT", default="2")) wl = float(eolib.getCfgVal(acqcfgfile, "FLAT_WL", default="550.0")) imcount = 2 seq = 0 # image pair number in sequence # set filter here ccd = CCDID print "Working on CCD %s" % ccd # go through config file looking for 'flat' instructions, take the flats print "Scanning config file for FLAT specifications" fp = open(acqcfgfile, "r") fpfiles = open("%s/acqfilelist" % cdir, "w") owl = 0.0 flux = 0.0 for line in fp: tokens = str.split(line) if (len(tokens) > 0) and (tokens[0] == "flat"): target = float(tokens[1]) print "target exposure = %d" % (target) # exptime = eolib.expCheck(calfile, labname, target, wl, hi_lim, lo_lim, test='FLAT', use_nd=False) # take bias images print "set controller for bias exposure"
def dark_acq(self, exptime=0.0, fitsfilename='test.fits'): """Python version of the CamCmd dark_acq script""" NoFlushFile = eolib.getCfgVal(self.CfgFile,"DARK_NO_FLUSH_FILE") if not self.CheckIfFileExists(NoFlushFile): print "No Flush File not found. Exiting dark_acq" self.master.update() return FlushFile = eolib.getCfgVal(self.CfgFile,"DARK_FLUSH_FILE") if not self.CheckIfFileExists(FlushFile): print "Flush File not found. Exiting dark_acq" self.master.update() return self.runcmd([self.edtsaodir+"/fclr", "2"]) # clear the CCD self.runcmd([self.edtsaodir+"/edtwriten", "-c", "50000080"]) # setup for tens of millisecond exposure time self.runcmd([self.edtsaodir+"/edtwriteblk", "-f", NoFlushFile]) # load the signal file to stop parallel flushing self.runcmd([self.edtsaodir+"/dark", str(exptime)]) # do the exposure if self.vendor == "ITL": self.runcmd([self.edtsaodir+"/image16", "-F", "-f", fitsfilename, "-x", "542", "-y", "2022", "-n", "16"]) # readout elif self.vendor == "E2V": self.runcmd([self.edtsaodir+"/image16", "-F", "-f", fitsfilename, "-x", "572", "-y", "2048", "-n", "16"]) # readout self.runcmd([self.edtsaodir+"/edtwriteblk", "-f", FlushFile]) # load the signal file to re-start parallel flushing return
def ccd_setup(self): """Python version of the sta3800_setup script""" self.GetVoltageLookup() self.sixteen_ch_setup() print "Setting up CCD ...\n" self.master.update() self.ccd_timing() self.ccd_channels() self.ccd_volts() self.ccd_offsets() gain = eolib.getCfgVal(self.CfgFile,"GAIN_MODE") self.gain(gain) print "ccd_setup done.\n" self.master.update() return
def sixteen_ch_setup(self): """Python version of the CamCmd 16ch_setup script""" print "Setting up for generic 16 channel readout...\n" # initialize edt interface InitFile = eolib.getCfgVal(self.CfgFile,"INIT_FILE") if not self.CheckIfFileExists(InitFile): print "Init File not found. Exiting sixteen channel setup" return #self.runcmd(["initrcx0"]) # This script just does the following: self.runcmd([self.EDTdir+"/initcam", "-u", "0", "-c", "0", "-f", InitFile]) self.runcmd([self.edtsaodir+"/crst"]) # Camera reset # Turn off the greyscale generator print "Turning greyscale generator off\n" self.runcmd([self.edtsaodir+"/edtwriten", "-c", "30400000"]) # ad board #1 gray scale off self.runcmd([self.edtsaodir+"/edtwriten", "-c", "31400000"]) # ad board #2 gray scale off self.runcmd([self.edtsaodir+"/edtwriten", "-c", "32400000"]) # ad board #3 gray scale off self.runcmd([self.edtsaodir+"/edtwriten", "-c", "33400000"]) # ad board #4 gray scale off # Set the system gain to high # Note that this gets over-ridden in ccd_setup. self.gain("HIGH") # Set unidirectional mode print "Setting unidirectional CCD serial shift mode\n" self.runcmd([self.edtsaodir+"/edtwriten", "-c", "43000001"]) # uni on # Set split mode on. "Why on?" you ask. Beats me. print "Setting CCD serial register shifts to split mode\n" self.runcmd([self.edtsaodir+"/edtwriten", "-c", "41000001"]) # split on self.ccd_channels() print "Setting default ADC offsets\n" self.ccd_offsets() self.Check_Communications() print "16ch_setup Done.\n" self.master.update() return
archon_version = "" ts_revision = "" archon_revision = "" ts_version,archon_version,ts_revision,archon_revision = eolib.EOgetCCSVersions(tssub,cdir) eolib.EOSetup(tssub,CCDID,CCSCCDTYPE,cdir,acffile,vac_outlet,arcsub) arcsub.synchCommand(10,"setParameter","Light","0"); arcsub.synchCommand(10,"setParameter","Fe55","0"); print "Setting the current ranges on the Bias and PD devices" # biassub.synchCommand(10,"setCurrentRange",0.0002) pdsub.synchCommand(10,"setCurrentRange",0.000002) wl = float(eolib.getCfgVal(acqcfgfile, 'PPUMP_WL', default = "550.0")) pcount = int(eolib.getCfgVal(acqcfgfile, 'PPUMP_BCOUNT', default = "25")) imcount = 2 print "setting the monochromator wavelength" # if (exptime > lo_lim): result = monosub.synchCommand(120,"setWaveAndFilter",wl); rwl = result.getResult() time.sleep(10.) #number of PLCs between readings nplc = 1 seq = 0 # image pair number in sequence monosub.synchCommand(30,"setFilter",1);
ts_revision = "" archon_revision = "" ts_version,archon_version,ts_revision,archon_revision = eolib.EOgetCCSVersions(tssub,cdir) # make sure the BSS is off biassub.synchCommand(10,"setVoltage",0.0) eolib.EOSetup(tssub,CCDID,CCSCCDTYPE,cdir,acffile,vac_outlet,arcsub,"setTSIdle","setTSIdle") print "Setting the current ranges on the Bias and PD devices" biassub.synchCommand(10,"setCurrentRange",0.0002) pdsub.synchCommand(10,"setCurrentRange",0.00002) lo_lim = float(eolib.getCfgVal(acqcfgfile, 'LAMBDA_LOLIM', default='1.0')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'LAMBDA_HILIM', default='120.0')) bcount = int(eolib.getCfgVal(acqcfgfile, 'LAMBDA_BCOUNT', default='1')) # imcount = int(eolib.getCfgVal(acqcfgfile, 'LAMBDA_IMCOUNT', default='1')) imcount = 1 seq = 0 #number of PLCs between readings nplc = 1 ccd = CCDID result = arcsub.synchCommand(10,"setCCDnum",ccd) print "Working on CCD %s" % ccd print "set filter position"
# prepare TS8: make sure temperature and vacuum are OK and load the sequencer # eolib.EOSetup(tssub,RAFTID,CCSRAFTTYPE,cdir,sequence_file,vac_outlet,ts8sub) result = monosub.synchCommand(20,"openShutter"); # full path causes length problem: /home/ts8prod/lsst/redhat6-x86_64-64bit-gcc44/test/jh_inst/0.3.23/harnessed-jobs-0.3.23/config/BNL/sequencer-ts8-ITL-v4.seq acffile = "/home/ts8prod/workdir/sequencer-ts8-ITL-v4.seq" print "sequencer file = %s " % acffile result = ts8sub.synchCommand(90,"loadSequencer",acffile); # stop ticking so that register reads won't interfer ts8sub.synchCommand(10,"change tickMillis 0"); lo_lim = float(eolib.getCfgVal(acqcfgfile, 'FLAT_LOLIM', default='1.0')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'FLAT_HILIM', default='120.0')) bcount = int(eolib.getCfgVal(acqcfgfile, 'FLAT_BCOUNT', default='1')) imcount = int(eolib.getCfgVal(acqcfgfile, 'FLAT_IMCOUNT', default='2')) wl = float(eolib.getCfgVal(acqcfgfile, 'FLAT_WL', default = "550.0")) bcount = 1 seq = 0 #number of PLCs between readings nplc = 1.0 # raft = RAFTID raft = CCDID print "Working on RAFT %s" % raft
ccdmanunames["20"] = CCDMANUS20 ccdnames["21"] = CCDS21 ccdmanunames["21"] = CCDMANUS21 ccdnames["22"] = CCDS22 ccdmanunames["22"] = CCDMANUS22 except: pass # prepare TS8: make sure temperature and vacuum are OK and load the sequencer rafttype = "ITL" eolib.EOTS8Setup(tssub,ts8sub,raft,rafttype,ccdnames,ccdmanunames,cdir,sequence_file,vac_outlet) result = monosub.synchCommand(20,"openShutter"); lo_lim = float(eolib.getCfgVal(acqcfgfile, '%s_LOLIM' % acqname, default='0.025')) hi_lim = float(eolib.getCfgVal(acqcfgfile, '%s_HILIM' % acqname, default='600.0')) bcount = int(eolib.getCfgVal(acqcfgfile, '%s_BCOUNT' % acqname, default='1')) imcount = int(eolib.getCfgVal(acqcfgfile, '%s_IMCOUNT' % acqname, default='1')) bcount = 1 seq = 0 #number of PLCs between readings nplc = 1.0 print "Working on RAFT %s" % raft # go through config file looking for instructions print "Scanning config file for specifications"; fp = open(acqcfgfile,"r");
# prepare TS8: make sure temperature and vacuum are OK and load the sequencer rafttype = "ITL" eolib.EOTS8Setup(tssub, ts8sub, rebpssub, raft, rafttype, cdir, sequence_file, vac_outlet) rebs = ts8sub.synchCommand(10, "getREBDevices").getResult() # Note about testing LVDS signal control: # for rebid in rebs : # result = ts8sub.synchCommand(10,"writeRegister "+rebid+" 0x100000 0x10000"); acqcfgfile = rtmacqcfgfile lo_lim = float( eolib.getCfgVal(acqcfgfile, '%s_LOLIM' % acqname, default='0.025')) hi_lim = float( eolib.getCfgVal(acqcfgfile, '%s_HILIM' % acqname, default='600.0')) # image count if 'FLAT' in acqname: imcount = int( eolib.getCfgVal(acqcfgfile, '%s_IMCOUNT' % acqname, default='2')) else: imcount = int( eolib.getCfgVal(acqcfgfile, '%s_IMCOUNT' % acqname, default='1')) wl = float(eolib.getCfgVal(acqcfgfile, '%s_WL' % acqname, default="550.0")) # move to default wl if domono: print "Setting monochromator wl to default value"
# go through config file looking for instructions, execute arcsub.synchCommand(10,"setFitsDirectory","%s" % (cdir)); #number of PLCs between readings nplc = 1.0 ccd = CCDID print "Working on CCD %s" % ccd # seq = 0 lseq = 0 dseq = 0 bseq = 0 lo_lim = float(eolib.getCfgVal(acqcfgfile, 'PERSIST_LOLIM', default='1.0')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'PERSIST_HILIM', default='120.0')) print "Scanning config file for persist specifications"; fp = open(acqcfgfile,"r"); fpfiles = open("%s/acqfilelist" % cdir,"w"); result = arcsub.synchCommand(10,"setCCDnum",ccd) for line in fp: tokens = str.split(line) if ((len(tokens) > 0) and (tokens[0] == 'persist')): acqtype = int(tokens[1]) print "line = %s" % line print "number of tokens = %d" % len(tokens)
def GetOffsetLookup(self): try: self.offset_lookup = [ # Lookup table with channel offsets {"Segment":1, "Channel":1, "chan":"3008", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_1"))}, {"Segment":2, "Channel":5, "chan":"3108", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_2"))}, {"Segment":3, "Channel":2, "chan":"3018", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_3"))}, {"Segment":4, "Channel":6, "chan":"3118", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_4"))}, {"Segment":5, "Channel":3, "chan":"3028", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_5"))}, {"Segment":6, "Channel":7, "chan":"3128", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_6"))}, {"Segment":7, "Channel":4, "chan":"3038", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_7"))}, {"Segment":8, "Channel":8, "chan":"3138", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_8"))}, {"Segment":9, "Channel":9, "chan":"3208", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_9"))}, {"Segment":10, "Channel":13, "chan":"3308", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_10"))}, {"Segment":11, "Channel":10, "chan":"3218", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_11"))}, {"Segment":12, "Channel":14, "chan":"3318", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_12"))}, {"Segment":13, "Channel":11, "chan":"3228", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_13"))}, {"Segment":14, "Channel":15, "chan":"3328", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_14"))}, {"Segment":15, "Channel":12, "chan":"3238", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_15"))}, {"Segment":16, "Channel":16, "chan":"3338", "offset":int(eolib.getCfgVal(self.CfgFile,"OFF_SEG_16"))}] except Exception as e: print "Secment offset lookup routine failed! Exception of type %s and args = \n"%type(e).__name__, e.args self.master.update() return
cdir = tsCWD ts_version = "" archon_version = "" ts_revision = "" archon_revision = "" ts_version,archon_version,ts_revision,archon_revision = eolib.EOgetCCSVersions(tssub,cdir) eolib.EOSetup(tssub,CCDID,CCSCCDTYPE,cdir,acffile,vac_outlet,arcsub) arcsub.synchCommand(10,"setParameter","Light","0"); arcsub.synchCommand(10,"setParameter","Fe55","0"); bcount = int(eolib.getCfgVal(acqcfgfile, 'DARK_BCOUNT', default = "3")) # wait until its dark .... very dark time.sleep(30.) # go through config file looking for 'dark' instructions, take the darks arcsub.synchCommand(10,"setFitsDirectory","%s" % (cdir)); #number of PLCs between readings nplc = 1.0 ccd = CCDID print "Working on CCD %s" % ccd seq = 0
print "Exception in initialization" # make sure it is ready to respond quickly arcsub.synchCommand(10,"setParameter","ExpTime","0"); arcsub.synchCommand(10,"setParameter","WaiTime","200"); # make sure all is quiescent before sending commands to the ammeters time.sleep(5.0) print "Setting the current ranges on the Bias and PD devices" # biassub.synchCommand(10,"setCurrentRange",0.0002) pdsub.synchCommand(60,"setCurrentRange",0.00002) seq = 0 # image pair number in sequence lo_lim = float(eolib.getCfgVal(acqcfgfile, 'SFLAT_LOLIM', default='1.0')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'SFLAT_HILIM', default='120.0')) bcount = int(eolib.getCfgVal(acqcfgfile, 'SFLAT_BCOUNT', default = "5")) #number of PLCs between readings nplc = 1 ccd = CCDID print "Working on CCD %s" % ccd arcsub.synchCommand(10,"setParameter","Fe55","0"); # clear the buffers print "doing some unrecorded bias acquisitions to clear the buffers" print "set controller for bias exposure" arcsub.synchCommand(10,"setParameter","Light","0");
print "Exception in initialization" # make sure it is ready to respond quickly arcsub.synchCommand(10, "setParameter", "ExpTime", "0") arcsub.synchCommand(10, "setParameter", "WaiTime", "200") # make sure all is quiescent before sending commands to the ammeters time.sleep(5.0) print "Setting the current ranges on the Bias and PD devices" # biassub.synchCommand(10,"setCurrentRange",0.0002) pdsub.synchCommand(60, "setCurrentRange", 0.00002) seq = 0 # image pair number in sequence lo_lim = float(eolib.getCfgVal(acqcfgfile, 'SFLAT_LOLIM', default='1.0')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'SFLAT_HILIM', default='120.0')) bcount = int(eolib.getCfgVal(acqcfgfile, 'SFLAT_BCOUNT', default="5")) #number of PLCs between readings nplc = 1 ccd = CCDID print "Working on CCD %s" % ccd arcsub.synchCommand(10, "setParameter", "Fe55", "0") # clear the buffers print "doing some unrecorded bias acquisitions to clear the buffers" print "set controller for bias exposure" arcsub.synchCommand(10, "setParameter", "Light", "0")
# get the software versions to include in the data products to be persisted in the DB # ts_version,ts8_version,ts_revision,ts8_revision = eolib.EOgetCCSVersions(tssub,cdir) # prepare TS8: make sure temperature and vacuum are OK and load the sequencer # eolib.EOSetup(tssub,RAFTID,CCSRAFTTYPE,cdir,sequence_file,vac_outlet,ts8sub) result = monosub.synchCommand(20,"openShutter"); acffile = "/home/ts8prod/workdir/sequencer-ts8-ITL-v4.seq" print "sequencer file = %s " % acffile result = ts8sub.synchCommand(90,"loadSequencer",acffile); lo_lim = float(eolib.getCfgVal(acqcfgfile, 'DARK_LOLIM', default='1.0')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'DARK_HILIM', default='120.0')) bcount = int(eolib.getCfgVal(acqcfgfile, 'DARK_BCOUNT', default='1')) imcount = int(eolib.getCfgVal(acqcfgfile, 'DARK_IMCOUNT', default='1')) bcount = 1 seq = 0 #number of PLCs between readings nplc = 1.0 # raft = RAFTID raft = CCDID print "Working on RAFT %s" % raft
starttim = time.time() while True: print "checking"; result = tssub.synchCommand(10,"istsready"); tsstate = result.getResult(); # the following line is just for test situations so that there would be no waiting tsstate=1; if ((time.time()-starttim)>240): print "Something is wrong ... we will never make it to a runnable state" exit if tsstate!=0 : break #put in acquisition state tssub.synchCommand(120,"goteststand"); targflux = float(eolib.getCfgVal(acqcfgfile, 'FLUXCAL_TARGET', default='5000')) exp_hilim = float(eolib.getCfgVal(acqcfgfile, 'FLUXCAL_HILIM', default='60')) exp_lolim = float(eolib.getCfgVal(acqcfgfile, 'FLUXCAL_LOLIM', default='2.0')) print("FLUXCAL: START") print("FLUXCAL: Calibration directory : %s" % fluxcaldir) # find the most recent calibration file and use that as source files = sorted(glob.glob(fluxcaldir+'/fluxcal*.txt')) if (len(files) != 0): print "Number of fluxcal files =", len(files) lastcal = files[len(files)-1] else: lastcal = 'None' print("FLUXCAL: Last calibration file = %s" % lastcal)
WriteBiasVolt(fp, arcsub, "VBB_V") fp.close() try: print "set controller parameters for an exposure with the shutter closed" arcsub.synchCommand(10, "setParameter", "Light", "0") arcsub.synchCommand(10, "setParameter", "Fe55", "0") # arcsub.synchCommand(10,"setDefaultCCDTypeName","BNLITL"); # retract the Fe55 arm # xedsub.synchCommand(30,"retractFe55"); print "Now collect some parameters from the config file" bcount = int(eolib.getCfgVal(acqcfgfile, 'FE55_BCOUNT', default="2")) dcount = int(eolib.getCfgVal(acqcfgfile, 'FE55_DCOUNT', default="2")) seq = 0 #number of PLCs between readings nplc = 1 ccd = CCDID print "Working on CCD %s" % ccd # clear the buffers print "doing some unrecorded bias acquisitions to clear the buffers" print "set controller for bias exposure" arcsub.synchCommand(10, "setParameter", "Light", "0") arcsub.synchCommand(10, "setParameter", "ExpTime", "0")
def GetVoltageLookup(self): self.vbb = 0.0 try: self.voltage_lookup = [ # Lookup table with voltage values {"Name":"VCLK_LO", "Value": float(eolib.getCfgVal(self.CfgFile,"VCLK_LO")), "Vmin": 0.0, "Vmax": 10.0, "chan":["a0188"]}, {"Name":"VCLK_HI", "Value": float(eolib.getCfgVal(self.CfgFile,"VCLK_HI")), "Vmin": 0.0, "Vmax": 10.0, "chan":["a0080"]}, {"Name":"VV4", "Value": float(eolib.getCfgVal(self.CfgFile,"VV4")), "Vmin": -5.0, "Vmax": 5.0, "chan":["a0280"]}, {"Name":"VDD", "Value": float(eolib.getCfgVal(self.CfgFile,"VDD")), "Vmin": 0.0, "Vmax": 30.0, "chan":["a0380"]}, {"Name":"VRD", "Value": float(eolib.getCfgVal(self.CfgFile,"VRD")), "Vmin": 0.0, "Vmax": 20.0, "chan":["a0384"]}, {"Name":"VOD", "Value": float(eolib.getCfgVal(self.CfgFile,"VOD")), "Vmin": 0.0, "Vmax": 30.0, "chan":["a0388","a038c"]}, {"Name":"VOG", "Value": float(eolib.getCfgVal(self.CfgFile,"VOG")), "Vmin": -5.0, "Vmax": 5.0, "chan":["a0288","a028c"]}, {"Name":"PAR_CLK_LO", "Value": float(eolib.getCfgVal(self.CfgFile,"PAR_CLK_LO")), "Vmin":-10.0, "Vmax": 0.0, "chan":["a0184"]}, {"Name":"PAR_CLK_HI", "Value": float(eolib.getCfgVal(self.CfgFile,"PAR_CLK_HI")), "Vmin": 0.0, "Vmax": 10.0, "chan":["a0084"]}, {"Name":"SER_CLK_LO", "Value": float(eolib.getCfgVal(self.CfgFile,"SER_CLK_LO")), "Vmin":-10.0, "Vmax": 0.0, "chan":["a0180"]}, {"Name":"SER_CLK_HI", "Value": float(eolib.getCfgVal(self.CfgFile,"SER_CLK_HI")), "Vmin": 0.0, "Vmax": 10.0, "chan":["a008c"]}, {"Name":"RG_LO", "Value": float(eolib.getCfgVal(self.CfgFile,"RG_LO")), "Vmin":-10.0, "Vmax": 0.0, "chan":["a018c"]}, {"Name":"RG_HI", "Value": float(eolib.getCfgVal(self.CfgFile,"RG_HI")), "Vmin": 0.0, "Vmax": 10.0, "chan":["a0088"]}] self.vbb = float(eolib.getCfgVal(self.CfgFile,"BSS_TEST")) except Exception as e: print "Voltage lookup routine failed! Exception of type %s and args = \n"%type(e).__name__, e.args return
ts_version = "" archon_version = "" ts_revision = "" archon_revision = "" ts_version, archon_version, ts_revision, archon_revision = eolib.EOgetCCSVersions( tssub, cdir) eolib.EOSetup(tssub, CCDID, CCSCCDTYPE, cdir, acffile, vac_outlet, arcsub) print "Setting the current ranges on the Bias and PD devices" pdsub.synchCommand(10, "setCurrentRange", 0.000002) print "Now collect some parameters from the config file" lo_lim = float(eolib.getCfgVal(acqcfgfile, 'FLAT_LOLIM', default='0.1')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'FLAT_HILIM', default='120.0')) bcount = int(eolib.getCfgVal(acqcfgfile, 'FLAT_BCOUNT', default="2")) wl = float(eolib.getCfgVal(acqcfgfile, 'FLAT_WL', default="550.0")) imcount = 2 #number of PLCs between readings nplc = 1 seq = 0 # image pair number in sequence ccd = CCDID print "Working on CCD %s" % ccd arcsub.synchCommand(10, "setParameter", "Fe55", "0")
ccdnames["21"] = CCDS21 ccdmanunames["21"] = CCDMANUS21 ccdnames["22"] = CCDS22 ccdmanunames["22"] = CCDMANUS22 except: pass # prepare TS8: make sure temperature and vacuum are OK and load the sequencer rafttype = "ITL" eolib.EOTS8Setup(tssub, ts8sub, raft, rafttype, ccdnames, ccdmanunames, cdir, sequence_file, vac_outlet) result = monosub.synchCommand(20, "openShutter") lo_lim = float( eolib.getCfgVal(acqcfgfile, '%s_LOLIM' % acqname, default='0.025')) hi_lim = float( eolib.getCfgVal(acqcfgfile, '%s_HILIM' % acqname, default='600.0')) bcount = int( eolib.getCfgVal(acqcfgfile, '%s_BCOUNT' % acqname, default='1')) imcount = int( eolib.getCfgVal(acqcfgfile, '%s_IMCOUNT' % acqname, default='1')) bcount = 1 seq = 0 #number of PLCs between readings nplc = 1.0 print "Working on RAFT %s" % raft
WriteBiasVolt(fp,arcsub,"VBB_V"); fp.close(); try: print "set controller parameters for an exposure with the shutter closed" arcsub.synchCommand(10,"setParameter","Light","0"); arcsub.synchCommand(10,"setParameter","Fe55","0"); # arcsub.synchCommand(10,"setDefaultCCDTypeName","BNLITL"); # retract the Fe55 arm # xedsub.synchCommand(30,"retractFe55"); print "Now collect some parameters from the config file" bcount = int(eolib.getCfgVal(acqcfgfile, 'FE55_BCOUNT', default = "2")) dcount = int(eolib.getCfgVal(acqcfgfile, 'FE55_DCOUNT', default = "2")) seq = 0 #number of PLCs between readings nplc = 1 ccd = CCDID print "Working on CCD %s" % ccd # clear the buffers print "doing some unrecorded bias acquisitions to clear the buffers" print "set controller for bias exposure" arcsub.synchCommand(10,"setParameter","Light","0"); arcsub.synchCommand(10,"setParameter","ExpTime","0");
# go through config file looking for instructions, execute arcsub.synchCommand(10, "setFitsDirectory", "%s" % (cdir)) #number of PLCs between readings nplc = 1.0 ccd = CCDID print "Working on CCD %s" % ccd # seq = 0 lseq = 0 dseq = 0 bseq = 0 lo_lim = float(eolib.getCfgVal(acqcfgfile, 'PERSIST_LOLIM', default='1.0')) hi_lim = float( eolib.getCfgVal(acqcfgfile, 'PERSIST_HILIM', default='120.0')) print "Scanning config file for persist specifications" fp = open(acqcfgfile, "r") fpfiles = open("%s/acqfilelist" % cdir, "w") result = arcsub.synchCommand(10, "setCCDnum", ccd) for line in fp: tokens = str.split(line) if ((len(tokens) > 0) and (tokens[0] == 'persist')): acqtype = int(tokens[1]) print "line = %s" % line print "number of tokens = %d" % len(tokens)
cdir = tsCWD ts_version = "" archon_version = "" ts_revision = "" archon_revision = "" ts_version, archon_version, ts_revision, archon_revision = eolib.EOgetCCSVersions( tssub, cdir) eolib.EOSetup(tssub, CCDID, CCSCCDTYPE, cdir, acffile, vac_outlet, arcsub) pdsub.synchCommand(10, "setCurrentRange", 0.000002) lo_lim = float(eolib.getCfgVal(acqcfgfile, 'LAMBDA_LOLIM', default='1.0')) hi_lim = float(eolib.getCfgVal(acqcfgfile, 'LAMBDA_HILIM', default='120.0')) bcount = int(eolib.getCfgVal(acqcfgfile, 'LAMBDA_BCOUNT', default='1')) imcount = int(eolib.getCfgVal(acqcfgfile, 'LAMBDA_IMCOUNT', default='1')) seq = 0 #number of PLCs between readings nplc = 1.0 ccd = CCDID print "Working on CCD %s" % ccd # print "set filter position" # monosub.synchCommand(30,"setFilter",1); # open position
ts_revision = "" archon_revision = "" ts_version, archon_version, ts_revision, archon_revision = eolib.EOgetCCSVersions( tssub, cdir) eolib.EOSetup(tssub, CCDID, CCSCCDTYPE, cdir, acffile, vac_outlet, arcsub) arcsub.synchCommand(10, "setParameter", "Light", "0") arcsub.synchCommand(10, "setParameter", "Fe55", "0") print "Setting the current ranges on the Bias and PD devices" # biassub.synchCommand(10,"setCurrentRange",0.0002) pdsub.synchCommand(10, "setCurrentRange", 0.000002) wl = float(eolib.getCfgVal(acqcfgfile, 'PPUMP_WL', default="550.0")) pcount = int(eolib.getCfgVal(acqcfgfile, 'PPUMP_BCOUNT', default="25")) imcount = 2 print "setting the monochromator wavelength" # if (exptime > lo_lim): result = monosub.synchCommand(120, "setWaveAndFilter", wl) rwl = result.getResult() time.sleep(10.) #number of PLCs between readings nplc = 1 seq = 0 # image pair number in sequence monosub.synchCommand(30, "setFilter", 1)