Giter VIP home page Giter VIP logo

qt3-utils's People

Contributors

cmordi avatar gadamc avatar mfparsons314 avatar nnguyenhtommy avatar vasilisniaouris avatar ws-general avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qt3-utils's Issues

add class name to experimental_conditions

By adding 'classname': to the output of experimental conditions method, if that returned dictionary is used to save data in a pickle, the type of experiment will be recorded in the serialized data file.

ni daq sampler needs to retain actual counts, rather than rate

The object should retain and have methods that return the actual counts per sample read.
It's critical that the sampler can return raw counts.
A method to return a rate can still exist, of course.
Could add functionality of piezo scanner to display either raw counts or count rate.

Update experiments to use new DAQ sampler object

development of the oscilloscope and piezo scanner applications included new objects, based on nidaq submodule, to configure hardware and acquire data.

These new objects provide a higher-level interface and should be preferred over the more direct usage of the nidaq.config module.

automatic saving of scan data to hdf

Build integration with the qt3experimentmanager repository to save data to hdfs, and add features to the GUI to specify sample name, scan name, etc.

Update example notebooks

Notebooks should be re-worked after

  • daqsampler object is used by experiments
  • after bugs have been worked out
  • with lock-in amplifier analysis approach
  • with good data that reflects expected results

feature: rabi and podmr range checks

Currently there are no checks in the code to ensure the various pulses do not generate laser / rf signals that overlap in unexpected ways. That is, it's possible to provide settings where the rf signal width + aom width are greater than the total width of the full pulse cycle.
We should add checks to the code to ensure that pulses sequences are not generated that overlap.

Review usage & need of qt3rfsynthcontrol

The qt3rfsynthcontrol package was built in order to encapsulate specific configurations of the windfreak synth hd pro device.
However, in the current implementation of qt3-utils experiments (CW- or p-ODMR), the frequency and power of the MW source is fixed while data are acquired, which only requires two simple commands to the synth hd pro. There already exists a python package called windfreak, upon which qt3rfsynthcontrol is built. It would be trivial to drop qt3rfsynthcontrol and replace entirely with windfreak. (Eliminating unnecessary code that would require maintenance is always a good thing.)

On the other hand, we may still want encapsulation of more advanced configurations. Initially, the sweep mode of the device was utilized in order to program the device to sweep through a range of frequencies over time. This was how the Qudi program used the device. One advantage of this mode is that it allows the experimenter to sweep through a range of MW frequencies quickly (via hardware loops rather than software loops), observe the data and continue to sweep until the desired signal to noise (contrast) is reached. In order to do this properly, it should be pointed out, we need to coordinate the frequency changes with the DAQ. This would be done by programming an appropriate trigger signal -- we would need the pulse blaster since the QC Sapphire has only 4 channels.

Having written all of that, however, without using the designated sweep mode, we can still achieve the same results and nearly the same functionality of data collection, observation, and continued sweeps until desired. One would use the CWODMR or PODMR experiment classes, instruct the system to acquire a modest amount of data for each frequency, perform the sweep, collect and append the data to an external data structure, observe the contrast and then re-run the sweep via software. This would certainly be slower, but unclear by how much slower. My intuition is that the time to obtain the desired statistical significance be dominated by the hardware configuration (laser power, collection efficiency) except for when using bright sources.

Finally, one solution would be to simply move the functions that encapsulate the code needed to program the sweep into a utility module within qt3-utils. This would reduce the code overhead / maintenance requirement of a separate package and still retain the potentially useful code in the future.

bug: qt3scan optimize solution range

sometimes the best-fit gaussian to the optimize scan results in a central location outside of the scanned range. Sometimes, very far outside of the scanned range. Add check to post-fit step to ensure central location is reasonable. ie within the scan range (~2 microns)

New Feature: pulser submodule

We want to support both the Quantum Composer Sapphire and the Spin Core Pulse Blaster hardware in the experiment objects

To facilitate this, and other future uses, we need a more abstract layer

