Skip to content

Commit

Permalink
nix altitude too low warning
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrichman committed Nov 27, 2016
1 parent 061b1d5 commit 0b244bb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion tawhiri/interpolate.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ cdef object get_wind(dataset ds, WarningCounts warnings,
lerp = 0.5

if lerp < 0: warnings.altitude_too_high += 1
if alt < 0: warnings.altitude_too_low += 1

cdef Lerp1 alt_lerp = Lerp1(altidx, lerp)

Expand Down
1 change: 0 additions & 1 deletion tawhiri/warnings.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
# cython: language_level=3

cdef class WarningCounts:
cdef public int altitude_too_low
cdef public int altitude_too_high
9 changes: 2 additions & 7 deletions tawhiri/warnings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,15 @@ fired, and how many times they have fired.

cdef class WarningCounts:
def __init__(self):
self.altitude_too_low = 0
self.altitude_too_high = 0

@property
def any(self):
return bool(self.altitude_too_low or self.altitude_too_high)
return bool(self.altitude_too_high)

def to_dict(self):
res = \
{ "altitude_too_low":
{ "count": self.altitude_too_low
, "description": "The altitude went too low: wind data may be unreliable"
}
, "altitude_too_high":
{ "altitude_too_high":
{ "count": self.altitude_too_high
, "description": "The altitude went too high, above the max forecast wind. \
Wind data will be unreliable"
Expand Down

0 comments on commit 0b244bb

Please sign in to comment.