-1

I've got a labVIEW program which reads wavelength and intensity of a spectra as a function of time. The hardware I have reading this data uses a ccd chip and so sometimes I run into bad pixels. The program outputs a 2d array of the intensities in a text file. I want to write a separate program which will read this file, then find and eliminate the bad pixel points. The bad pixels should be obvious, as the intensities are up to 10x bigger than the points around it. As those of you familiar with labVIEW know, you can insert a formula node and code in a language that is basically C. So I've tagged this with C as well as labVIEW.

Annika
  • 11
  • I think this is a little too broad Annika. You are asking someone to write a solution for you. Can you show us what you have tried and why it is not working? – Paul Warren Jun 01 '18 at 21:57

1 Answers1

1

Try using a median or percentile filter. Since you don't want to actually change data unless it's way out there, you could do something like this:

for every point, collect *rank* points around it in every direction
compute statistics on the subset of points
if point is an outlier, replace with median value

This way, you don't actually replace the point's value unless it's far out there. A point would be an outlier if it is greater than Q3 + 1.5 IQR or if it is less than Q1 - 1.5 IQR.

Here is a VI Snippet performing the filter I've described:

Intensity Filter Using Outliers

If you want only more extreme outliers to get changed, then increase the IQR multiplier.

Community
  • 1
  • 1
Adrian Keister
  • 842
  • 3
  • 15
  • 33