### Installing qudi-iqo-modules in Development Mode (Shell/Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This sequence of commands clones the 'qudi-iqo-modules' repository and installs it in editable (development) mode using pip. This allows users to easily modify the measurement toolchains. Prerequisites include a working Git installation and an activated Python environment (e.g., 'qudi-env'). ```Shell cd C:/Software git clone https://github.com/Ulm-IQO/qudi-iqo-modules.git cd C:/Software/qudi-iqo-modules python -m pip install -e . ``` -------------------------------- ### Cloning Qudi IQO Configuration Repository Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This Git command clones the qudi-iqo-config repository from GitHub into the current directory. This repository contains configurations for various setups within the institute, providing a centralized and version-controlled location for Qudi configurations. ```Git git clone https://github.com/Ulm-IQO/qudi-iqo-config ``` -------------------------------- ### Installing qudi-iqo-modules from Release Branch (Shell/Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/repo_management/release_workflow.md These commands clone the `qudi-iqo-modules` repository from a specified release branch (`release_vX.0.0`) and then install it in editable mode (`-e .`) into the current Python environment. This setup is crucial for thoroughly testing the package's installation and functionality before a full release. ```Shell git clone https://github.com/Ulm-IQO/qudi-iqo-modules.git --branch release_vX.0.0 cd qudi-iqo-modules python -m pip install -e . ``` -------------------------------- ### Manually Updating qudi-core from GitHub (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This command updates the 'qudi-core' installation directly from the 'main' branch of its GitHub repository. It's a troubleshooting step for resolving incompatibilities between 'qudi-iqo-modules' and older 'qudi-core' versions, ensuring the latest development version is used. ```Python python -m pip install git+https://github.com/Ulm-IQO/qudi-core.git@main ``` -------------------------------- ### Installing nbdime via Conda Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This command installs the nbdime tool using Conda. nbdime is essential for comparing Jupyter notebooks, providing enhanced diff capabilities that are not natively available for .ipynb files in tools like Pycharm. ```Conda conda install nbdime ``` -------------------------------- ### Changing Directory for Qudi Configuration Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This command navigates the console to the specified user directory, which is recommended for storing Qudi configuration files, logs, and data. This ensures proper organization and separation from source code. ```Shell cd C:\Users\quantumguy\qudi ``` -------------------------------- ### Locating qudi-core Site-Packages Folder (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This Python command constructs and prints the path to the 'qudi' package within the 'site-packages' directory of the active Python environment. This is useful for attaching the 'qudi-core' source code to a PyCharm project when it was installed in non-developer mode. ```Python python -c "import os, sys; print(os.path.dirname(sys.executable)+'\\Lib\\site-packages\\qudi')" ``` -------------------------------- ### Rolling Back qudi-iqo-modules to a Stable Release (Shell/Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md These commands allow users to revert the 'qudi-iqo-modules' installation to a specific stable release (v0.6.0) using Git tags, followed by reinstalling it in editable mode. This is useful for resolving bugs related to dependency packages or version incompatibilities. ```Shell cd C:/Software/qudi-iqo-modules git checkout tags/v0.6.0 python -m pip install -e . ``` -------------------------------- ### Installing TestPyPI Release of qudi-iqo-modules (Shell/Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/repo_management/release_workflow.md This command installs a specific development version of `qudi-iqo-modules` from the `test.pypi.org` index, using `pypi.org` as an extra index for other dependencies. This step is vital for verifying the successful deployment and installability of the package from the test PyPI environment before the final production release. ```Shell pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ qudi-iqo-modules== ``` -------------------------------- ### Installing qudi-core for Release Testing (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/repo_management/release_workflow.md This command installs the `qudi-core` package into a new Python environment using pip. It serves as a foundational dependency for testing the `qudi-iqo-modules` installation during the release preparation phase. ```Python python -m pip install qudi-core ``` -------------------------------- ### Locating nbdiff-web Executable Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This command is used to find the full path to the nbdiff-web executable on the system. This path is required when configuring Pycharm's external diff tools to integrate nbdime for Jupyter notebook comparisons. ```Shell where nbdiff-web ``` -------------------------------- ### Example Qudi Toolchain Configuration Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_odmr.md This YAML configuration defines a complete Qudi toolchain, specifying the connections and options for GUI, logic, and hardware modules. It includes detailed settings for a microwave source (mw_source_smiq) and a NI X-series finite sampling input (ni_finite_sampling_input), demonstrating how to set device names, channel units, and other operational parameters. ```YAML gui: odmr_gui: module.Class: 'odmr.odmrgui.OdmrGui' connect: odmr_logic: 'odmr_logic' logic: odmr_logic: module.Class: 'odmr_logic.OdmrLogic' connect: microwave: mw_source_smiq data_scanner: ni_finite_sampling_input hardware: mw_source_smiq: module.Class: 'microwave.mw_source_smiq.MicrowaveSmiq' options: visa_address: 'GPIB0::28::INSTR' comm_timeout: 10000 # in milliseconds visa_baud_rate: null # optional rising_edge_trigger: True # optional frequency_min: null # optional, in Hz frequency_max: null # optional, in Hz power_min: null # optional, in dBm power_max: null # optional, in dBm ni_finite_sampling_input: module.Class: 'ni_x_series.ni_x_series_finite_sampling_input.NIXSeriesFiniteSamplingInput' options: device_name: 'Dev1' digital_channel_units: # optional 'PFI15': 'c/s' analog_channel_units: # optional 'ai0': 'V' 'ai1': 'V' # external_sample_clock_source: 'PFI0' # optional # external_sample_clock_frequency: 1000 # optional adc_voltage_range: [-10, 10] # optional, default [-10, 10] max_channel_samples_buffer: 10000000 # optional, default 10000000 read_write_timeout: 10 # optional, default 10 sample_clock_output: '/Dev1/PFI20' # optional ``` -------------------------------- ### Activating Qudi Python Environment Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This command activates the qudi-env Conda environment (or a virtual environment from another Python distribution). Activating the correct environment is a prerequisite for installing Python packages like nbdime and ensuring all dependencies are met for Qudi operations. ```Conda activate qudi-env ``` -------------------------------- ### Configuring nbdime Parameters in Pycharm Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md These parameters are added to the nbdime configuration in Pycharm's external diff tools settings. They instruct nbdime to ignore specific details, metadata, and outputs when comparing Jupyter notebooks, focusing only on the code and markdown content. ```Configuration --ignore-details --ignore-metadata --ignore-outputs %1 %2 ``` -------------------------------- ### Configuring Timeseries Toolchain with NI X-Series Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_timeseries.md This configuration example sets up the Qudi timeseries toolchain for real-time signal plotting using a NI X-series scanner. It defines the GUI, logic, and hardware modules, specifying their classes, options, and interconnections. The `time_series_gui` connects to the `time_series_reader_logic`, which in turn connects to the `ni_instreamer` hardware module. Options for antialiasing, frame rate, digital frequency calculation, device name, and digital/analog sources are included. ```YAML gui: time_series_gui: module.Class: 'time_series.time_series_gui.TimeSeriesGui' options: use_antialias: True # optional, set to False if you encounter performance issues connect: _time_series_logic_con: time_series_reader_logic logic: time_series_reader_logic: module.Class: 'time_series_reader_logic.TimeSeriesReaderLogic' options: max_frame_rate: 20 # optional (10Hz by default) calc_digital_freq: True # optional (True by default) connect: streamer: ni_instreamer hardware: ni_instreamer: module.Class: 'ni_x_series.ni_x_series_in_streamer.NIXSeriesInStreamer' options: device_name: 'Dev1' digital_sources: # optional - 'PFI8' #analog_sources: # optional #- 'ai0' #- 'ai1' # external_sample_clock_source: 'PFI0' # optional # external_sample_clock_frequency: 1000 # optional adc_voltage_range: [-10, 10] # optional max_channel_samples_buffer: 10000000 # optional read_write_timeout: 10 # optional ``` -------------------------------- ### Registering Qudi Kernel for Old Installation - Shell Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/migrating_from_qudi_v0.1.md This sequence of commands activates the Anaconda environment for the old qudi v0.1 installation, navigates to its core directory, and then installs or registers its Jupyter kernel. This is necessary when switching back to the legacy qudi system. ```Shell activate qudi cd C:\Software\qudi\core python qudikernel.py install ``` -------------------------------- ### Finding Python Environment Executable Path (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/installation_guide.md This Python command prints the directory path of the currently active Python executable. It's used when configuring PyCharm to locate and set the correct project interpreter for the 'qudi-env'. ```Python python -c "import os, sys; print(os.path.dirname(sys.executable))" ``` -------------------------------- ### Spawning Worker Threads with Qudi ThreadManager (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This example demonstrates how to create and manage a custom worker thread using qudi's ThreadManager. It defines a Worker class with a do_stuff method and shows how to move the worker object to a new QThread, connect its execution to the thread's started signal, and manage the thread's lifecycle (start, quit, join) via the ThreadManager. ```Python import time from PySide2.QtCore import QObject, QThread from qudi.core.threadmanager import ThreadManager class Worker(QObject): """ This is a classical worker class that can run a script defined e.g. in "do_stuff" """ def do_stuff(self): print(f'Worker started in thread: "{QThread.currentThread().objectName()}"') # work on stuff, e.g. something that takes 5 seconds to complete time.sleep(5) print(f'Worker finished in thread: "{QThread.currentThread().objectName()}"') def run_in_thread(thread_name='MyThread'): """ This function will spawn and run a new worker thread and waits until it has finished. @param str thread_name: The custom name of the thread to spawn """ # Check if thread manager can be retrieved from the qudi main application thread_manager = ThreadManager.instance() if thread_manager is None: raise RuntimeError('No thread manager found. Qudi application is probably not running.') # Get a newly spawned thread (PySide2.QtCore.QThread) from the thread manager and give it a name my_thread = thread_manager.get_new_thread(thread_name) # Create worker instance and move the worker object to the new thread my_worker = Worker() my_worker.moveToThread(my_thread) # Connect the QThread.started signal to the worker "run"-method. # This will cause the worker to execute its "do_stuff" method as soon as the corresponding # thread is up and running. my_thread.started.connect(my_worker.do_stuff) # Start the thread and let the worker run my_thread.start() # Issue stopping the thread. This will not wait until it has actually stopped. thread_manager.quit_thread(my_thread) # Wait until it has actually finished running and the thread is stopped. # The thread manager will clean up the created thread automatically after it has stopped so # you can not re-run a thread after it has stopped thread_manager.join_thread(my_thread) ``` -------------------------------- ### Registering Qudi Kernel for New Core - Shell Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/migrating_from_qudi_v0.1.md This command sequence activates the Anaconda environment for the new qudi core and then installs or registers its Jupyter kernel. This step is a prerequisite for running the new qudi core after switching from an older version. ```Shell activate qudi-env qudi-install-kernel ``` -------------------------------- ### Declaring New Qudi Interface Inheritance (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This example demonstrates how to declare a custom class that conforms to an interface in the new Qudi core. Classes inheriting from an interface (e.g., `SwitchInterface`) no longer need to explicitly inherit from `Base` as interfaces now inherit from it. ```Python from qudi.interface.switch_interface import SwitchInterface class SwitchDummy(SwitchInterface): pass ``` -------------------------------- ### Upgrading pywin32 to Resolve ImportError (Shell) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This command provides a workaround for an ImportError: DLL load failed while importing win32api on Windows 10 systems after installing the new qudi core. It upgrades the pywin32 package to a specific version (225) using pip, which helps ensure the correct PATH is set, bypassing a potential issue with conda. ```Shell pip install –upgrade pywin32==225 ``` -------------------------------- ### Configuring Scanner GUI (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet configures the 'scanner_gui' module, defining its class, display options like 'image_axes_padding' and 'optimizer_plot_dimensions', and connections to various scanning logic modules. ```YAML gui: scanner_gui: module.Class: 'scanning.scannergui.ScannerGui' options: image_axes_padding: 0.02 default_position_unit_prefix: null # optional, use unit prefix characters, e.g. 'u' or 'n' optimizer_plot_dimensions: [2,1] connect: scanning_logic: scanning_probe_logic data_logic: scanning_data_logic optimize_logic: scanning_optimize_logic ``` -------------------------------- ### Configuring Dummy Scanner Hardware (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet provides a configuration for a 'scanner_dummy' module, useful for testing when no real hardware is available. It defines simulated position, frequency, and resolution ranges, along with accuracy and spot density. ```YAML scanner_dummy: module.Class: 'dummy.scanning_probe_dummy.ScanningProbeDummy' options: position_ranges: 'x': [0, 200e-6] 'y': [0, 200e-6] 'z': [-100e-6, 100e-6] frequency_ranges: 'x': [0, 10000] 'y': [0, 10000] 'z': [0, 5000] resolution_ranges: 'x': [2, 2147483647] 'y': [2, 2147483647] 'z': [2, 2147483647] position_accuracy: 'x': 10e-9 'y': 10e-9 'z': 50e-9 spot_density: 1e11 ``` -------------------------------- ### Configuring Scanning Probe Logic (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet sets up the 'scanning_probe_logic' module, which manages the probe's scanning behavior. It includes options for history length and update intervals, and connects to the 'ni_scanner' hardware. ```YAML scanning_probe_logic: module.Class: 'scanning_probe_logic.ScanningProbeLogic' options: max_history_length: 20 max_scan_update_interval: 2 position_update_interval: 1 connect: scanner: ni_scanner ``` -------------------------------- ### Importing Common Qudi Core Objects (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This snippet lists common objects and utilities frequently used in Qudi modules, including `Connector`, `StatusVar`, `ConfigOption`, and `Mutex` for thread synchronization. All core module imports now require a `qudi.` prefix (e.g., `from qudi.core.connector import Connector`). It is recommended to use `Mutex` over `RecursiveMutex` whenever possible. ```Python from qudi.core.connector import Connector from qudi.core.statusvariable import StatusVar from qudi.core.configoption import ConfigOption from qudi.util.mutex import Mutex, RecursiveMutex # use Mutex over RecursiveMutex whenever possible ``` -------------------------------- ### Declaring New Qudi Interface (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This snippet shows the updated method for declaring interfaces in the new Qudi core. Interfaces now inherit directly from `qudi.core.module.Base` and utilize `abc.abstractmethod` for defining abstract properties and methods, simplifying the interface declaration process. ```Python from abc import abstractmethod from qudi.core.module import Base class DummyInterface(Base): @property @abstractmethod def name(self): """ The name of the Module. @return str: name """ pass ``` -------------------------------- ### Importing New Qudi Core Base Modules (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This snippet shows the updated import statement for base classes in the new Qudi core. Custom Qudi classes should now inherit from `Base`, `LogicBase`, or `GuiBase` imported from `qudi.core.module`. Note that the base class for logic modules has also been renamed. ```Python from qudi.core.module import Base, LogicBase, GuiBase ``` -------------------------------- ### Configuring NI X-series Scanner Hardware (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet configures the 'ni_scanner' hardware interface, mapping NI channels (e.g., 'ao0', 'PFI8') to physical axes and inputs. It also defines position, frequency, and resolution ranges, and connects to 'ni_io' and 'ni_ao'. ```YAML ni_scanner: module.Class: 'interfuse.ni_scanning_probe_interfuse.NiScanningProbeInterfuse' connect: scan_hardware: 'ni_io' analog_output: 'ni_ao' options: ni_channel_mapping: x: 'ao0' y: 'ao1' z: 'ao2' #a: 'ao3' APD1: 'PFI8' #APD2: 'PFI9' #AI0: 'ai0' #APD3: 'PFI10' position_ranges: # in m x: [0, 200e-6] y: [0, 200e-6] z: [-100e-6, 100e-6] frequency_ranges: x: [1, 5000] y: [1, 5000] z: [1, 1000] resolution_ranges: x: [1, 10000] y: [1, 10000] z: [1, 10000] input_channel_units: APD1: 'c/s' #AI0: 'V' #APD2: 'c/s' #APD3: 'c/s' backwards_line_resolution: 50 # optional maximum_move_velocity: 400e-6 #m/s ``` -------------------------------- ### Configuring NI X-series Finite Sampling IO (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet sets up the 'ni_io' module for finite sampling I/O on an NI X-series device. It specifies the 'device_name', input/output channel units, voltage ranges, and output mode for data acquisition and control. ```YAML ni_io: module.Class: 'ni_x_series.ni_x_series_finite_sampling_io.NIXSeriesFiniteSamplingIO' options: device_name: 'Dev1' input_channel_units: # optional PFI8: 'c/s' #PFI9: 'c/s' #PFI10: 'c/s' #ai0: 'V' #ai1: 'V' output_channel_units: 'ao0': 'V' 'ao1': 'V' 'ao2': 'V' adc_voltage_ranges: #ai0: [-10, 10] # optional #ai1: [-10, 10] # optional output_voltage_ranges: ao0: [-10, 10] ao1: [-10, 10] ao2: [-10, 10] frame_size_limits: [1, 1e9] # optional #TODO actual HW constraint? output_mode: 'JUMP_LIST' #'JUMP_LIST' # optional, must be name of SamplingOutputMode read_write_timeout: 10 # optional #sample_clock_output: '/Dev1/PFI11' # optional ``` -------------------------------- ### Declaring Old Qudi Interface (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This snippet illustrates the deprecated method for declaring interfaces in the old Qudi framework. It involved using `InterfaceMetaclass` and `abstract_interface_method` from `core.interface` and `core.meta` to define abstract properties and methods. ```Python from core.interface import abstract_interface_method from core.meta import InterfaceMetaclass class DummyInterface(metaclass=InterfaceMetaclass): @property @abstract_interface_method def name(self): """ The name of the Module. @return str: name """ pass ``` -------------------------------- ### Configuring Scanning Data Logic (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet defines the 'scanning_data_logic' module, responsible for handling scan data. It specifies 'max_history_length' and connects to the 'scanning_probe_logic' for data acquisition. ```YAML scanning_data_logic: module.Class: 'scanning_data_logic.ScanningDataLogic' options: max_history_length: 20 connect: scan_logic: scanning_probe_logic ``` -------------------------------- ### Configuring Scanning Optimization Logic (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet configures the 'scanning_optimize_logic' module, which handles optimization routines. It connects directly to the 'scanning_probe_logic' to influence scanning parameters. ```YAML scanning_optimize_logic: module.Class: 'scanning_optimize_logic.ScanningOptimizeLogic' connect: scan_logic: scanning_probe_logic ``` -------------------------------- ### Configuring NI X-Series In-Streamer in YAML Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This YAML configuration block sets up an NI X-Series In-Streamer for data acquisition. It specifies the device name, optional digital and analog sources, external clock settings, ADC voltage range, buffer size, and read/write timeout. This is crucial for integrating National Instruments hardware for high-speed data streaming. ```YAML ni_instreamer: module.Class: 'ni_x_series.ni_x_series_in_streamer.NIXSeriesInStreamer' options: device_name: 'Dev1' digital_sources: # optional - 'PFI8' #analog_sources: # optional # - 'ai0' # - 'ai1' # external_sample_clock_source: 'PFI0' # optional # external_sample_clock_frequency: 1000 # optional adc_voltage_range: [-10, 10] # optional max_channel_samples_buffer: 10000000 # optional read_write_timeout: 10 # optional ``` -------------------------------- ### Configuring NI X-series Analog Output (Qudi) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This snippet configures the 'ni_ao' module, specifically for analog output on an NI X-series device. It defines the 'device_name' and lists the analog output channels available, such as 'ao0'. ```YAML ni_ao: module.Class: 'ni_x_series.ni_x_series_analog_output.NIXSeriesAnalogOutput' options: device_name: 'Dev1' channels: ao0: ``` -------------------------------- ### Configuring Analog Output Channels in YAML Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/setup_confocal_scanning.md This YAML snippet defines the configuration for multiple analog output (AO) channels (ao0-ao3). Each channel specifies voltage limits and a boolean flag to keep the last set value. This is typically used for controlling analog hardware outputs within the Qudi-IQO system. ```YAML ao0: limits: [-10.0, 10.0] keep_value: True ao1: limits: [-10.0, 10.0] keep_value: True ao2: limits: [-10.0, 10.0] keep_value: True ao3: limits: [-10.0, 10.0] keep_value: True ``` -------------------------------- ### Configuring Threaded Hardware Module in Qudi (Python) Source: https://github.com/ulm-iqo/qudi-iqo-modules/blob/main/docs/module_conversion.md This snippet demonstrates how to force a qudi hardware module to run in its own dedicated thread by setting the _threaded class attribute to True. This is useful for hardware modules that perform long-running operations and should not block the calling thread. ```Python class MyThreadedHardware(MyInterface): _threaded = True ... ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.