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