
How to create new wave from existing wave

cmm557
Column 1 column 2 column 3 column 4 column 5
03/08/2017 cf0000 0.45 0.300 0.298
04/08/2017 cf0200 0.4 0.6 0.3
05/08/2017 cf0000 0.5 0.2 0.1
in the example above, I only want to extract the values from the row that has the status cf0200 and put it in a new table (all values from column, 1, 2, 3, 4, and 5 will be transferred to the new table if column 2 has cf0200). How would I program this? I am new to igor and am having a lot of trouble trying to figure out the code for this. Any help would be appreciated!
Use a for loop in a procedure file
I assume column2 is text based and not hex formatted numbers. Otherwise, replace
StringMatch(column1, "cf0200")
bycolumn2==0xcf0200)
andwave /T column2
bywave column2
.In case you want to overwrite the source waves, use 'columnX' instead of 'cX' together with the /O flag for extract AND make sure your 'marker column' (column2) is processed last. Here, the existing table will update automatically and you won't need that edit command at the end of each code.
HJ
October 10, 2017 at 02:24 am - Permalink
The date I would convert to Julian:
datetojulian(2017,08,03)
(displayhelptopic "dateToJulian"
)The status code I would convert appropriately (idk how many status codes you have, is RAM an issue, etc.).
Then use something like that:
best,
_sk
October 10, 2017 at 05:06 am - Permalink
An Igor date/time value is numeric - seconds since 1904-01-01:
DisplayHelpTopic "Date/Time Waves"
I don't think it is a good idea to convert to Julian because some Igor operations expect Igor date/time format. For example, it must be Igor date/time format to use as the X axis in a graph.
October 10, 2017 at 01:31 pm - Permalink
Good to know.
best,
_sk
October 11, 2017 at 12:47 am - Permalink
October 16, 2017 at 12:58 pm - Permalink