1

I am trying to understand a python class and its use. Here is an example of its use on Linux:

from Lima import Andor
from lima import Core

cam = Andor.Camera("/usr/local/etc/andor", 0)

Here is the source of the package: https://github.com/esrf-bliss/Lima-camera-andor. I have installed this package on windows, however there is no documentation for its use or syntax. I would like to know what I should use instead of "/usr/local/etc/andor" for my system. Is there any way to look at the source code for this Andor class?

EDIT:

actually running the example code above returns:

runfile('C:/Users/BioPhotonics/.spyder-py3/untitled0.py', wdir='C:/Users/BioPhotonics/.spyder-py3') `Traceback (most recent call last):

File "C:\Users\BioPhotonics\.spyder-py3\untitled0.py", line 14, in ` cam = Andor.Camera("/usr/local/etc/andor", 0)

Exception: Hardware: lima::Andor::Camera::Camera(C:\miniconda3\conda-bld\lima-camera-andor_1568271992368\work\src\AndorCamera.cpp, 120): `InvalidValue: Invalid Camera number

3
  • Have you tried help(Andor)? Commented Jun 16, 2021 at 15:43
  • InvalidValue: Invalid Camera number - Did you check this ? Commented Jun 16, 2021 at 15:53
  • I have tried help(andor) to no avail. The invalid camera number error is probably due to the path I'm passing, as this is definitely wrong. I thought I would be able to "see" what Andor.Camera() requires as arguments? but maybe that's not possible Commented Jun 16, 2021 at 15:57

2 Answers 2

3

Andor.__file__ will tell you the file used to define the module Andor. (Or, if Andor is not itself a module, you can import Lima and check Lima.__file__.)

Sign up to request clarification or add additional context in comments.

1 Comment

Thank ou, however all that is there is an init file for the Andoe class which states from Lima import Core from limaandor import Andor as A globals().update(_A.__dict_)
1

The source for the Andor.Camera class is in the src/AndorCamera.cpp file. The parameter you're having problem with is a config directory, which is passed to the Initialize function of the Andor C SDK.

On Oxford instruments, there appear to be two versions of this SDK, but only version 2 has this function, so I suppose that's the one the library's using. You can download the documentation for the SDK here. Page 211 documents the Initialize function, which expects a config directory containing at least Detector.ini. I don't know where (or even if) that directory is created when installing the Andor driver pack on Windows.

1 Comment

Thanks, this is exactly what I wanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.