I just took a quick at the procedure file for the Average Waves panel and it looks like it would have to be modified to add weighting. As an alternative, could you apply the desired weighting to your input waves? How did you want to weight the waves?
Suppose that wList is a string list that contains the waves to average, nPoints is the number of points in each wave, and aValues is a wave of equal length to wList that contains the weighting values (also in the same sequence as wList). Unless I misunderstand, this loop should do what you want. The return weighted average is in theAverage wave.
Thanks for your input, but what if the different waves to average are plotted against their own non linear xwave? ...
Is that xwave the same for each ywave? If so, the answer I gave will still work.
Otherwise, to average ywaves with different xwaves, you will need to convert each ywave to a ywaveNEW that uses the same xwaveNEW scaling throughout. The conversion is done via interpolation. After that, averaging will work.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
November 25, 2015 at 03:02 pm - Permalink
string theOne
npts = numpnts(aValues)
make/O/N=(nPoints) theAverage
theAverage = 0
for (ic=0;ic<npts;ic+=1)
theOne = StringFromList(ic,wList)
wave tAdd = $theOne
theAverage += aValues[ic]*tAdd
endfor
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
November 28, 2015 at 05:53 am - Permalink
I was just curious to see if weighted averaging was available in the Average Waves tools
December 2, 2015 at 10:52 am - Permalink
Is that xwave the same for each ywave? If so, the answer I gave will still work.
Otherwise, to average ywaves with different xwaves, you will need to convert each ywave to a ywaveNEW that uses the same xwaveNEW scaling throughout. The conversion is done via interpolation. After that, averaging will work.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
December 2, 2015 at 11:36 am - Permalink