forked from wterwey/SPOUT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdraftClasses.py
50 lines (40 loc) · 1.27 KB
/
updraftClasses.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class updraft2D:
def __init__(self, x, y, z, t, data):
self.xPos = x
self.yPos = y
self.zPos = z
self.time = t
self.savedData = data
class updraft3D:
def __init__(self, data, startHeight):
try:
(x for x in data)
self.linked2DUpdrafts = data
except TypeError:
self.linked2DUpdrafts = [data]
self.bottomHeight = startHeight
self.topHeight = startHeight
# def __init__(self):
# self.linked2DUpdrafts = []
def vertRange(self):
values = [self.bottomHeight, self.topHeight]
return values
class updraft4D:
def __init__(self, data, startTime, identNum):
try:
(x for x in data)
self.linked3DUpdrafts = data
except TypeError:
self.linked3DUpdrafts = [data]
self.beginTime = startTime
self.endTime = startTime
self.ident = identNum
def findTime(self, tVal):
if (tVal <= self.endTime and tVal >= self.beginTime):
for temp3D in self.linked3DUpdrafts:
if (temp3D.linked2DUpdrafts[0].time == tVal):
return temp3D
else:
return -1
# def __init__(self):
# self.linked3DUpdrafts = []