Giter Club home page Giter Club logo

python-fli's People

Contributors

cversek avatar tzuchiangshen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

python-fli's Issues

USBCamera.set_bit_depth(bitdepth="8bit") not working properly

Note that the method name USBCamera.set_bit_depth has changed to USBCamera.set_bitdepth.

Originally, the method USBCamera.take_photo returned a numpy array with dtype=numpy.uint16 regardless of previous bitdepth setting in the USBCamera.set_bitdepth method; now this has been fixed to return an
array of dtype=numpy.uint8 when using the "8bit" setting. Furthermore, a bitdepth attribute has now been added to USBCamera objects to track this setting, the default value gets set to "8bit" during object initialization.

Compiling on a Mac

I am attempting to compile the shared library on a Mac (I have successfully compiled on SL7 and it works great!). To do so, I added the framework flags below to the $(CC) line:

libfli.so: libfli.o $(ALLOBJ)
$(CC) -shared -o $@ $^ -framework Foundation -framework IOKit

I am still running into an error of:

gcc -shared -o libfli.so libfli.o libfli-sys.o libfli-debug.o libfli-mem.o libfli-usb.o libfli-usb-sys.o libfli-serial.o libfli-camera.o libfli-camera-parport.o libfli-camera-usb.o libfli-filter-focuser.o -framework Foundation -framework IOKit
Undefined symbols for architecture x86_64:
"_linux_bulktransfer", referenced from:
_FLIUsbBulkIO in libfli.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libfli.so] Error 1

Any thoughts?

Preparing the FLI SDK Dependency

If you are getting an error message like
OSError: libfli.so: cannot open shared object file: No such file or directory
it is very likely that the FLI SDK hasn't been compiled and installed properly.

There are a few steps that one needs to prepare FLI's SDK so that python-FLI can provide access to the C library.

First, the SDK must be compiled as a shared object/dynamic library (.so file) rather than the default, which is a static object (.a file). I have just posted a replacement Makefile that can be dropped in the libfli-1.104 source package folder. Then one can run make clean (if code was already compiled) then make install (as root). That should build the library so that it can be handled by the Python ctypes module (python-FLI is just a slightly more convenient OO wrapper for this foreign function interface module) and copy it to /usr/local/lib.

Now depending on the target Linux system /usr/local/lib might not be on the dynamic libraries path. There are many ways to get this library found, but I have a few suggestions in order of least hacky first. On Ubuntu and similar, that path could be added to the end of file /etc/ld.so.conf, which is updated next by running ldconfig. If that doesn't seem to work, you could create a symbolic link like this:
sudo ln -s /usr/local/lib/libfli.so /usr/lib
If ctypes is still having trouble finding the library, you could always just drop it into the python package folder (probably somewhere like /usr/local/lib/python2.7/dist-packages/FLI-dev-py2.7.egg/FLI/)

Problem with FLIList

Hello,

first thank you for sharing your work with people wanting to use FLI devices with Python.

I have a problem with FLIList, for instance when I call:
fws = USBFilterWheel.find_devices()
as given in the test code in filter_wheel.py, I get the following error:

Traceback (most recent call last):
File "<pyshell#14>", line 1, in
fws = USBFilterWheel.find_devices()
File "XX\python-FLI\src\FLI\device.py", line 50, in find_devices
cls._libfli.FLIList(cls._domain, byref(tmplist)) #allocates memory
ValueError: Procedure called with not enough arguments (8 bytes missing) or wrong calling convention

I am working on Windows, but I don't think this changes anything concerning how the procedure is called.. Did anybody else have such a problem? Do you have any clue?

Thank you for your help!

++

FLIList error

I have this error with FLIList while testing lib.py:

>>>domain = flidomain_t(FLIDOMAIN_USB)
>>>names = POINTER(char_p)()
>>>libfli.FLIList(domain, byref(names))

                File "C:/Users/.../pythonFLI/lib.py", line 335, in chk_err
                                raise FLIError(msg)

              FLIError: Invalid argument

Therefore, I tried:

>>> names = POINTER(POINTER(char_p))()
>>> libfli.FLIList(domain, names)
                WindowsError: exception: access violation writing 0x0000000000000000

Any hints?

Under Kernel >= 3.x

We are planning to acquire a FLI USB camera, so we would like to know if you know if some part of the software (FLI Kernel module, FLI SDK or python-FLI) would have some problem with Linux Kernel 3.x or even 4.x. We plan to use Debian 8.x or Ubuntu 16.x.

Thanks!
JM

USBCamera.set_temperature doesn't work

Possibly, the following fact might have caused an issue with some method calls: the original code

 def set_temperature(self, T):
        "set the camera's temperature target in degrees Celcius"
        self._libfli.FLISetTemperature(self._dev, T)

did not explicitly convert the argument T to a ctype type.
This conversion has been forced in the version:

 def set_temperature(self, T):
        "set the camera's temperature target in degrees Celcius"
        self._libfli.FLISetTemperature(self._dev, c_double(T))

A similar change was made for the num argument of USBCamera.set_flushes

def set_flushes(self, num):
    "set the number of flushes to the CCD before taking exposure"
    self._libfli.FLISetNFlushes(self._dev, c_long(num))

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.