Averaging 2D waves

Hello, 

I'm trying to calculate the average and std errors of some 2D waves. Typically, I use the Average Waves package (which handles NaNs correctly and calculates the error). This seems to only work for 1D waves though. 

Any advice? Btw, I'm still using Igor 6... 

Thanks!

There are many possibilities but you can start with WaveStats or ImageStats.

 

You might be able to unfold your 2D waves, use Average Waves on the 1D version, and then re-fold them. If you have a, say, 150x200 point 2D wave, you can use Redimension/N=(150*200) 2DWave. Igor will simply change the dimensions and not move any data. Then to go back, Redimension/N=(150, 200) 2DWave.

A bit inconvenient, but I think it will work. The output waves containing the average and error will need to be folded in the same way.

The mention of the average waves package makes me think you want to average the rows or columns of a 2D wave.

MatrixOP is the answer to most things involving 2D waves, and to deal with NaNs take a look at the this thread.

for averaging columns, you would use

MatrixOP avg = sumcols(replaceNaNs(w,0)) / sumcols(equal(numType(w),0))

where w is the 2D wave

And MatrixOP has varCols, too, so you can compute the standard error of the mean, with a bit of work on a MatrixOP expression.

I like MatrixOP too but you will not get very far with it in IP6.