lightingghost/sifreader

Addition of spectral information

Closed this issue · 3 comments

First, let met say thanks for this cool package - so much better than converting sif files to ascii every time! I was missing the ability to extract the wavelength for files that contain spectra, so I added it: you can check it out here: https://github.com/drs251/sifreader I also added the ability to export to xarray DataArrays instead of numpy arrays, and I made some small tweaks here and there. A big change was that I had to switch self.height and self.width in read_block() and read_all() to get it to work with my files. I have two questions for you: could you check if the new version still works with your data, and if it does, would you be interested in a pull request to get some or all new features in the main project?

Hi @drs251,

Thanks for letting me know. I would be happy to accept a pull request, just do not forget add yourself as an author in the package information =.=

In terms of the height and width information, my image is a square one and cannot really differentiate the height and width, it is possible that I made a mistake.

Also, I can read the wavelength information of my file with your code, but our camera does not have a spectra capability, so please make sure it works with your file.

If it is possible, I would like to suggest you add your sif file as a test file (and some test code, if possible) in your pull request, in case we will have other changes to our code in the future.

Thanks again for your contribution.

I think adding some test files is a good idea, but all the files I have are rather large. I'll try to make some smaller sif and ascii test files this week, so they can be compared. It would also be nice to be able to distinguish between files with and without spectral information, I'll see if I can make it work. In any case, I'll make a PR later this week.

@drs251 Thanks for your pull request. I have tested on my local machine and merged the pull request. I have also uploaded a new version to PyPI.