
Post by
joebar | 2016-11-25 | 02:08:00
Hi all,
From what I understood, winds interpolation works as follows:
- for a given point M=(long,lat) and a time T, first calculate the round coordinates (around M)
-> this gives you a cell defined with 4 points on a 1° grid. let's say (x,y),(x+1,y),(x,y+1),(x+1,y+1).
- for each of these points (ABCD), read the wind in the available wind datasets around the time T considered, and linearly interpolate (in time dimension) the u,v values for each of the 4 points.
- we now have 4 (u,v) pairs around our point. (Ui,Vi)=>(Speed_i,Dir_i)
- bilinear interpolation of those (u,v) pairs gives an interpolated (um,vm) pair at point M, from which the wind angle can be computed (dir=atan2(ym,um)).
- the norm (speed) is more complex:
- take S1 = norm(|um,vm|)
- take S2 = bilinearinterpolation at M(Speed_i)
- then use the formula that used to be present in iwind.js (see post http://zezo.org/forum.pl?tid=5716)
- final_speed = S2 * Pow(S1/S2, 1.0 - Pow(coeff, 0.7))
where coeff is based on a division of the cell in 4 even quadrants (using the centroid point of the cell). According to the quadrant M belongs to.
e.g.
..(X,Y) A --- AB --- B (X+1,Y)
........| .... | ....|
........| .... | ....|
.......AC ---- G --- BD
........| .....| .M .|
........| .....| ....|
(X,Y+1) C --- CD --- D (X+1,Y+1)
coeff = bilinearinterp on pos M in subcell (
G = norm(mean(Ui),mean(Vi))/mean(Speed_i),
BD = abs(sin(dir_B-dir_D)),
CD = abs(sin(dir_C-dir_D)),
D = 1)
Sorry for the poor explanations, but this what I reversed engineered so far.
I hope it helps.
Good luck with that ;-)