Giter Club home page Giter Club logo

Comments (14)

Shuyun1247 avatar Shuyun1247 commented on September 23, 2024

Do you mean there's also a function for Holoeye SLM's? I haven't seen it in the hardware folder.

from slmsuite.

ichristen avatar ichristen commented on September 23, 2024

Hi @Shuyun1247 ,

This is an issue on our roadmap. Holoeye support is not currently added to the package, but we welcome contributions to add it! This amounts to using our template to wrap Holoeye functions. You can modify this on a personal branch and then pull request to add it to the main repo.

Unfortunately, we don't physically have a Holoeye SLM, so it's difficult for us to add and bugtest a wrapper. It would be ideal if some other group with Holoeye hardware could add this. Alternatively, if you have working code for Holoeye, we can adapt this code to work in slmsuite. However, we would need a group to test this on hardware to make sure things are working before adding it to the main repo.

Best,
Ian

from slmsuite.

Shuyun1247 avatar Shuyun1247 commented on September 23, 2024

Hi ichristen,

Will you consider adding a hamamatsu slm? Our lab is using this and I think they also have python SDK. If so, I can provide the working codes and sdk for you and we can the test the codes very soon.

Best,
Shuyun

from slmsuite.

ichristen avatar ichristen commented on September 23, 2024

Hi @Shuyun1247 ,

I'm unaware of a python SDK for Hamamatsu SLMs. I cannot find a reference to this on their website. Could you point me to this?

We have a Hamamatsu SLM and use the ScreenMirrrored SLM interface to project data onto it's virtual screen. You should be able to use this (although there might still be a versioning issue (#7 ). We also use this interface for Thorlabs SLMs.

  • I think in the next release we should explicitly state in the docs which SLMs are supported under ScreenMirrored (Hamamatsu, Thorlabs, ...)

Best,
Ian

from slmsuite.

Shuyun1247 avatar Shuyun1247 commented on September 23, 2024

from slmsuite.

ichristen avatar ichristen commented on September 23, 2024

Hi Shuyun,

Thank you for sharing this code. Was the .dll provided by Hamamatsu or was it written by a colleague?

To me, it looks like the .dll (and python interface) serves to only display an image on the virtual display and does not provide other functionality (apart from a bit of analytic pattern generation). This operation is similar to ScreenMirrored.

In contrast, the Santec or Meadowlark interfaces use SDKs provided by the respective companies with more functionality than displaying. Specifically:

  • Setting 'wavelength tables' or 'LUT' which customize the voltage outputs corresponding to each discrete integer setpoint.
  • Diagnostics such as temperatures or voltages of various components.
  • Information about the SLM .info().

If Hamamatsu provides similar functionality beyond displaying, then it is worthwhile to make a new interface beyond ScreenMirrored. However, I don't think their hardware is compatible with this. Whatever the case, next release we should make it more clear that Thorlabs and Hamamatsu SLMs should use ScreenMirrored.

Best,
Ian

from slmsuite.

Shuyun1247 avatar Shuyun1247 commented on September 23, 2024

from slmsuite.

ichristen avatar ichristen commented on September 23, 2024

Hi @Shuyun1247 ,

ScreenMirrored Issues

I just tested ScreenMirrored on a Windows 11 computer with pyglet==1.5.27. It works fine. We've also been using ScreenMirrored on various Windows computer (7, 10, 11). I'm very interested in why this isn't working on your system (we, of course, want every interface to be easy to immediately use), so here's a list of things to check:

  • Do you detect the proper monitors with the .info() command? (see below image)
  • Are you loading the proper monitor in the constructor? (1 in the case of the below image)
Screen Shot 2024-03-12 at 4 12 18 PM
  • Once the monitor is loaded (with "success" noted in the console), do you see a blank application icon pop up in the bar? If you hover over the icon, you should see the qp-slm logo and an image of whatever is currently written to the SLM. (see below image)
  • You can also use a remote screen viewer such as VNC (the program that I'm using) to see the current contents of all the screens. I think you can also use Snipping Tool or PrintScreen into Paint to see the status of the virtual screen. In this case, the 0 screen is our main screen and the 1 screen is the SLM's virtual screen. (see below image)
Screen Shot 2024-03-12 at 4 14 41 PM
  • If you're seeing a pyglet window like the above image, but things are still not being displayed to the SLM, it might be a hardware issue. In that case, you should check to make sure that your .dll code is causing the SLM to display as desired.
  • If the .dll code is working, but pyglet is displaying properly in Windows but not working on the SLM, then something very odd is going on. In that case, or in any other case where you still are not able to resolve things, could you send more detailed information about your system (hardware, OS, python environment) so we can try to replicate this odd behavior.

load_vendor_phase_correction () Questions

We don't currently have load_vendor_phase_correction () in ScreenMirrored because vendors use a variety of formats (some non-intuitive) to encode their correction data. I suppose it might be worthwhile to add a generic bitmap/csv loader to cover most of the common formats, but there are sometimes are subtleties. In the meantime, if you load the correction into python as a numpy array, you can set slm.phase_correction = correction to manually load it in.

Best,
Ian

from slmsuite.

ichristen avatar ichristen commented on September 23, 2024

Oh, and setting dx_um, dy_um is very important for all the calibrations to work properly. I think these should actually be required arguments for ScreenMirrored in v0.0.2.

from slmsuite.

Shuyun1247 avatar Shuyun1247 commented on September 23, 2024

Hi @ichristen ,

Thank you for your detailed instructions. I've followed your troubleshooting steps and believe I've narrowed down the problem to the scenario where the pyglet window is visible but nothing is displayed on the SLM, suggesting a potential hardware issue.

I've attached a screenshot showing the pyglet window with the message "SLM(未响应)," which translates to "SLM (no response)"(which is shown in 1.png). After using your method to inspect the SLM's screen output, it appears blank(2.png). Additionally, I encountered an error soon stating that "python could not be stored. (3.png)"

Our system operates on Windows 10, and we're using Python version 3.9.13. Regarding the .dll code for our hardware, my experience is primarily with Santec’s SLM, where the process involved dragging the .dll file into the program's folder. However, we are currently using a Hamamatsu SLM, and I just ran the codes for screenmirrored (which is the same in your provided image).

Could you offer any further guidance on addressing this issue, particularly with regards to the .dll code for Hamamatsu SLMs? Any additional assistance would be greatly appreciated.

Best,
Shuyun

1
2
3

from slmsuite.

Shuyun1247 avatar Shuyun1247 commented on September 23, 2024

Hi @ichristen,
I've made a breakthrough in troubleshooting our issue. It appears the root cause was a pyglet error stating, "Cannot change thread mode after it is set." By downgrading the pyglet package to version 1.4.10, I've successfully resolved the problem, and the SLM is now functioning correctly!
Thank you once again for your guidance and support throughout this process.
Best,
Shuyun

from slmsuite.

ichristen avatar ichristen commented on September 23, 2024

Hi @Shuyun1247

Awesome! Great to hear that you got it working. I'm also adding a note about this issue in #7 . At some point, we'll update the interface to pyglet 2, but this has been lower priority.

One more thing: it looks like you're loading .0125 into dx_um and dy_um. Do you perhaps mean 12.5? These numbers are in microns and 12.5 nm is very small.

Best,
Ian

from slmsuite.

Shuyun1247 avatar Shuyun1247 commented on September 23, 2024

from slmsuite.

ichristen avatar ichristen commented on September 23, 2024

Skeleton for the Holoeye SDK implemented in 8df517a.

from slmsuite.

Related Issues (20)

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.