multiple 2D wave filtering
Thu, 04/09/2015 - 07:00 am
I have a few (~ 12) 2D waves that contain 30-40 columns and 3000 rows each row representing a measurement in time.
Let's say one column is a quality flag (and contains values of 0 or 1). Each wave will have its own set of flags. How should I go about filtering all the values with say quality flag 0 based on only wave1?
In other words I would like to get all readings from each wave that match/intersect with the times at which wave1 had a flag of 0.
The output wave is always called "ExtractedWave". It would be possible to add an input to use a name of your choosing.
Variable column, value
Variable mode // -1 less than, 0 equal, +1 greater than
Duplicate/FREE/R=[(column)] multicolumnwave, onecolumn
if (mode < 0)
Extract/INDX/FREE onecolumn, index,onecolumn<value
elseif (mode == 0)
Extract/INDX/FREE onecolumn, index,onecolumn==value
Extract/INDX/FREE onecolumn, index,onecolumn>value
Make/O/Y=(wavetype(multicolumnWave))/N=(numpnts(index), DimSize(multicolumnWave, 1)) ExtractedWave
ExtractedWave = multicolumnWave[index[p]][q]
April 9, 2015 at 09:57 am - Permalink
However, the function only picks values that match the criteria from one wave only. What I am looking for is a way to use the conditions from one wave to filter data from all other waves.
The experiment is setup like this. I have the data from multiple instruments (a 2D wave for each instrument) with one instrument set up as reference (wave1). I would like to compare all other instrument's data against the reference instrument. However I only want to compare periods when the reference instrument is giving good data. So how do I go about matching the good period for the reference instrument across all instrument's data?
April 9, 2015 at 02:34 pm - Permalink
April 9, 2015 at 03:57 pm - Permalink
I'd suggest getting acquainted with MatrixOP. Here is an example:
Suppose your data wave is waveD and your "quality" wave is waveQ. If you want to remove all entries for which waveQ==0 you can execute:
This will give you a copy of waveD where entries corresponding to waveQ==0 are set to NaN. Next execute:
Similarly, if you want to set all the values in waveD for which waveQ==0 it is simply:
April 9, 2015 at 04:57 pm - Permalink