Reading ibw and Igor text files with python
jgladh
Fri, 07/21/2017 - 10:19 am
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
That might be a good place to start.
Andy
July 21, 2017 at 04:13 pm - Permalink
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:
savetablecopy/w=table01/t=2 as "data01.csv"
For more info:
displayhelptopic "SaveTableCopy"
best,
_sk
July 24, 2017 at 04:37 am - Permalink
JGladh
Thanks I will check that.
JGladh
July 26, 2017 at 07:00 am - Permalink
JGladh
Thank you, that was a good alternative!
JGladh
July 26, 2017 at 07:02 am - Permalink
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.
September 22, 2017 at 08:18 am - Permalink
I keep getting a module not found error for the
import extractors
line.
Can u suggest a fix? Thanks I am new to Python.
March 23, 2018 at 09:33 am - Permalink
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.
March 25, 2018 at 01:04 pm - Permalink