def validate_options(self): """Check that the option fields are appropriate """ message = None messages = [] pn = int(self.get_pn()) td = float(self.get_td()) fd = float(self.get_fd()) #ensure ability to pulse more than 65025 pulses n_max_pn, final_pn = self.get_pn_sequence(pn) adjusted_pn, actual_pn, _, _ = parameters.pulse_number(final_pn) total_pn = n_max_pn * parameters.max_pulse_number + actual_pn adjusted_td, actual_td, _ = parameters.trigger_delay(td) adjusted_fd, actual_fd, _ = parameters.fibre_delay(fd) if adjusted_pn is True: self.pn_tkstr.set(total_pn) messages += ["Pulse number adjusted from %d to %s" % (pn, total_pn)] if adjusted_td is True: self.td_tkstr.set(actual_td) messages += ["Trigger delay adjusted from %s to %s" % (td, actual_td)] if adjusted_fd is True: self.fd_tkstr.set(actual_fd) messages += ["Fibre delay adjusted from %s to %s" % (fd, actual_fd)] if messages!=[]: message = ", ".join(m for m in messages) return message
def command_fibre_delay(par): """Get the command to set a fibre delay""" if par > _max_fibre_delay or par < 0: raise tellie_exception.TellieException("Invalid fibre delay: %s" % par) adjusted, adj_delay, setting = parameters.fibre_delay(par) print "COMMAND", par, adjusted, adj_delay, setting if adjusted is True: raise tellie_exception.TellieException("Invalid delay: %s" % (par)) command = [_cmd_fd+chr(setting)] buffer_check = _cmd_fd return command, buffer_check
def command_fibre_delay(par): """Get the command to set a fibre delay""" if par > p._max_fibre_delay or par < 0: raise TellieException("Invalid fibre delay: %s" % par) #parameters = ParametersClass() adjusted, adj_delay, setting = p.fibre_delay(par) print "COMMAND", par, adjusted, adj_delay, setting if adjusted is True: raise TellieException("Invalid delay: %s" % (par)) command = [p._cmd_fibre_delay + chr(setting)] buffer_check = p._cmd_fibre_delay return command, buffer_check
def command_fibre_delay(par): """Get the command to set a fibre delay""" if par > p._max_fibre_delay or par < 0: raise TellieException("Invalid fibre delay: %s" % par) #parameters = ParametersClass() adjusted, adj_delay, setting = p.fibre_delay(par) print "COMMAND", par, adjusted, adj_delay, setting if adjusted is True: raise TellieException("Invalid delay: %s" % (par)) command = [p._cmd_fibre_delay+chr(setting)] buffer_check = p._cmd_fibre_delay return command, buffer_check
def validate_options(self): """Check that the option fields are appropriate """ message = None messages = [] pn = int(self.get_pn()) td = float(self.get_td()) fd = float(self.get_fd()) adjusted_pn,actual_pn,_,_ = parameters.pulse_number(pn) adjusted_td,actual_td,_ = parameters.trigger_delay(td) adjusted_fd,actual_fd,_ = parameters.fibre_delay(fd) if adjusted_pn==True: self.pn_tkstr.set(actual_pn) messages += ["Pulse number adjusted from %d to %s"%(pn,actual_pn)] if adjusted_td==True: self.td_tkstr.set(actual_td) messages += ["Trigger delay adjusted from %s to %s"%(td,actual_td)] if adjusted_fd==True: self.fd_tkstr.set(actual_fd) messages += ["Fibre delay adjusted from %s to %s"%(fd,actual_fd)] if messages!=[]: message = ", ".join(m for m in messages) return message
scope._connection.send("data:stop %i" % data_stop) # 100000 is full scope.lock() # setup the scope and fire box_name = raw_input("set actual box number: ") chan_name = raw_input("set the actual channel number (1-8): ") box_name = int(box_name) chan_name = int(chan_name) chan = (box_name-1) * 8 + chan_name sc.select_channel(chan) sc.set_pulse_height(p._max_pulse_height) sc.set_pulse_width(0) #TODO: check that the pulse width is OK (higher width -> faster rise time) sc.set_pulse_delay(p._pulse_delay) #no zeros on the new chip! sc.set_pulse_number(1) #no zeros on the new chip! adjusted, adj_delay, setting = parameters.fibre_delay(delay_values[chan]) print delay_values[chan],adj_delay,setting sc.set_fibre_delay(adj_delay) # create an output file and save fname = "results_with_offsets/Waveform_Box%02d_Chan%02d" % (box_name,chan_name) results = utils.PickleFile(fname,2) results.set_meta_data("timeform_1",scope.get_timeform(1)) results.set_meta_data("timeform_2",scope.get_timeform(2)) for i in range(1): sc.fire() results.add_data(scope.get_waveform(1),1) results.add_data(scope.get_waveform(2),2) time.sleep(p._short_pause) sc.read_pin()