From b45e0a74b463fee729555214e1e4c4fa99e49b52 Mon Sep 17 00:00:00 2001 From: Craig Arthur Date: Thu, 27 Oct 2016 14:42:53 +1100 Subject: [PATCH] Correct conversion of translation speed --- wind/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wind/__init__.py b/wind/__init__.py index 5980d38e..c6f1376e 100644 --- a/wind/__init__.py +++ b/wind/__init__.py @@ -175,8 +175,8 @@ def localWindField(self, i): eP = convert(self.track.EnvPressure[i], 'hPa', 'Pa') cP = convert(self.track.CentralPressure[i], 'hPa', 'Pa') rMax = self.track.rMax[i] - vFm = convert(self.track.Speed[i], 'kmh', 'mps') - thetaFm = bearing2theta(self.track.Bearing[i] * np.pi/180.), + vFm = convert(self.track.Speed[i], 'kph', 'mps') + thetaFm = bearing2theta(self.track.Bearing[i] * np.pi/180.) thetaMax = self.thetaMax #FIXME: temporary way to do this @@ -194,8 +194,9 @@ def localWindField(self, i): params = windmodels.fieldParams(self.windFieldType) values = [getattr(self, p) for p in params if hasattr(self, p)] windfield = cls(profile, *values) - + log.debug("cp: {0}; ep: {1}; rMax: {2}; vFm: {3}; thetaFm: {4}".format(cP, eP, rMax, vFm, thetaFm)) Ux, Vy = windfield.field(R, theta, vFm, thetaFm, thetaMax) + log.debug("Maximum local wind speed: {0}".format(np.max(np.sqrt(Ux*Ux+Vy*Vy)))) return (Ux, Vy, P)