Compare commits
2 commits
0aedd959f9
...
018c7fdc40
Author | SHA1 | Date | |
---|---|---|---|
018c7fdc40 | |||
d1921d2d0b |
1 changed files with 6 additions and 2 deletions
|
@ -4,7 +4,7 @@ import cairo
|
|||
from xmet.igra import IGRAReader
|
||||
from xmet.sounding import Sounding
|
||||
|
||||
WIND_SPEED_MAX = 100 # knots
|
||||
WIND_SPEED_MAX = 140 # knots
|
||||
WIND_SPEED_MIN = 10
|
||||
WIND_SPEED_STEP = 10
|
||||
|
||||
|
@ -18,6 +18,9 @@ def radians(degrees: float) -> float:
|
|||
def degrees(radians: float) -> float:
|
||||
return (radians * (180.0 / math.pi)) - 90
|
||||
|
||||
def knots(ms: float) -> float:
|
||||
return ms * 1.944
|
||||
|
||||
class Hodograph():
|
||||
def __init__(self, width, height):
|
||||
self.width = min(width, height)
|
||||
|
@ -151,7 +154,8 @@ class Hodograph():
|
|||
if sx_last is not None and sy_last is not None:
|
||||
cr.move_to(x + sx_last, x + sy_last)
|
||||
|
||||
sx, sy = self.sample_to_screen(sample.wind_speed, sample.wind_dir)
|
||||
sx, sy = self.sample_to_screen(knots(sample.wind_speed),
|
||||
sample.wind_dir)
|
||||
|
||||
if first:
|
||||
cr.move_to(x + sx, y + sy)
|
||||
|
|
Loading…
Add table
Reference in a new issue