Skip to content

Commit

Permalink
Added save functionality and a base terascan cfg file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Cerjan committed Mar 11, 2025
1 parent 2f90d87 commit a26f425
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 5 deletions.
116 changes: 116 additions & 0 deletions cfg/terascan.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
global:
# list of modules to load when starting
startup_modules: []

# Module server configuration for accessing qudi GUI/logic/hardware modules from remote clients
remote_modules_server:
address: 'localhost'
port: 12345

# Server port for serving the active qudi module namespace locally (localhost).
# Used by e.g. the Qudi jupyter kernel.
namespace_server_port: 18861

# If this flag is set (True), all arguments passed to qudi module APIs from remote
# (jupyter notebook, qudi console, remote modules) will be wrapped and passed "per value"
# (serialized and de-serialized). This is avoiding a lot of inconveniences with using numpy in
# remote clients.
# If you do not want to use this workaround and know what you are doing, you can disable this
# feature by setting this flag to False.
force_remote_calls_by_value: True

# Qss stylesheet for controlling the appearance of the GUIs.
# Absolute path or relative to qudi.artwork.styles
stylesheet: 'qdark.qss'

# Default root directory for measurement data storage. All eventual data sub-directories should
# be contained within this directory. This is not enforced, just convention.
# The fallback directory is <user home>/qudi/Data/
# default_data_dir: C:\Users\neverhorst\qudi\Data

# Save data to daily data sub-directories by default
daily_data_dirs: True


gui:
terascan_gui:
module.Class: 'terascan.terascan_gui.TerascanGui'
connect:
terascan_logic: terascan_logic

logic:
terascan_logic:
module.Class: 'terascan_logic.TerascanLogic'
connect:
laser: scanning_laser_logic
wavemeter: time_series_reader_logic
counter: fast_counter_logic
daq: daq_reader_logic # Note that this logic assumes there is exactly one (digital) input to the DAQ.
options:
record_length_ms: 1 # Length of data (in ms) to take at each wavelength. Only integers.


daq_reader_logic:
module.Class: 'common.daq_reader_logic.DAQReaderLogic'
connect:
daq: daq_dummy
options:
update_interval: 0 # Period in ms to check for data updates. Integers only. 0 is as fast as possible


time_series_reader_logic:
module.Class: 'common.data_in_stream_logic.DataInStreamLogic'
options:
max_frame_rate: 20 # optional (default: 20Hz)
channel_buffer_size: 1048576 # optional (default: 1MSample)
max_raw_data_bytes: 1073741824 # optional (default: 1GB)
connect:
streamer: instream_dummy


fast_counter_logic:
module.Class: 'common.fast_counter_logic.FastCounterLogic'
connect:
fast_counter: fast_counter_dummy


scanning_laser_logic:
module.Class: 'common.scanning_laser_logic.ScanningLaserLogic'
connect:
laser: scanning_laser_dummy
options:
min_wavelength: 0.775 # in um
max_wavelength: 0.790 # in um


hardware:

daq_dummy:
module.Class: 'dummy.daq_reader_dummy.DAQReaderDummy'

instream_dummy:
module.Class: 'dummy.data_instream_dummy.InStreamDummy'
options:
channel_names:
- 'digital 1'
- 'analog 1'
- 'digital 2'
channel_units:
- 'Hz'
- 'V'
- 'Hz'
channel_signals: # Can be 'counts' or 'sine'
- 'counts'
- 'sine'
- 'counts'
data_type: 'float64'
sample_timing: 'CONSTANT' # Can be 'CONSTANT', 'TIMESTAMP' or 'RANDOM'

fast_counter_dummy:
module.Class: 'dummy.fast_counter_dummy.FastCounterDummy'


laser_dummy:
module.Class: 'dummy.scanning_laser_dummy.ScanningLaserDummy'


13 changes: 12 additions & 1 deletion src/qudi/gui/terascan/terascan_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from PySide2 import QtCore
from typing import List

from qudi.util.datastorage import TextDataStorage
from qudi.core.module import GuiBase
from qudi.core.connector import Connector
from qudi.core.statusvariable import StatusVar
Expand Down Expand Up @@ -45,6 +46,7 @@ def on_activate(self) -> None:
self._mw.start_wavelength.valueChanged.connect(self._start_changed)
self._mw.stop_wavelength.valueChanged.connect(self._stop_changed)
self._mw.start_stop_button.clicked.connect(self._start_stop_pressed)
self._mw.action_save_data.triggered.connect(self._save_data)

# Connect all signals to and from the logic. Make sure the connections are QueuedConnection.
# Inputs:
Expand Down Expand Up @@ -118,6 +120,7 @@ def _start_stop_pressed(self) -> None:
""" Qt slot to be called upon wavelength change """
if self._mw.start_stop_button.text() == 'Start Measurement':
self._mw.start_stop_button.setText('Stop Measurement')
self._mw.plot_widget.setXRange(self._start_wavelength, self._stop_wavelength)
self.sigStartMeasurement.emit()
else:
self._mw.start_stop_button.setText('Start Measurement')
Expand All @@ -140,4 +143,12 @@ def _receive_data(self, data: List[TerascanData]) -> None:
@QtCore.Slot(float)
def _wavelength_changed(self, wave: float) -> None:
self._current_wavelength = wave