We should build a new submodule called pulsers where abstract layers (interfaces) are defined and specific implementations for each hardware.

Some example interfaces and concrete classes

ODMRPulser
set_pulser_state(width)
start
stop

The ODMRPulser interface works with both CW and pulsed ODMR.

RabiPulser
set_pulser_state(freq)
start
stop

Note that one could image a more abstract interface

Pulser
set_pulser_state(*args, **kwargs)
start
stop

Concrete classes could be

QCSapphCWODMRPulser
QCSapphPODMRPulser
QCSapphRabiPulser

And similarly QCSapph --> PulseBlasterXPulser for X = CWODMR, PODMR, Rabi

add new lock-in amplifier like analysis function

the analysis functions for cwodmr, poems, rabi, etc, currently need to have some knowledge of the timing of signal and background parts of the recorded data.

a lock-in amplifier solution may be a robust way of analyzing the data with minimal number of parameters. Only one parameter would be needed -- a time value that bifurcates the signal and background portions of the recorded data. The lock-in amplifier technique is to convolve the first half of the signal with a +1 and the second half of the signal with a -1, then integrate the entire recorded trace.

feature: qt3scan save scan range data

Currently we just save the numpy array of the scan without the scan axis positions.

We could fix this through a few ways.

  1. provide a 'save scan parameters' function / button that saves params to a .json file
  2. in the current save function, simply save a new file with the same basename, but with .json extension that contains the scan parameter
  3. save a data structure that isn't a numpy array, but instead a single .json file with all of the data in a single file.

qt3scan hold open AOM

The qt3scan application should have a button that allows the user to hold open the AOM with the PulseBlaster, rather than needing to do that manually.

Adds a button "Hold AOM with PB" and an entry for the pulse blaster channel number (default 0)

Or perhaps a label "Hold AOM with PB", followed by a checkbox, followed by the channel number.

feature: qt3scan - display time to acquire data

Would be helpful to experimenter to know, with the given settings of range, N samples/step, step size, clock rate, etc. how long it will take to run a scan and how long to run optimization calls.

Display this on GUI

qt3scan: improve scan saves

Confocal scans should be saved with more information than is currently saved.

Presently we only save the measured count rates in a simple 2D numpy array.

Ideally, we should save the following per stage position

  • raw number of counts
  • count rate

into a 2D array.

Additionally, at a minimum we should save the scan range and resolution. And we could envision the usefulness of also saving other data acquisition parameters, such as clock sample rate, and number of clock samples per position.

There is also a push to save data in hdfs format - see issue #67 - which we could consider doing in this ticket.

To accomplish these goals we would need to

  • modify NiDaqDigitalInputRateCounter without side-effects on qt3scope and the experiment classes such that the raw counts can be returned as well as the count rate for each scan position
  • modify the piezoScanner so that it holds both the raw data counts and the count rate (or perhaps, equivalently, the raw data counts and the sample time, allowing for easy computation of the count rate)
  • ScanImage class in piezoscan.py holds the necessary data
  • add h5py as requirement
  • update piezoscan.py save data function to package data into h5py
  • need some kind of documentation and/or class to define our h5py data structure(?)

If we work on this issue, then Issue #67 and Issue #35 should be closed. Or Issue #67 can be re-written just to define the work to incorporate the qt3experimentmanager tool.

limit RF power based on amplification specs

For the given rf amplifier in our setup, there is a recommended power regime. In particular, there is a maximum input power, beyond which device damage can occur.

This will be true for any experimental setup.

Need to add a check into code to prevent users from exceeding a particular power setting.

This could be added to experiment objects with a default value. But it could also be added to the QT3RFSynthControl object.... ? But that just controls the windfreak device, which doesn't itself have a limitation. Q - where to put this hardware check / restriction?

create general pulse blaster object

It would be nice to have a general pulse blaster class where a user can program an arbitrary sequence without much difficulty.

  1. specify a clock channel and a trigger channel if desired
  2. provides a list of start, stop times for a particular pulse blaster bit.

