pymeasure / pymeasure

Scientific measurement library for instruments, experiments, and live-plotting
http://pymeasure.readthedocs.io/en/latest/
MIT License
617 stars 349 forks source link

Live Image Plotting Bugs and Improvements #261

Open jmittelstaedt opened 4 years ago

jmittelstaedt commented 4 years ago

This is an issue to track any bugs or other issues with the live image plotting introduced in PR #157.

One of the major findings so far was that after changing the image plotting behavior to only show one image at a time, after changing which image was shown the axes would begin zooming out uncontrollably. This is the same behavior seen in #54. For now, we allow multiple images to be shown on top of one another.

samcondon4 commented 2 years ago

The current version of image plotting continues to use csvs as the main file format that the Results and Worker classes write to. This is fine for small image files like the one created by default in the image_gui.py example, though when increasing the size of the image to a real standard image size like say 1024 x 768, it becomes incredibly slow. With those image dimensions the image_gui.py example takes a full few minutes to write and display the image. If a user would ever like to use a real camera and log image data in an experiment this is completely intractable.

I believe that a good first step to improving live image plotting performance is to add support for writing to real image file formats via the Results and Worker classes. My initial thought is that having FITS file support would be quite useful since FITS files support an arbitrary number of data channels and unlimited metadata in the header. It is also currently the most widely used image format in astrophysics/astronomy.

What are people's thoughts on the usefulness/necessity of adding support for additional file formats in the Results and Worker classes and specifically for live image plotting, adding FITS support?

bilderbuchi commented 2 years ago

What are people's thoughts on the usefulness/necessity of adding support for additional file formats in the Results and Worker classes and specifically for live image plotting, adding FITS support?

Surely useful, see #136 for this. I imagine we'll have to come up with some optional dependency/plugin kind of structure, to enable different output formats while not dragging them into every installation if not needed. I have not spent any deep thought on that, though. Personally, my first candidates would be HDF5 or netCDF, but FITS is of course also a relevant format (although pymeasure is not strong on Camera interaction, for that other libs are much more mature I think). :-)