Finding the time stamp in a time wave
pratapv397
I am relatively new to Igor use. I am trying to process a large amount of data stored in a file in csv format with a time stamp. So, I am able to load the data using loadwave command into two different waves, one containing the time stamp, and the other is the value of the quantity I am measuring at that time. Now, I want to locate the point closest to my time of interest in the time wave. Could you help me finding the syntax for it? For example:
The time wave looks like: 10:23:34 am, 10:23:38 am, 10:23:42 am. If I want to find the point corresponding to the time 10:23:38 am, what syntax or command do I need to use.
Thank you,
Vikram
[ Date/time is stored as seconds since midnight on 1904-01-01. For details, execute:
DisplayHelpTopic "Date/Time Waves"
]
Here is an example that may help:
// Demo(10, 23, 38)
// Demo(10, 23, 40)
Function Demo(hours, minutes, seconds)
Variable hours, minutes, seconds // The time of day to search for
Variable timeOfDayToSearchFor = hours*3600 + minutes*60 + seconds // Convert to seconds since midnight
Variable t0 = 10*3600 + 23*60 + 34 // 10:23:34 AM as seconds since midnight
Variable t1 = 10*3600 + 23*60 + 38 // 10:23:38 AM
Variable t2 = 10*3600 + 23*60 + 42 // 10:23:42 AM
Make/O timeOfDayWave = {t0, t1, t2}
FindLevel/P/Q timeOfDayWave, timeOfDayToSearchFor // Stores fractional point number in V_LevelX
Printf "Point number is %g\r", V_LevelX
End
May 30, 2018 at 12:43 pm - Permalink