
.npy to .ibw conversion

I have a bunch of files containing some X-ray data in form of Python .npy files. To process the data in Igor I first have to convert them to .ibw format (these are huge files so the binary format for wave storing is essential, for the same reason I don't want to store the data within the experiment, I want to be able to import the data as fast as possible). Currently I'm proceeding as following : I wrote a Python script to save the arrays as raw binary files then I read them in Igor with GBLoadwave and save as .ibw. The problem is that the array dimensions (different for each file) are not stored in the binary file, the workaround I'm using is to create a csv file to store the dimensions for each file but it is a bit cumbersome, so I wonder if there is a simpler way. I heard Igor 10 would feature interfacing with Python, anyway if there is a simple way to convert .npy to .ibw I'm interested.
I would convert the files in python from .npy to hdf5 and then read them in as HDF5.
Alternatively you could have a look at https://github.com/ns-rse/igor2 which converts from ibw to python and implement the reverse.
April 14, 2025 at 01:14 pm - Permalink
Igor 10 doesn't have a direct conversion from .npy files to .ibw. However, you can load the .npy file into a numpy array, and then create an Igor wave directly from that. The Python code would go something like:
April 14, 2025 at 01:56 pm - Permalink
The array dimensions are saved in the file. The npy file format is described at https://numpy.org/devdocs/reference/generated/numpy.lib.format.html
April 14, 2025 at 09:04 pm - Permalink
Thank you all for your suggestions, I will look at that.
April 15, 2025 at 03:15 am - Permalink