@QtCore.Slot()
def _save_data(self) -> None:
ds = TextDataStorage(
root_dir=self.module_default_data_dir,
column_formats='.15e'
)

ds.save_data(self._data)
1 change: 0 additions & 1 deletion src/qudi/gui/terascan/terascan_main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from PySide2 import QtGui, QtCore, QtWidgets
import pyqtgraph as pg

from qudi.util.datastorage import TextDataStorage
from qudi.util.widgets.plotting.image_widget import ImageWidget
from qudi.util.paths import get_artwork_dir
from qudi.util.colordefs import QudiPalettePale as palette
Expand Down
1 change: 0 additions & 1 deletion src/qudi/logic/common/fast_counter_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class FastCounterLogic(LogicBase):
module.Class: 'common.fast_counter_logic.FastCounterLogic'
connect:
fast_counter: fast_counter_dummy
options:
"""
Expand Down
4 changes: 2 additions & 2 deletions src/qudi/logic/common/scanning_laser_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ class ScanningLaserLogic(LogicBase):
# declare config options
_min_wavelength = ConfigOption(name='min_wavelength',
default=0.5,
missing='warn')
missing='info')

_max_wavelength = ConfigOption(name='max_wavelength',
default=1.0,
missing='warn')
missing='info')


# signals
Expand Down
39 changes: 39 additions & 0 deletions src/qupidc_qudi_modules.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Metadata-Version: 2.2
Name: qupidc-qudi-modules
Version: 0.0.1
Summary: Qudi modules developed by QuPIDC.
Home-page: https://github.itap.purdue.edu/hoodlabpurdue/qupidc-qudi-modules
License: LGPLv3
Keywords: qudi,experiment,measurement,framework,lab,laboratory,instrumentation,instrument,modular
Requires-Python: >=3.8, <3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE.LESSER
Requires-Dist: wheel>=0.37.0
Requires-Dist: qudi-core>=1.4.1
Requires-Dist: numpy>=1.21.3
Requires-Dist: pyqtgraph>=0.13.0
Requires-Dist: PySide2==5.15.2.1
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# QuPIDC-Qudi-Modules
[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)

---

Qudi modules for QuPIDC.

> __WARNING:__
>
> Do __NOT__ put any `__init__.py` files into qudi namespace packages. Doing so will prevent any
> addon packages to install additional modules into the respective package or any sub-packages.
>
> You can however create your own non-namespace packages (including `__init__.py`). Just make sure
> you do not want to install any addons later on in this package or any sub-packages thereof.
43 changes: 43 additions & 0 deletions src/qupidc_qudi_modules.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
LICENSE
LICENSE.LESSER
README.md
pyproject.toml
setup.py
src/qudi/gui/template/template_gui.py
src/qudi/gui/template/template_main_window.py
src/qudi/gui/terascan/terascan_gui.py
src/qudi/gui/terascan/terascan_main_window.py
src/qudi/hardware/camera/andor_camera.py
src/qudi/hardware/daq/nidaq.py
src/qudi/hardware/dummy/camera_dummy.py
src/qudi/hardware/dummy/daq_dummy.py
src/qudi/hardware/dummy/data_instream_dummy.py
src/qudi/hardware/dummy/fast_counter_dummy.py
src/qudi/hardware/dummy/scanning_laser_dummy.py
src/qudi/hardware/laser/solstis_constants.py
src/qudi/hardware/laser/solstis_funcs.py
src/qudi/hardware/laser/solstis_laser.py
src/qudi/hardware/timetagger/swabian_tagger.py
src/qudi/hardware/wavemeter/high_finesse_constants.py
src/qudi/hardware/wavemeter/high_finesse_proxy.py
src/qudi/hardware/wavemeter/high_finesse_wavemeter.py
src/qudi/hardware/wavemeter/high_finesse_wrapper.py
src/qudi/interface/camera_interface.py
src/qudi/interface/daq_reader_interface.py
src/qudi/interface/data_instream_interface.py
src/qudi/interface/fast_counter_interface.py
src/qudi/interface/scanning_laser_interface.py
src/qudi/logic/grating_scan_logic.py
src/qudi/logic/template_logic.py
src/qudi/logic/terascan_logic.py
src/qudi/logic/common/camera_logic.py
src/qudi/logic/common/daq_reader_logic.py
src/qudi/logic/common/data_in_stream_logic.py
src/qudi/logic/common/fast_counter_logic.py
src/qudi/logic/common/scanning_laser_logic.py
src/qupidc_qudi_modules.egg-info/PKG-INFO
src/qupidc_qudi_modules.egg-info/SOURCES.txt
src/qupidc_qudi_modules.egg-info/dependency_links.txt
src/qupidc_qudi_modules.egg-info/not-zip-safe
src/qupidc_qudi_modules.egg-info/requires.txt
src/qupidc_qudi_modules.egg-info/top_level.txt
1 change: 1 addition & 0 deletions src/qupidc_qudi_modules.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions src/qupidc_qudi_modules.egg-info/not-zip-safe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 5 additions & 0 deletions src/qupidc_qudi_modules.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
wheel>=0.37.0
qudi-core>=1.4.1
numpy>=1.21.3
pyqtgraph>=0.13.0
PySide2==5.15.2.1
1 change: 1 addition & 0 deletions src/qupidc_qudi_modules.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
qudi

0 comments on commit a26f425

Please sign in to comment.