StatsCircularMeans
puglie12
I am struggling performing the StatsCircularMean function. I have two columns, a wind direction wave (currently in degrees) and a wind speed wave (currently in km/h) at hourly resolution for 3 months. Any guidance in how to perform StatsCircularMean on this data would be useful (such as how to create a two column wave).
Thanks,
Stephanie
As the help indicates, the input for StatsCircularMeans is a two column DP wave where each row contains the **mean** angle in radians and the length of a mean radius. Since you are not telling us much about your data, I would first caution you to make sure that this is the correct operation for your application.
If this is the correct operation, you can convert your data from two waves into a single wave using the Concatenate operation as in:
Redimension/D new2ColWave // make sure it is double precision
new2ColWave[][0]*=pi/180 // convert the first column to radians
I hope this helps,
A.G.
WaveMetrics, Inc.
January 30, 2014 at 10:10 am - Permalink
For (i=0; i<(no_days); i+=1)
StatsCircularMoments/Mode=7/Q/GRPD={24*i+0, 24*i+23} data
dest[i] = W_CircularStats[8]*360/2/pi
dest2[i] = W_CircularStats[9]*360/2/pi
EndFor
//where "no_days" is the numpoints(data)/24
//where "data" is my hourly wind angle wave
//where "dest" is a new wave to input the 24hr average wind angle values
//where "dest2" is a new wave to input the 24hr average wind angle stdev values
Are you aware of a way to tell the Igor to perform StatsCircularMoments for every 23 data points?
Thank you for all the help!
Stephanie
February 4, 2014 at 07:21 am - Permalink
I think you have misinterpreted the meaning of the /GRPD wave and that your choice of /Mode may be wrong.
The simplest way to approach your task is to apply the statistics to segments of the data wave. Assuming you know which elements of the resulting wave you want, I modified your code a bit:
Duplicate/Free/R=[24*i, 24*i+23] data,tmp
StatsCircularMoments/Mode=7/Q tmp // Set /Mode as discussed below
Wave W_CircularStats
dest[i] = W_CircularStats[8]
dest2[i] = W_CircularStats[9]
EndFor
dest*=180/pi
dest2*=180/pi
Now the choice of Mode depends on your data. If you have wind direction data it is more than likely in degrees so you might want /Mode=2.
A.G.
February 4, 2014 at 02:11 pm - Permalink
Stephanie
February 5, 2014 at 11:21 am - Permalink