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.

Complicated Wind Direction Averaging in RTMC


Clayton Nov 23, 2011 09:54 PM

I'm trying to display a 15 minute wind direction average in RTMC and I can't quite get it to do what I want. I would like the average to be output as "N", "NE", "E", etc., preferably in a Table Display. I've managed to get a 15 minute numerical average output in a digital display, but not a table display. It seems like aliases cannot be used in the table display, so I've tried eliminating that. I've also used the "Original Label" in the Manage Columns window instead of the name of the Input Location, but there is still something different about writing an expression in a table versus a digital display. It would be nice if expressions were the same in all locations, including Split (Consider that a user request CSI, thanks).

Here is the expression (via ChipsNSalsa) that I have working to output letters for wind direction in tables:

IIF(("WindDirAvg">=0 AND "WindDirAvg"<22.5) OR ("WindDirAvg">=337.5 AND "WindDirAvg"<370),$"N",IIF("WindDirAvg">=22.5 AND "WindDirAvg"<67.5,$"NE",IIF("WindDirAvg">=67.5 AND "WindDirAvg"<112.5,$"E",IIF("WindDirAvg">=112.5 AND "WindDirAvg"<157.5,$"SE",IIF("WindDirAvg">=157.5 AND "WindDirAvg"<202.5,$"S",IIF("WindDirAvg">=202.5 AND "WindDirAvg"<247.5,$"SW",IIF("WindDirAvg">=247.5 AND "WindDirAvg"<292.5,$"W",IIF("WindDirAvg">=292.5 AND "WindDirAvg"<337.5,$"NW",$"Error"))))))))

And here is the expression (via tmecham) that I have working to average 15 minutes in a digital display (can't get it to work in a table):

StartRelativeToNewest(15 * nSecPerMin, OrderCollected); Alias(W, ""MMSA_MET_SMT:1_Min_Data.WindDir""); IIF((ATN2(AvgRunOverTime(sin(W * PI/180), Timestamp(W), 14 * nSecPerMin), AvgRunOverTime(cos(W * PI/180), Timestamp(W), 14 * nSecPerMin)) * 180 / PI) > 0, (ATN2(AvgRunOverTime(sin(W * PI/180), Timestamp(W), 14 * nSecPerMin), AvgRunOverTime(cos(W * PI/180), Timestamp(W), 14 * nSecPerMin)) * 180 / PI), 360 + (ATN2(AvgRunOverTime(sin(W * PI/180), Timestamp(W), 14 * nSecPerMin), AvgRunOverTime(cos(W * PI/180), Timestamp(W), 14 * nSecPerMin)) * 180 / PI))

I've tried combining the two of these to get an output at least in a digital display but so far I haven't had any luck. As I said, I'd ideally like to get this working in a table display.

Another nonexistent expression that would make this much easier is an AvgRunOverTime for wind direction, since it obviously very difficult to average.

Thanks,
Alex


ChipsNSalsa Dec 5, 2011 06:07 PM

I think the only solution is to do the running fifteen minute wind vector average in the datalogger.

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