Giter Site home page Giter Site logo

Comments (4)

AlexShkarin avatar AlexShkarin commented on August 15, 2024

Could you check your Andor SDK2 version?

Accroding to its changelog, version 2.94.30001.0 fixed bug stating Fix for SDK defaulting to using an unavailable PAG for iXon 888. That could be the reason you're experiencing this issue.

If updating SDK2 version does not help, you can try moving preamp_gain=self.GetPreAmpGain(pa) (line 660 in atmcd32d_lib.py) inside the try block immediately following it, i.e., move it one line down and add an extra indent. This should get rid of this particular error, although there might be similar error further down the line (e.g., when trying to get or set the preamp gain or the amplifier mode). If you do try this, could you also report the result of executing cam.get_all_amp_modes()?

from pylablib.

whooie avatar whooie commented on August 15, 2024

I'm using SDK version 2.104.33000.0.

I tried making that change in atmcd32d_lib.py and got DRV_NOT_SUPPORTED from SetNumberPrescans. Here's the traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Covey Lab\pyLabLib\pylablib\devices\Andor\AndorSDK2.py", line 112, in __init__
    self.open()
  File "C:\Users\Covey Lab\pyLabLib\pylablib\devices\Andor\AndorSDK2.py", line 239, in open
    self._setup_default_settings()
  File "C:\Users\Covey Lab\pyLabLib\pylablib\devices\Andor\AndorSDK2.py", line 182, in _setup_default_settings
    self.setup_kinetic_mode(1)
  File "C:\Users\Covey Lab\pyLabLib\pylablib\devices\Andor\AndorSDK2.py", line 69, in wrapped
    res=func(self,*args,**kwargs)
  File "C:\Users\Covey Lab\pyLabLib\pylablib\devices\Andor\AndorSDK2.py", line 704, in setup_kinetic_mode
    lib.SetNumberPrescans(num_prescan)
  File "<string>", line 1, in <lambda>
  File "C:\Users\Covey Lab\pyLabLib\pylablib\core\utils\ctypes_wrap.py", line 278, in wrapped_func
    retval=func(*call_args)
  File "C:\Users\Covey Lab\pyLabLib\pylablib\devices\Andor\atmcd32d_lib.py", line 41, in errchecker
    raise AndorSDK2LibError(func.__name__,result)
pylablib.devices.Andor.atmcd32d_lib.AndorSDK2LibError: function 'SetNumberPrescans' raised error 20991(DRV_NOT_SUPPORTED)

Also, here is the output from get_all_amp_modes (I printed them from the AndorSDK2Lib call in atmcd32d_lib.py since the camera didn't get fully set up):

[TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='Electron Multiplying', hsspeed=0, hsspeed_MHz=30.0, preamp=0, preamp_gain=1.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='Electron Multiplying', hsspeed=0, hsspeed_MHz=30.0, preamp=1, preamp_gain=2.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='Electron Multiplying', hsspeed=1, hsspeed_MHz=20.0, preamp=0, preamp_gain=1.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='Electron Multiplying', hsspeed=1, hsspeed_MHz=20.0, preamp=1, preamp_gain=2.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='Electron Multiplying', hsspeed=2, hsspeed_MHz=10.0, preamp=0, preamp_gain=1.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='Electron Multiplying', hsspeed=2, hsspeed_MHz=10.0, preamp=1, preamp_gain=2.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='ElectronMultiplying', hsspeed=3, hsspeed_MHz=1.0, preamp=0, preamp_gain=1.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=0, oamp_kind='Electron Multiplying', hsspeed=3, hsspeed_MHz=1.0, preamp=1, preamp_gain=2.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=1, oamp_kind='Conventional', hsspeed=0, hsspeed_MHz=1.0, preamp=0, preamp_gain=1.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=1, oamp_kind='Conventional', hsspeed=0, hsspeed_MHz=1.0, preamp=1, preamp_gain=2.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=1, oamp_kind='Conventional', hsspeed=1, hsspeed_MHz=0.10000000149011612, preamp=0, preamp_gain=1.0), TAmpModeFull(channel=0, channel_bitdepth=16, oamp=1, oamp_kind='Conventional', hsspeed=1, hsspeed_MHz=0.10000000149011612, preamp=1, preamp_gain=2.0)]

from pylablib.

AlexShkarin avatar AlexShkarin commented on August 15, 2024

OK, it looks like there are still some capabilities which are not always supported, but which the class does not check. Could you replace the line 704 in AndorSDK2.py (it's the lib.SetNumberPrescans(num_prescan) line which raises the error) with

        if self._check_option("set",AC_SETFUNC.AC_SETFUNCTION_PRESCANS):
            lib.SetNumberPrescans(num_prescan)
        else:
            num_prescan=0

I apologize for such awkward step-by-step debugging, but the documentation is not always 100% clear on which errors can arise in which situation, and which functions may or may not be available.

from pylablib.

whooie avatar whooie commented on August 15, 2024

That seems to work -- at least no exceptions are thrown now when I connect to the camera. I'm still in the process of setting everything up so I don't have any tests I can run to make sure it fully works, but I'll let you know if I encounter anything else. Thanks!

from pylablib.

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.