Skip to content

Commit

Permalink
Fixed storm-days calculation when wind/gustspeed uses knots. GH-239
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Jan 9, 2024
1 parent cb9df0b commit a193aa5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/user/weewx_wdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2232,12 +2232,15 @@ def get_climatological_day(self, day, start_ts, end_ts):
aggregate_interval="day"
)

# TODO: Programmatic conversion, WeeWX best practice?
if windGust_target_unit_vt[0] in ("km_per_hour", "km_per_hour2"):
value = 62.0
if windGust_target_unit_vt[0] in ("mile_per_hour", "mile_per_hour2"):
value = 38.5
if windGust_target_unit_vt[0] in ("meter_per_second", "meter_per_second2"):
value = 17.2
if windGust_target_unit_vt[0] in ("knot"):
value = 33.5

days = filter(
lambda windGust: windGust is not None and self.generator.converter.convert(
Expand Down Expand Up @@ -2333,12 +2336,15 @@ def get_climatological_day_description(self, day):
)

if day == "stormDays":
# TODO: Programmatic conversion, WeeWX best practice?
if windGust_target_unit_vt[0] == "km_per_hour":
value = "62"
if windGust_target_unit_vt[0] == "mile_per_hour":
value = "38.5"
if windGust_target_unit_vt[0] == "meter_per_second":
value = "17.2"
if windGust_target_unit_vt[0] == "knot":
value = "33.5"

return (
self.obs.label["windGust"]
Expand Down

0 comments on commit a193aa5

Please sign in to comment.