Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hyperdaq hook to scanner #99

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

gadamc
Copy link
Collaborator

@gadamc gadamc commented Apr 2, 2023

This PR adds a hook to the ControlAndScanner object -- also known as the NiDaqPiezoScanner -- which can be used to acquire secondary data at each position of the generated 2D image.

An important use case of this hook will be to acquire photon energy spectra at each position of the image, thereby generating a hyper spectral image.

Since not only could photon energy spectra be taken at each position, we call this function the "hyper data acquisition" function. For example, one could be interested in measuring Rabi oscillations or performing Ramsey measurements at each location of a sample if there was desire to image external magnetic fields.

An example Jupyter notebook has been added to demonstrate usage.

Also, some internal changes were made to correct a misconception about the QT3 hardware that was manifested as poor variable names and logging statements. In particular, during the initial development of the confocal scan code, it was thought that the piezo actuator
controlled the position of the stage. This concept resulted in variable names such as stage_controller and logging statements that reported the "stage" position. This PR fixes those variable names. Though one can argue this particular change should be done in a separate PR, we do it here for the sake of expediency.

gadamc added 4 commits March 31, 2023 17:19
A number of changes have been made in this commit to support
the addition of a hyper-data acquisition callback function.

This function allows an external user to define a function
to be called at each position of the scan. This function
may also be executed in a separate thread if the 'in_parallel'
attribute of the funciton is set.

In support of this function, a number of other smaller changes
were made.

A run_scan function was added in order to facilitate use
of CounterAndScanner objects. A callback function for that
is also provided so the GUI application pizeoscan.py may
update it's display upon completion of a raster line.

Unnecessary checks for stage_controller != None were removed
since this object does not support instantiation without
a stage_controller. (Although, future updates should provide
proper type hinting.)

The position of the scan is no longer tracked by the CounterAndScan
object, but instead relies upon the last_write_values attribute
of the stage_controller object.
A misconception about the hardware led to incorrect variable
names and documentation. Initially, the piezo actuator
that controls the position of the laser light impinging upon
a sample was called a "stage" controller due to a misunderstanding
of the hardware setup. This labeling perpetuated until this change.
All usage of "stage" control has been replaced either with
"position" control or actuator, where appropriate.
Variable naming may still feel a bit off in places. Please fix
if you have better ways of describing functionality.
In particular, shows how to run a test scan based on
a 'dummy' position controller and random data generator.
This is useful for testing purposes.

Also demonstrates how to use hyper data acquisition
callback function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant