[rrd-users] How store wind vector data?

Peter pspiegler at gmx.de
Wed Apr 9 13:40:09 CEST 2014


The 359-0 problem can solved easy by changing from polar coordinate system
(velocity+direction) to cartesian coordinate system:
Wind_X = velocity * cos(direction * PI / 180)
Wind_Y = velocity * sin(direction * PI / 180)

The normal AVERAGE aggregate function can applied to Wind_X  and Wind_Y.

The back transformation is:
velocity = Sqrt(Wind_X*Wind_X   + Wind_Y*Wind_Y)
direction = Atan2(Wind_Y, Wind_Y) * 180 / PI 

I read in the rrd documentation, that calculated data source are possible.
So a solution would be:
Define 2 data source Wind_X, Wind_Y. 
The update program has calculate Wind_X, Wind_Y from velocity+direction.

Can I define velocity  and direction as calculated data source with the
formulas?
velocity = Sqrt(Wind_X*Wind_X   + Wind_Y*Wind_Y)
direction = Atan2(Wind_Y, Wind_Y) * 180 / PI 




--
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/How-store-wind-vector-data-tp7581910p7581914.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.



More information about the rrd-users mailing list