StatsCircularMeans

Hello,

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
Hello 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:
Concatenate {directionWave,speedWave}, new2ColWave
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.
Thank you for the help. I think you are right, StatsCircularMeans will not help me, instead I need StatsCircularMoments to average my wind direction data. I have hourly data (beginning at midnight) and I want to calculate the daily average for the total 92 days I have data for. I am having difficulty telling Igor that I want to perform StatsCircularMoments on every 24 hours of data (to produce the daily average). I have written this but am not sure if it is correct (it isn't like wavestats where I can input a Range)

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
Hello Stephanie,

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:

    For (i=0; i<no_days; i+=1)
        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.