Extract Time from file to make "time duration" wave
ford
My problem is
1) that the" timewave" stops adding points after 127 data points.
why does the macro stop adding data points to the timewave after 127
2) it will not output the proper time duration over more than one day
is there a way to edit the current macro with a predefined function to fix this
3) Sometimes it will not add the correct point to the way ie..it will read files 150-170 before 1-149
why does it arbitrarily pick certain files?
overall I am trying to create a function or macro---not sure which one I would need, to extract times from sequential data files and use those extracted times to create a "timewave" that I can plot as a function of the other data that exists in the file. I posted earlier http://www.igorexchange.com/node/2806 and was not able to get the suggested function to work.
Does anyone have any suggestions?
Thanks.
Attached are 1 example of a data file, a zip folder with 150 sequential data files and the macro i am working with.
Make/O timewave
128 datapoints is the default size of a wave (points 0-127). you need to actually make a wave that is the correct size. Otherwise, your code keeps overwritting the last datapoint. I suggest that you use
Make/O/N=(itemsinlist(allnames)) timewave
This will ensure that "timewave" is the exact size you need.
As far as your third point, indexedfile will create a list of names based on their order within the folder. Check to make sure they are in the correct order (open the folder). I'm guessing that some of your files have an extra space in them, or something similar, which causes them to be placed in a different order within the folder.
February 24, 2012 at 12:50 pm - Permalink
I believe that Mac OS returns file names in alphabetical order and Windows returns it in the order in which it was placed in the folder.
You might want to load all of the time stamps and then sort the resulting wave.
If your timewave is really a date/time wave then you need to make it double-precision using Make/D. Dates require double-precision.
With very few exceptions, new programming should use user-defined functions, not macros which are antiquated. For help in converting macros to functions, execute:
But before you do a conversion, make sure to read the basic documentation on Igor programming - chapters IV-1 through IV-3 of the Igor manual.
February 24, 2012 at 01:35 pm - Permalink
February 24, 2012 at 03:17 pm - Permalink
February 24, 2012 at 03:19 pm - Permalink
February 24, 2012 at 03:26 pm - Permalink
in the manual there is no sort by date/timestamp option for the sort operations...only sort by aphanumeric, case, or numeric
February 24, 2012 at 03:41 pm - Permalink
I'm assuming that you are storing your date/time values in Igor date/time format. This is numeric - the number of seconds since January 1, 1904.
For details, execute:
February 24, 2012 at 05:14 pm - Permalink