Closed kieranricardo closed 2 years ago
No, this isn't necessary, as the asymmetry is calculated in a storm relative reference frame. The earth relative wind components are determined a couple of lines later (and then translated to cartesian coordinates):
usf = us + Vt * np.cos(lam - thetaFm)
vsf = vs - Vt * np.sin(lam - thetaFm)
phi = np.arctan2(usf, vsf)
# Surface winds, cartesian coordinates
Ux = np.sqrt(usf ** 2. + vsf ** 2.) * np.sin(phi - lam)
Vy = np.sqrt(usf ** 2. + vsf ** 2.) * np.cos(phi - lam)
See https://github.com/wcarthur/blmodel/blob/master/kepert.py for the original code (translated from MATLAB and updated from old pylab methods for plotting)
@wcarthur ah so is lam
supposed to be in storm relative coordinates?
i could be wrong but i think the windFieldValidaiton.py
script assumes the opposite, so maybe the problem is in there.
Can you plot up an example wind field using your bug fix and the unmodified code? Do both storm relative winds and earth relative winds, and include magnitude and streamlines.
Earth relative wind magnitudes:
Storm relative wind magnitudes:
Earth relative streamlines:
Storm relative streamlines:
@wcarthur I've put up the plots you asked for + I tweaked things slightly.
Also it looks like things are in polar coordinates (w/ positive bearing anticlockwise like in kerperts paper) so I updated the documentation
in https://github.com/GeoscienceAustralia/tcrm/pull/126#issuecomment-1022700093 - is thetaFm
in the labels given as cartesian (east = 0, positive anticlockwise) or geographic (north = 0, positive clockwise) angles?
There's a separate issue here in the test suite where tests are failing, but the check is allowed to pass? See https://github.com/GeoscienceAustralia/tcrm/runs/4959342316?check_suite_focus=true#step:4:222 for the failing tests. Will require separate issue to resolve.
@wcarthur I think this is ready now. and for record keeping like I mentioned yesterday these theta is specified in cartesian coordinates
Hey @wcarthur I'm not 100% sure but I think this fixes a bug in the Kerpert model.
This PR adjusts
lam
for the storm motion direction in the calculation of the asymmetric surface wind components in the Kerpert linear boundary layer model. The paper uses a cylindrical coordinate system with a polar angle of zero corresponding to the direction of storm motion, and positive values of the polar angle corresponding to counterclockwise rotation (i think?), and this PR corrects for that.