AlexShkarin / pyLabLib

Python package for device control and experiment automation
http://pylablib.readthedocs.io
GNU General Public License v3.0
130 stars 30 forks source link

problem with getting images in Andor sdk 2 #91

Open sulton560 opened 2 weeks ago

sulton560 commented 2 weeks ago

Thank you for this great library. I am facing problems with getting images from my iStar Spectroscope using this library. The problem is when using the _read_frames function I get image with no information in it (I mean laser shot or anything). matrice with the shape of 1024x1024 and with the values from 495 to 530. I gave the shape of this image according to my detector size. But what I want to get is the two dimensional matrice with wavelength and counts in it. To get a better image i tried to use the other function getAcquiredData() but I get the following error. Can you please guide me how to solve it.

And one more question, Can you please tell me what is the range in _read_frames function? and what is the limit of it. To get a single scan I passed (0,1) to the range. Am I using it correctly?

Traceback (most recent call last): File "C:\Users\cpl_laptop\AppData\Local\Temp\ipykernel_7832\1184092104.py", line 109, in get_data my_data = cam.get_acquired_data() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\cpl_laptop\anaconda3\Lib\site-packages\pylablib\devices\Andor\AndorSDK2.py", line 1098, in get_acquired_data result = lib.GetAcquiredData(dim) ^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1, in File "C:\Users\cpl_laptop\anaconda3\Lib\site-packages\pylablib\core\utils\ctypes_wrap.py", line 267, in wrapped_func func_args=self._prepare_arguments(argnames,prep_argtypes,kwargs,argprep) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\cpl_laptop\anaconda3\Lib\site-packages\pylablib\core\utils\ctypes_wrap.py", line 160, in _prepare_arguments v=functions.call_cut_args(p,*kwargs) if hasattr(p,"call") else p ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\cpl_laptop\anaconda3\Lib\site-packages\pylablib\core\utils\functions.py", line 309, in call_cut_args return func(args,**cut_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\cpl_laptop\anaconda3\Lib\site-packages\pylablib\core\utils\ctypes_wrap.py", line 336, in prep n=args[size_arg_pos]


IndexError: tuple index out of range