Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Dealing with bad sensor data with AvgSpa() function


crs Mar 30, 2018 08:17 PM

I have 48 T107 sensors connected to an AM16/32 multiplexer, and have been using the AvgSpa() function to calculate the spatial average across these 48 locations.  Recently I had a problem with a loose ground wire connectionthat was causing a couple of sensors to report alternately NAN and very negative values.  I believe that the AvgSpa() function automatically handles the NAN values, but the negatives cause a big problem.  

I wrote a separate loop to filter out bad values before returning an average, but I was hoping there might be a more elegant way to handle this in CRBASIC.  Is there a flag that can be sent to the AvgSpa() function, and if so, how is it used?


JDavis Mar 30, 2018 08:41 PM

You will need to do some QA/QC on the data before it goes into AvgSpa.

One thing you could do is sort the array to separate out outliers. The SortSpa function will sort it for you. Then you can use AvgSpa on a subset.

Log in or register to post/reply in the forum.