03-08-2013 04:37 AM
Hi, I am collecting measurements from 8 fluxmeters in an array of 8 elements and graph them in a multi line chart.
The fact is that some measurements return bad values due to bad transmission or bad reading from the (OLD) instrument. So, those wrong values are under or above the 50% of the real value (or the same, of the setpoint value).
Only a wrong value between 2 good values is collected (only a peak at time), so my goal will be:
if a > or < 50% of the real value (or the setpoint) is collected and both the value before and the value after this wrong reading are good I would replace the wrong with a correct value (say: with the previous or with the setpoint) in order to have a smooth chart shape.
I started to use threshold array vi but I need different threshold values for all 8 array positions because all 8 fluxmeters could have different setpoints.
Not able to solve...and probably I will need to collect at minimum 3 readings before filter wrong values, so I suppose I'd have to fill a 8x3 matrix (?)...
03-08-2013 07:58 AM
I don't think that the threshold array primitive is the right choice. This function interpolates the array and finds the fractional index. It assumes that the data has a slope. It doesn't sound like your data would meet this criteria.
You just need to find the "bad" data points and replace the value with a reasonable value. (maybe the average of the two data points on either side)
03-08-2013 08:21 AM - edited 03-08-2013 08:22 AM
You also might try the "Remove Outliers" function if you have the Professional Devel system. As the name implies, it removes the outliers instead of replacing them.