qt3uw / qt3-utils

Data Acquisition for Confocal Microscope and Spin Control Experiments
https://sites.google.com/uw.edu/qt3-lab/projects
BSD 3-Clause "New" or "Revised" License
3 stars 6 forks source link

New features for Qt3Scans #160

Closed vasilisniaouris closed 1 month ago

vasilisniaouris commented 3 months ago

In this pull request, multiple functionalities have been added to the Qt3Scan GUI and controllers.

  1. DAQ clock rate is stored internally in the controller for the collected dataset. This prevents any issues arising when changing the DAQ clock rate before you save the collected data.
  2. In addition to the clock rate, now the DAQ and Scanner last config dicts are stored right before the scan starts. This is important to later store this kind of metadata.
  3. Added functionality to the spectral confocal scans, so that the plotted images can be processed in two ways:
    1. Choose the data aggregation method: Since each pixel in the scan contains an entire spectrum, the data must somehow be processed to be put in an image. Traditionally, a sum over the entire spectrum would suffice. Here, we give the user a choice to perform more nuanced analysis with choices such as plotting the mean, max, or min counts for each pixel, or plotting the wavelength at which the max and min are, or even plotting the weighted-by-counts wavelength (which gives the central wavelength of a single peak if the spectrum contains only one peak, without requiring a fit).
    2. Filter the wavelength range: instead of using the entire spectrum to aggregate data, this functionality allows the user to select only a specific range of wavelengths on which the aggregation method will act on. This range is also depicted in the individual scan data (upon a right-click on a plot pixel).
  4. Added more parameters to the stored data:

    1. Filter range
    2. Aggregation method
    3. DAQ configuration
    4. Scanner configuration

    With npz filetype, the daq_config and scanner_config are saved as additional keys. In order to read them, allow_pickle=True in the np.load(...) method must be used. With h5 filetype, the daq_config and scanner_config are saved as a json-converted dicts in the file attributes. (e.g., h5file.attrs['daq_config']).

  5. Load Scan: Now you can load a saved scan and view it immediately. All formats other than '.npy' are supported. Since the filter range and aggregation method are stored, the user can even recover the process which resulted in the plot they last saw on the GUI.
  6. 'Go to' after scan checkbox: After the end of a scan, the 'Go To Position' method will run once if the checkbox is set to active.
  7. Added "Optimize axis" functionality for spectrometer-based DAQs
  8. Fixed "Optimize axis" bug (axis values were missing last value with previous changes in main).
mfparsons314 commented 1 month ago

We tested the code on the QT3 quantum light microscope and all features seem to work. This branch has been in operation for some time in the ZnO experiment in the quantum defects lab.