Home Forums Software Consecutive OD measurements

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #908
    zoltuz
    Participant

    Hi Harrison,

    I have a question about the OD measurements. In the app.py, I can run an OD measurement by calling:

    out=GetTransmission(M, 'LASER650', ['CLEAR'], 1, 255)
    time.sleep(0.25)

    I can call this function 20 times (with sleep in between) before I get an unhandled exception.
    Is there a hardware/software limit which kicks in after 20 measurements?
    About the data itself:
    Is there any signal processing (e.g. averaging) applied to the laser measurements before we get the out value?

    Thanks for your reply in advance!

    Zoltan

    • This topic was modified 4 years, 11 months ago by zoltuz.
    #910
    harrison
    Keymaster

    Hi Zoltan,

    I expect the issue is coming from the way threading is implemented in Python. As far as my understanding goes; because we are running a main central loop, if you take “too long” to execute something in a function (within this loop) it can cause a crash.

    The way to work around this is to run whatever your function is (which calls this measurement 20 times) in a thread (see the thread starting/executing lines which arise frequently in the code, for example in the PumpModulation function). If you do this then your function will not block the main loop from executing (e.g. the process that is updating data to the HTML UI), and thus it have the timeout problem.

    Regarding how the averaging happens; each “MeasureOD” measurement is an average intensity over approx 0.7 seconds of laser. In the automated experimental procedure it measures four such periods and takes the average of these. However, if you just click “Measure” in the UI then only a single (0.7s long) OD measurement is performed.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log in/Register
Scroll to top