WasatchPhotonics / ENLIGHTEN

Open-source spectroscopy application for controlling and taking measurements from Wasatch Photonics spectrometers.
https://wasatchphotonics.com/product-category/software/
MIT License
3 stars 6 forks source link

Configurable Measurement Sequences #210

Open mzieg opened 1 year ago

mzieg commented 1 year ago

This is kind of new space for ENLIGHTEN...we don't really have any code along these lines (WPSC does).

An extremely common use-case when using a spectrometer is to perform a regular, repeated data collection sequence across a set of samples and acquisition parameters. For instance:

- for each sample compound in [A, B, C, D]
  - for each integration time in [100, 400, 1000, 2000ms]
    - for each laser power in [50, 200, 400mW]
      - measure actual output laser power
      - for each gain in [0, 8, 24dB]
        - for each standoff range [15, 20, 25mm]
          - using 10-scan averaging
          - take a dark
          - take a Raman measurement

That's just a typical data-collection exercise for an application scientist.

ENLIGHTEN helps a little with this, providing the prefix, note, suffix and label fields, all supporting "template macros" so you can kind of keep track of where you are and what you've done, but it's still easy to return from a bio-break and try to remember where you were, which ones you've already collected etc. And it's easy to "forget" to update a gain, or type the new compound name in, or whatever.

So I'm envisioning kind of a "Data Collection Wizard" which would let you configure the "rules" for your collection, then ENLIGHTEN would act like kind of a workflow engine in stepping you through the sequence (with provisions for "redo last step", "go back to this stage" etc).

I might start it as a plug-in, or I might just dive into making it a proper ENLIGHTEN feature.

Before designing a massive rules-engine GUI (which can get quickly quite complicated), I'd probably start by letting the user load a standard JSON file-format specifying the order of operations, the loops, ranges etc. Then the GUI would simply have to iterate through them for the user. For instance:

So basically for each "loop" you were within, it would automatically include a "restart @ integration_time_ms 100" to go back to the beginning of any stage.

This would let teams kind of perform design-reviews on their data collection plan (even revision-control the JSON file), and then the operator could "execute" it, and all the data would be stored and named and so on neatly with minimal opportunity for human error.

Note: you may immediately be thinking, "if we had an actuated x-y stage, we could automate the sample changes and stand-off range", and yes, optical multiplexors and filter wheels and many such cool things exist, and this would be a good place to integrate them. But there will always be measurements which just require some manual hand-holding and human operations as well, and that's where I'd start. Once the workflow engine is hung, all sorts of automation routines could be linked into it.

mzieg commented 1 year ago

In addition to "rewind" to re-do past steps (always necessary), it would be cool if it supported:

mzieg commented 1 year ago

Be nice if while the feature were active (I'm kind of visualizing a new vertical panel, probably using the grid pane for left-docked plug-in graphs) it used a colored QTreeView to always show you what step you were on, what's coming next, you could always click back to prev steps, you could click to see (overlay, filesystem) the data from any previous step, etc.