Reading ibw and Igor text files with python

I have used igor for most of my work, but now I need to use python. I'm still very new in programing in python and I have a lot of data storage in igor ibw or text files that I still need. So my problem if how to read in this files in python so I can process the data there. Is there anyone that has a good way to do this? I'm very grateful for any answer.

Thanks in advanced
JGladh
In you IP folder there is a directory named technical notes and within it there Igor Tech Notes and a folder called TN003 Igor binary format which describes wave format.

That might be a good place to start.

Andy
jgladh wrote:
I have used igor for most of my work, but now I need to use python. I'm still very new in programing in python and I have a lot of data storage in igor ibw or text files that I still need. So my problem if how to read in this files in python so I can process the data there. Is there anyone that has a good way to do this? I'm very grateful for any answer.

Thanks in advanced
JGladh


You can go the way hegedus has suggested (there are even already almost ready solutions: i.e. igor.py) but I think an alternative way could be to put your data waves into a table as you see fit, and export it to csv, and import the csv data into python. Something like:

edit/n=table01 w_wave0, w_wave1, w_wave2
savetablecopy/w=table01/t=2 as "data01.csv"


For more info: displayhelptopic "SaveTableCopy"

best,
_sk
hegedus wrote:
In you IP folder there is a directory named technical notes and within it there Igor Tech Notes and a folder called TN003 Igor binary format which describes wave format.

That might be a good place to start.

Andy

JGladh

Thanks I will check that.

JGladh
_sk wrote:
jgladh wrote:
I have used igor for most of my work, but now I need to use python. I'm still very new in programing in python and I have a lot of data storage in igor ibw or text files that I still need. So my problem if how to read in this files in python so I can process the data there. Is there anyone that has a good way to do this? I'm very grateful for any answer.

Thanks in advanced
JGladh


You can go the way hegedus has suggested (there are even already almost ready solutions: i.e. igor.py) but I think an alternative way could be to put your data waves into a table as you see fit, and export it to csv, and import the csv data into python. Something like:

edit/n=table01 w_wave0, w_wave1, w_wave2
savetablecopy/w=table01/t=2 as "data01.csv"


For more info: displayhelptopic "SaveTableCopy"

best,
_sk

JGladh

Thank you, that was a good alternative!

JGladh
I realise that your post was a couple of months ago, but I recently built a command line utility in Python for bulk extraction of data from .ibw files - https://github.com/N-Parsons/ibw-extractor. It's based on the Python module `igor` (which supercedes the previously mentioned `igor.py` module), but I've built a command line interface for it, and added some additional processing for handling non-numeric values (NaN, inf) and implemented splitting/formatting for any stored notes and labels.

I'm using the data in Mathematica at the moment, so I wrote it to output data in csv, tsv, or json, rather than just using the data in Python directly. If you just want to use it in Python I'd suggest extracting it to memory rather than saving to disk as the full utility does (.ibw files are ~1/10 the size of a .json) - you can use `extractors.ibw2dict` for this. Of course, feel free to reuse/modify any of the code to suit your own purposes.
Hi parsons

I keep getting a module not found error for the
import extractors
line.
Can u suggest a fix? Thanks I am new to Python.
Supriya Balaji wrote:
I keep getting a module not found error for the
import extractors
line.
Can u suggest a fix? Thanks I am new to Python.


It sounds like you haven't installed the necessary dependencies. The easiest way to do this if you have `pip` installed on your system is to run `pip install --user igor numpy click`.

If you don't have `pip` available on your system, you can either install that first, or just install all of the dependencies manually. You can find instructions for how to manually install packages in this StackOverflow question: https://stackoverflow.com/a/13271241

If it's not a dependency issue, then I'll need more detail from the error message for me to be able to replicate and fix the issue.