Current classes can be rewritten to use this base class.

rename remaining pulse 'width' parameters to 'pulse_duration'

Previously we've changed the 'rf_width' variable name to 'rf_pulse_duration' as requested. However, the variables for other channels still use "width", such as "aom_width" and "trigger_width". We should change the names of these values to "X_pulse_duration" as well for consistency

refresh z position button

should be a refresh z button so that the z entry widget value can be updated
automatically instead of needed to manually enter

clean up confocal-scan.ipynb example notebook

This example notebook contains a few unnecessary and confusing parts. In particular, using the "Namespace" object was a hack that shouldn't have been there.

Remove that and type out all of the arguments explicitly because that is simpler to read.

Then review the notebook to make sure it's clear what is happening.

qt3scan: review and possibly move location of 'show_optimization_plot' method.

Currently, show_optimization_plot, is a method of the main application view. This function is called by the main_application app (the controller in the model-view-controller design paradigm) after running the optimization routine (which optimizes the position by searching for maximal count rate).

This function creates a new window to display the optimization. Should this function actually exist inside of the main_application controller?

Remove reset daq calls

Want to remove reset-daq calls at the beginning of scans.

A reset affects all channels, including analog output channels. This will have significant side-effects, like moving the piezo actuator stage.

Add randomized parameter sweep option to experiments

All of the current experiments sweep through parameter space from low to high.

I believe that I've read that randomization of parameter values can improve contrast when randomly selecting different MW frequency values instead of sweeping contiguously through. I am pretty sure that qudi has this option in their odmr tools

Adding the option to randomly sweep through parameter space may be useful to verify/refute this claim.

code clean: analysis subpackage

remove aggregation.py module as this is just a simple wrapper around numpy functions, which we could move into the experiment classes.
Rename rabi.py to contrast.py and move some of the functions found in pulsed odmr example notebook to here.

bug: qt3scan window doesn't return to full range

After zooming with the magnifier, then selecting a position and clicking 'go to position'. when returning to full scan with the 'home' button, the full y range is no longer visible. not sure if the data is gone, or if the y scale is incorrect.

possibly related to the extent option in the imshow call (?) the extent uses model.current_y.

might need to create a fixed size array and fixed scan parameters, then sequentially update the data. right now, at reset, the data array
is emptied and we append with each scan of x. possibly cleaner to create data array with full size at the beginnng on scan.

datagenerators/piezoscanner.py add 'run scan' function

Would be useful to have a run_scan function, especially for the Jupiter notebook usage.

run_scan():
  start()
  go_to_start_position()
  while still_scanning():
      scan_x
      move_y
  stop()

This would clean up the Jupyter notebook a tad and be useful for the user

qt3scan DAQ start/stop

We should probably switch to continous data acquisition and add start/stop functionality to NI daq objects. This will likely speed up data acquistion considerably.

Then, in the qt3scan device, we should add DAQ start/stop buttons. This will block other applications, but as long as there's a stop button in order to disengage the DAQ (that is, close out DAQ related tasks), that should be sufficient

bug: qt3scope hangs after DaqError

The qt3scope app hangs after pressing 'start'. An error is reported in the console, which is that the nidaq task is reserved. This can occur when using the cwodmr experiment class in an external notebook or script. However, in the current incident of this bug, the cwodmr code is supposed to close out the counter task upon completion of data acquisition.

simple change: qt3scan

The default N samples / step is 25. However, this is already a small amount of time = 250 microseconds. This is not a significant amount of time for the scan. Increasing the default data acquisition by a factor of 10 does not significantly contribute to the scan time and results in a much smoother scan.

We should increase the default value from 25 to 250

remove n_batches from daqsamplers.RateBaseCounter.sample_counts and subclasses

Upon review, there's no good reason for the sample_counts method in daqsamplers.RateBaseCounter and subclasses to have a "n_batches" option. Though unlikely, if the caller needs multiple sets of samples, they can call the function multiple times. Most (all?) of the time this function is called with n_batches = 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.