I am working on a wind analysis for a new development. I would be able to predict the air flow pattern in the development for each hour of the year as a function of the wind speed and direction for that particular hour. Of course it would take too much time to run 8760 wind CFD simulations. My approach is to run only 16 simulations (8 wind directions and 2 wind speed) and interpolate the flow distribution from these results.
To give you an idea on how the data look like I have created a simplified case.
X = pd.Series([1,2,3,4,5])
Y = pd.Series([1,2,3,4,5])
Z = pd.Series([1,2,3,4,5])
v1 = pd.Series([2,6,1,7,8])
df1 = pd.DataFrame({'X':X,'Y':Y,'Z':Z,'v':v1})
df1['ws']=3
df1['wd']=180
v2 = pd.Series([3,1,4,2,2])
df2 = pd.DataFrame({'X':X,'Y':Y,'Z':Z,'v':v2})
df2['ws']=3
df2['wd']=0
v3 = pd.Series([2.5,2.3,1.3,7.2,1.4])
df3 = pd.DataFrame({'X':X,'Y':Y,'Z':Z,'v':v3})
df3['ws']=6
df3['wd']=180
v4 = pd.Series([2.4,5.6,6.1,2.3])
df4 = pd.DataFrame({'X':X,'Y':Y,'Z':Z,'v':v4})
df4['ws']=6
df4['wd']=0
df=pd.concat([df1,df2,df3,df4])
Please notice the last two columns contain the meteorological wind speed and direction for that particular simulation. The points (X,Y,Z) can be in the order of 100,000.
Now suppse that I want the flow distribution (X,Y,Z,v) for an intermediate value of wind speed (ws) and wind direction (wd). I would like to be able to aggregate the data and obtain a linear interpolation of the velocity field (v) at each point (X,Y,Z) To put it in a formula: (X,Y,Z)=f(data,ws,wd)
I guess I need to use the groupby function, but couldn't figure out a way to do it with two variables.
Also, do you think a data panel would be more adequate data structure for this kind of data?