def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) #locking for thread safety self.threadlock = Mutex() self._full_sweep_freq = 2 / 3 self.RampUp_time = np.linspace(0, 1, 100) self.RampUp_signalR = np.linspace(1, 1, 100) self._full_sweep_start = 0.0 self._full_sweep_stop = -3.75 self._acqusition_time = 2.0 self.reflection_channel = 0 self.ramp_channel = 1 self.position_channel = 3 self.velocity_channel = 2 self.SG_scale = 10 # V self.lamb = 637e-9 # wavelenght self.current_mode_number = 10 self.current_sweep_number = 1 self.first_sweep = None self.first_corrected_resonances = None self.last_sweep = None self.last_corrected_resonances = None self.mode_shift_list = [0] self._current_filepath = r'C:\BittorrentSyncDrive\Personal - Rasmus\Rasmus notes\Measurements\test'
def on_activate(self): """ Connect and configure the access to the FPGA. """ # Create an instance of the Opal Kelly FrontPanel. The Frontpanel is a # c dll which was wrapped with SWIG for Windows type systems to be # accessed with python 3.4. You have to ensure to use the python 3.4 # version to be able to run the Frontpanel wrapper: self._fpga = ok.FrontPanel() # threading self.threadlock = Mutex() # TTL output status of the 8 channels self._switch_status = { 1: False, 2: False, 3: False, 4: False, 5: False, 6: False, 7: False, 8: False } self._connected = False # connect to the FPGA module self._connect() return
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.log.debug('The following configuration was found.') #number of lines in the matrix plot self.NumberOfSecondsLog = 100 self.threadlock = Mutex()
def __init__(self, **kwargs): """ Initialzize a logic module. @param dict kwargs: dict of additional arguments """ super().__init__(**kwargs) self.taskLock = Mutex()
def __init__(self, config, **kwargs): """ Create CounterLogic object with connectors. @param dict config: module configuration @param dict kwargs: optional parameters """ super().__init__(config=config, **kwargs) #locking for thread safety self.threadlock = Mutex() self.log.debug('The following configuration was found.') # checking for the right configuration for key in config.keys(): self.log.debug('{0}: {1}'.format(key, config[key])) # in bins self._count_length = 300 self._smooth_window_length = 10 self._counting_samples = 1 # oversampling # in hertz self._count_frequency = 50 # self._binned_counting = True # UNUSED? self._counting_mode = CountingMode['CONTINUOUS'] self._saving = False return
def __init__(self, name, runner, references, config, **kwargs): """ Create a PrePostTask. @param str name: unique name of the task @param object runner: TaskRunner that manages this task @param dict references: contains references to all required modules @param dict config: configuration parameter dictionary """ _default_callbacks = {'onprerun': self._pre, 'onpostrun': self._post} _stateList = { 'initial': 'stopped', 'events': [{ 'name': 'prerun', 'src': 'stopped', 'dst': 'paused' }, { 'name': 'postrun', 'src': 'paused', 'dst': 'stopped' }], 'callbacks': _default_callbacks } if 'PyQt5' in sys.modules: super().__init__(cfg=_stateList, **kwargs) else: QtCore.QObject.__init__(self) Fysom.__init__(self, _stateList) self.lock = Mutex() self.name = name self.runner = runner self.ref = references self.config = config
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.log.info('The following configuration was found.') # checking for the right configuration for key in config.keys(): self.log.info('{0}: {1}'.format(key, config[key])) # setting standard parameter for refocus self.refocus_XY_size = 0.6 self.optimizer_XY_res = 10 self.refocus_Z_size = 2 self.optimizer_Z_res = 30 self.hw_settle_time = 0.1 # let scanner reach start of xy and z scans # Initialization of settings option for optimization sequence self.optimization_sequence = ['XY', 'Z'] # settings option for surface subtraction in depth scan self.do_surface_subtraction = False self.surface_subtr_scan_offset = 1 # micron # locking for thread safety self.threadlock = Mutex() self.stopRequested = False self.is_crosshair = True # Keep track of who called the refocus self._caller_tag = ''
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._fpga = None self.threadlock = Mutex() self._switch_status = dict() self._connected = False
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) # locking for thread safety self.lock = Mutex() # name of active POI, default to empty string self.active_poi_name = '' # Some default variables concerning the operating system: self.os_system = None # Chech which operation system is used and include a case if the # directory was not found in the config: if sys.platform in ('linux', 'darwin'): self.os_system = 'unix' self.data_dir = self._unix_data_dir elif 'win32' in sys.platform or 'AMD64' in sys.platform: self.os_system = 'win' self.data_dir = self._win_data_dir else: raise Exception('Identify the operating system.') # start logging into daily directory? if not isinstance(self.log_into_daily_directory, bool): self.log.warning( 'log entry in configuration is not a ' 'boolean. Falling back to default setting: False.') self.log_into_daily_directory = False self._daily_loghandler = None
def __init__(self, **kwargs): """ Create SpectrumLogic object with connectors and status variables loaded. @param dict kwargs: optional parameters """ super().__init__(**kwargs) self.threadlock = Mutex() # Public attributes self.spectro_constraints = None self.camera_constraints = None # Private attributes self._cooler_status = None self._grating = None self._center_wavelength = None self._input_ports = None self._output_ports = None self._input_port = None self._output_port = None self._input_slit_width = None self._output_slit_width = None self._read_mode = None self._trigger_mode = None self._loop_counter = None self._loop_timer = None self._acquisition_params = None
def __init__(self, **kwargs): super().__init__(**kwargs) #locking for thread safety self.threadlock = Mutex() self.GRAN_MIN = 2 # minimal possible granuality in time, in ns. self.FREQ_MAX = int(1/self.GRAN_MIN *1000) # Maximal output frequency.
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) #locking for thread safety self.threadlock = Mutex() # the current wavelength read by the wavemeter in nm (vac) self._current_wavelength = 0.0
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.log.info('The following configuration was found.') # checking for the right configuration for key in config.keys(): self.log.info('{0}: {1}'.format(key, config[key])) # locking for thread safety self.threadlock = Mutex()
def __init__(self, config, **kwargs): """ Create logic object @param dict config: configuration in a dict @param dict kwargs: additional parameters as a dict """ super().__init__(config=config, **kwargs) self.threadlock = Mutex()
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.threadlock = Mutex() self.log.info('The following configuration was found.') # checking for the right configuration for key in config.keys(): self.log.info('{0}: {1}'.format(key, config[key])) # locking for thread safety self.threadlock = Mutex() self._count_length = 50 self._bin_width = 500 self._refresh_time = 1000 # in ms self._saving = False
def __init__(self, **kwargs): """ Create SpectrometerLogic object with connectors. @param dict kwargs: optional parameters """ super().__init__(**kwargs) # locking for thread safety self.threadlock = Mutex()
def __init__(self, config, **kwargs): """ Creae flip mirror control module @param object manager: reference to module manager @param str name: unique module name @param dict config; configuration parameters in a dict @param dict kwargs: aditional parameters in a dict """ super().__init__(config=config, **kwargs) self.lock = Mutex()
def __init__(self, manager, name, config=None, **kwargs): if config is None: config = {} c_dict = { 'onactivate': self.activation, 'ondeactivate': self.deactivation } PiPWM.__init__(self, manager, name, **kwargs) #locking for thread safety self.threadlock = Mutex()
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) # locking for thread safety self.threadlock = Mutex() self.stopRequested = False self.is_crosshair = True # Keep track of who called the refocus self._caller_tag = ''
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.log.info('The following configuration was found.') # checking for the right configuration for key in config.keys(): self.log.info('{0}: {1}'.format(key, config[key])) #number of lines in the matrix plot self.NumberOfSecondsLog = 100 self.threadlock = Mutex()
def __init__(self, **kwargs): """ Create VoltageScanningLogic object with connectors. @param dict kwargs: optional parameters """ super().__init__(**kwargs) # locking for thread safety self.threadlock = Mutex() self.stopRequested = False
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) # timer for the periodic refocus self.__timer = None self._last_refocus = 0 self._periodic_refocus_poi = None # threading self._threadlock = Mutex() return
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) # locking for thread safety self.lock = Mutex() self.log.info('The following configuration was found.') # name of active POI, default to empty string self.active_poi_name = '' # Some default variables concerning the operating system: self.os_system = None self.default_unix_data_dir = 'Data' self.default_win_data_dir = 'C:/Data/' # Chech which operation system is used and include a case if the # directory was not found in the config: if sys.platform in ('linux', 'darwin'): self.os_system = 'unix' if 'unix_data_directory' in config: self.data_dir = config['unix_data_directory'] else: self.data_dir = self.default_unix_data_dir elif 'win32' in sys.platform or 'AMD64' in sys.platform: self.os_system = 'win' if 'win_data_directory' in config.keys(): self.data_dir = config['win_data_directory'] else: self.data_dir = self.default_win_data_dir else: self.log.error('Identify the operating system.') # start logging into daily directory? if 'log_into_daily_directory' in config.keys(): if not isinstance(config['log_into_daily_directory'], bool): self.log.warning( 'log entry in configuration is not a ' 'boolean. Falling back to default setting: False.') self.log_into_daily_directory = False else: self.log_into_daily_directory = config[ 'log_into_daily_directory'] else: self.log.warning('Configuration has no entry log. Falling back ' 'to default setting: False.') self.log_into_daily_directory = False self._daily_loghandler = None # checking for the right configuration for key in config.keys(): self.log.info('{0}: {1}'.format(key, config[key]))
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.threadlock = Mutex() self._statusvar = -1 # fast counter state self._switching_voltage = dict() self._binwidth = -1 # number of elementary bins to be combined into a single bin self._gate_length_bins = -1 # number of bins in one gate (max 65536) self._number_of_gates = -1 # number of gates in the pulse sequence (max 512) self.count_data = None self.saved_count_data = None # Count data stored to continue measurement self._fpga = None
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self._current_poi_key = None self.go_to_crosshair_after_refocus = False # default value # timer and its handling for the periodic refocus self.timer = None self.time_left = 0 self.timer_step = 0 self.timer_duration = 300 # locking for thread safety self.threadlock = Mutex()
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.log.info('The following configuration was found.') # checking for the right configuration for key in config.keys(): self.log.info('{0}: {1}'.format(key, config[key])) # number of lines in the matrix plot self.number_of_lines = 50 self.threadlock = Mutex() self.stopRequested = False self._clear_odmr_plots = False
def on_activate(self, e): """ Connect and configure the access to the FPGA. @param object e: Event class object from Fysom. An object created by the state machine module Fysom, which is connected to a specific event (have a look in the Base Class). This object contains the passed event the state before the event happens and the destination of the state which should be reached after the event has happen. """ config = self.getConfiguration() if 'fpga_serial' in config.keys(): self._serial = config['fpga_serial'] else: self.log.error( 'No parameter "fpga_serial" specified in the config! Set the ' 'serial number for the currently used fpga counter!\nOpen the Opal ' 'Kelly Frontpanel to obtain the serial number of the connected FPGA.\n' 'Do not forget to close the Frontpanel before starting the Qudi program.' ) # Create an instance of the Opal Kelly FrontPanel. The Frontpanel is a # c dll which was wrapped with SWIG for Windows type systems to be # accessed with python 3.4. You have to ensure to use the python 3.4 # version to be able to run the Frontpanel wrapper: self._fpga = ok.FrontPanel() # threading self.threadlock = Mutex() # TTL output status of the 8 channels self._switch_status = { 1: False, 2: False, 3: False, 4: False, 5: False, 6: False, 7: False, 8: False } self._connected = False # connect to the FPGA module self._connect() return
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.powers = [] self.psat_data = [] self.psat_fit_x = [] self.psat_fit_y = [] self.fitted_Isat = 0.0 self.fitted_Psat = 0.0 self.fitted_offset = 0.0 self.psat_fitted = False self.psat_collected = False #locking for thread safety self.threadlock = Mutex()
def on_activate(self): """ Initialisation performed during activation of the module. """ self._powermeter = self.powermeter1() self._daq_card = self.confocalscanner1() #### activate the NI card AO channel self.z_range = self._daq_card.get_position_range()[2] # Initialise the current position of all four scanner channels. self.current_position = self._daq_card.get_scanner_position() # initialise the range for scanning # self.scan_range = [0.0, 1.0] # self.set_scan_range(self.scan_range) self._static_v = 0. # Keep track of the current static voltage even while a scan may cause the real-time # voltage to change. self.goto_voltage(self._static_v) # set power meter self._powermeter.set_wavelength(600.0) self._powermeter.set_autorange(1) # PID self.pid_status = False self.ramp_status = False self.setpoint = 0. self.polarity = 1 self.kp, self.ki, self.kd = 500, 1, 0 self.min_pid_out, self.max_pid_out = 0., 0.4 self.min_volt, self.max_volt = 0., 0.8 self.ramping_factor = 0.01 self.offset = 0 self.error_p_prev = 0. self.power_prev = 0. self.error_p = 0 self.error_i = 0 self.error_d = 0 self.output = 0 self.time_loop = [] self.power = None self.error = None # Thread self.threadlock = Mutex() self.sigPowerDataNext.connect(self.set_power, QtCore.Qt.QueuedConnection) return
def __init__(self, config, **kwargs): super().__init__(config=config, **kwargs) self.log.info('The following configuration was found.') # checking for the right configuration for key in config.keys(): self.log.info('{0}: {1}'.format(key, config[key])) # locking for thread safety self.threadlock = Mutex() self.stopRequested = False self.is_crosshair = True # Keep track of who called the refocus self._caller_tag = ''