Initial implementation of bulk shear
This commit is contained in:
parent
eed1cdf560
commit
0af216cfc4
1 changed files with 17 additions and 0 deletions
|
@ -229,6 +229,23 @@ class Sounding(DatabaseTable):
|
||||||
90 - deg(math.atan(vd / ud))
|
90 - deg(math.atan(vd / ud))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def bulk_shear(self):
|
||||||
|
levels = len(self.samples) - 1
|
||||||
|
|
||||||
|
shear_speed = 0.0
|
||||||
|
shear_dir = 0.0
|
||||||
|
|
||||||
|
for level in range(0, levels):
|
||||||
|
shear = self.shear(level)
|
||||||
|
|
||||||
|
shear_speed += shear[0]
|
||||||
|
shear_dir += shear[1]
|
||||||
|
|
||||||
|
return (
|
||||||
|
shear_speed / levels,
|
||||||
|
shear_dir / levels
|
||||||
|
)
|
||||||
|
|
||||||
def between(n, a, b):
|
def between(n, a, b):
|
||||||
return n > a and n < b
|
return n > a and n < b
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue