Timewave to seconds
n.black
I think this should be an easy solution but I havn't quite figured it out.
I have a wave where each point is formatted to hour:minute: seconds (i think this is compatible with excel)
I'd like to make a new wave only in seconds.
There must be a simple solution to this.
Thanks,
N
This is ambiguous.
You may have a text wave where each element is formatted as hh:mm:ss.
Or you may have an Igor date/time wave. In an Igor date/time wave, the values are stored as seconds since 1904-01-01. If you have no date part then the values are times in seconds so no conversion is necessary.
These commands illustrate these points:
SetScale d 0, 0, "dat", test1 // Mark as date/time wave
test1[0] = 12*3600 + 30*60 + 15 // 12:30:15
Edit test1
Make/O/D/N=2/T test2 = {"12:30:15", ""}
Append test2
Print test1[0] // Prints value in seconds
Print test2[0] // Prints string
If your wave is a text wave then to convert to seconds you need to parse the text. This may help: http://www.igorexchange.com/node/613
July 26, 2016 at 10:06 am - Permalink
Thanks for that. I couldn't quite make your snippet work. Is there a typo? I don't think my initial wave was a text wave, it was in the date/time format.
Anyway i think i might have solved the issue.
I changed the wave scaling of the wave to numeric and it seemed to work well and I can now do reasonable curve fittings which is great.
Thanks for your help, sorry for the late reply.
Best wishes,
N
July 29, 2016 at 02:43 am - Permalink
Yes. "test[0]" should have been "test1[0]". I have fixed it.
July 29, 2016 at 07:10 am - Permalink