Wednesday, December 9, 2009

Software for the Xenics IR camera


A couple of weeks ago, I blogged about the Xenics camera, which we finally were able to take images with. Since then, I have kept playing with the SDK to build an application that is better suited to our needs for SCExAO.

While it may not be the best file format in the world, all the astronomical instruments I have encountered so far produce FITS files as their final data product. The first thing to do was therefore to change the program the camera came with to make saving the data in the FITS format possible, which is fairly easy thanks to the cfitsio library.

Incidentally, that also improves the image quality. Indeed, the original program would produce what looked like 24-bit color bitmaps... but were in fact 8-bit greyscale only. That is very unfortunate since the camera uses 14-bit ADC... 6 bits of dynamic were simply lost in an elegant bitwise data shift. The image (also bias-substracted) looks somewhat better now that we make use of the entire dynamic range!


That also helped to neaten the code that originally had to be compiled with the wxWidget library, just because of the need to save bitmaps and read configuration files. While there is nothing wrong with wxWidget which is an attempt at providing a cross-platform widget library, it is just a little overkill to link it just to save bitmaps.

So what's next? We're still trying to figure out what is the best way to interface the camera with our already complex programming environment. At this point, I think it would be best to make it as standalone as possible, and one approach is to create a server program that would keep the camera up and running, and have other client programs connect to it via sockets to tell it to take pictures when needed. I just want to make sure that this socket communication system will not slow down the data acquisition... for one should not forget that one important use of this camera will be in the low-order wavefront sensor, which will be running at over 100 Hz for extended periods of time.

No comments:

Post a Comment