我想创建风玫瑰(实际上,洋流玫瑰),我正在尝试圆形和openair软件包的功能。当使用windRose(openair)函数时,我得到了我期望的结果(我手动检查了它们),但是当我使用windrose(循环)时,我得到了我对一个数据集期望的结果,但对另一个数据集却没有。我知道气象学家绘制的是风从哪里吹来的方向,而我们在海洋学上绘制的是海流走向的方向。一开始,我尝试添加180°(或者pi,如果我是在弧度中工作的话),它对一个数据集有效,但对另一个无效。我知道两个数据集的主要方向,因为我还使用了方差椭圆和平均方向向量。实际上,我注意到windrose(圆形)和椭圆的玫瑰并不一致。我想使用windRose(圆形)而不是windRose(openair),因为我已经修改了函数,在某些经度和纬度点上创建带有玫瑰的地图。我有一个包含数据集的.RData文件,但我找不到将其上传到这篇文章的方法。
任何帮助都会得到极大的感谢。干杯。
#dataset1, $t is theta (direction) and $r is radius (magnitude)
windrose(data.frame(dir=circular(pol.ex$t, units="degrees"),
mag=pol.ex$r), template="geographics") #in this dataset, predominant
#direction is around 120°, windrose is not accurate.
rose <- windRose(mydata=data.frame(wd=pol.ex$t, ws=pol.ex$r), cols="jet",
paddle=F) #this rose is accurate.
#dataset2, $t is theta (direction) and $r is radius (magnitude)
windrose(data.frame(dir=circular(pol.noex$t, units="degrees"),
mag=pol.noex$r), template="geographics") #now, this one is accurate.
rose <- windRose(mydata=data.frame(wd=pol.noex$t, ws=pol.noex$r),
cols="jet", paddle=F)#also accurate, dominant direction is ~ 220°发布于 2018-06-13 21:21:11
我找到了我的错误,模板是一个循环的参数,而不是WINDROSE的参数:
windrose(data.frame(dir=circular(pol.ex$t,units="degrees",template="geographics"),mag=pol.ex$r)) #这行得通
谢谢。
https://stackoverflow.com/questions/50823819
复制相似问题