-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpadi_tables.py
339 lines (317 loc) · 26.4 KB
/
padi_tables.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
import string
padi_table_1 = {10: {'122': 'T', '178': 'X', '219': 'Z', '133': 'U', '88': 'P', '64': 'L', '112': 'S', '82': 'O',
'199': 'Y', '26': 'C', '20': 'B', '160': 'W', '45': 'H', '41': 'G', '145': 'V', '75': 'N',
'70': 'M', '95': 'Q', '104': 'R', '10': 'A', '59': 'K', '54': 'J', '30': 'D', '37': 'F',
'50': 'I', '34': 'E'},
12: {'88': 'S', '116': 'W', '53': 'L', '66': 'O', '134': 'Y', '82': 'R', '26': 'D', '23': 'C',
'45': 'J', '42': 'I', '29': 'E', '9': 'A', '147': 'Z', '76': 'Q', '108': 'V', '125': 'X',
'71': 'P', '101': 'U', '94': 'T', '38': 'H', '17': 'B', '32': 'F', '57': 'M', '49': 'K',
'62': 'N', '35': 'G'},
20: {'10': 'B', '13': 'C', '30': 'M', '15': 'D', '21': 'H', '16': 'E', '18': 'F', '44': 'T',
'23': 'I', '28': 'L', '26': 'K', '40': 'R', '34': 'O', '45': 'U', '36': 'P', '25': 'J',
'6': 'A', '20': 'G', '38': 'Q', '32': 'N', '42': 'S'},
14: {'43': 'L', '61': 'Q', '64': 'R', '53': 'O', '82': 'V', '87': 'W', '24': 'E', '27': 'F',
'22': 'D', '47': 'M', '29': 'G', '40': 'K', '8': 'A', '68': 'S', '77': 'U', '98': 'Y',
'73': 'T', '92': 'X', '15': 'B', '19': 'C', '32': 'H', '57': 'P', '37': 'J', '50': 'N',
'35': 'I'},
22: {'24': 'K', '25': 'L', '13': 'D', '12': 'C', '15': 'E', '21': 'I', '22': 'J', '16': 'F',
'19': 'H', '18': 'G', '30': 'O', '37': 'S', '29': 'N', '34': 'Q', '27': 'M', '5': 'A',
'36': 'R', '32': 'P', '9': 'B'},
16: {'60': 'T', '63': 'U', '67': 'V', '25': 'G', '27': 'H', '21': 'E', '48': 'P', '23': 'F',
'45': 'O', '42': 'N', '29': 'I', '7': 'A', '39': 'M', '72': 'X', '70': 'W', '13': 'B',
'17': 'C', '19': 'D', '32': 'J', '56': 'S', '37': 'L', '50': 'Q', '53': 'R', '34': 'K'},
18: {'56': 'W', '24': 'H', '26': 'I', '20': 'F', '22': 'G', '46': 'R', '28': 'J', '43': 'Q',
'41': 'P', '6': 'A', '11': 'B', '39': 'O', '15': 'C', '48': 'S', '16': 'D', '55': 'V',
'18': 'E', '30': 'K', '51': 'T', '36': 'N', '53': 'U', '34': 'M', '32': 'L'},
30: {'11': 'F', '10': 'E', '13': 'H', '12': 'G', '15': 'J', '14': 'I', '17': 'L', '16': 'K',
'19': 'M', '20': 'N', '3': 'A', '6': 'B', '9': 'D', '8': 'C'},
42: {'8': 'F', '4': 'B', '7': 'E', '6': 'D'},
35: {'11': 'H', '10': 'G', '13': 'J', '12': 'I', '14': 'K', '3': 'A', '5': 'B', '7': 'C',
'9': 'F', '8': 'D'},
25: {'11': 'D', '10': 'C', '13': 'E', '15': 'G', '14': 'F', '17': 'H', '23': 'M', '19': 'J',
'18': 'I', '22': 'L', '28': 'P', '26': 'O', '29': 'Q', '4': 'A', '8': 'B', '25': 'N',
'21': 'K'},
40: {'9': 'G', '8': 'F', '5': 'B', '7': 'E', '6': 'C'}}
surface_table = {'A': {'A': ['00:00', '03:00'], 'C': ['', ''], 'B': ['', ''], 'E': ['', ''], 'D': ['', ''],
'G': ['', ''], 'F': ['', ''], 'I': ['', ''], 'H': ['', ''], 'K': ['', ''], 'J': ['', ''],
'M': ['', ''], 'L': ['', ''], 'O': ['', ''], 'N': ['', ''], 'Q': ['', ''], 'P': ['', ''],
'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''],
'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'C': {'A': ['01:10', '04:10'], 'C': ['00:00', '00:21'], 'B': ['00:22', '01:09'], 'E': ['', ''],
'D': ['', ''], 'G': ['', ''], 'F': ['', ''], 'I': ['', ''], 'H': ['', ''], 'K': ['', ''],
'J': ['', ''], 'M': ['', ''], 'L': ['', ''], 'O': ['', ''], 'N': ['', ''], 'Q': ['', ''],
'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''],
'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'B': {'A': ['00:48', '03:48'], 'C': ['', ''], 'B': ['00:00', '00:47'], 'E': ['', ''], 'D': ['', ''],
'G': ['', ''], 'F': ['', ''], 'I': ['', ''], 'H': ['', ''], 'K': ['', ''], 'J': ['', ''],
'M': ['', ''], 'L': ['', ''], 'O': ['', ''], 'N': ['', ''], 'Q': ['', ''], 'P': ['', ''],
'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''],
'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'E': {'A': ['01:28', '04:28'], 'C': ['00:17', '00:38'], 'B': ['00:39', '01:27'],
'E': ['00:00', '00:07'], 'D': ['00:08', '00:16'], 'G': ['', ''], 'F': ['', ''], 'I': ['', ''],
'H': ['', ''], 'K': ['', ''], 'J': ['', ''], 'M': ['', ''], 'L': ['', ''], 'O': ['', ''],
'N': ['', ''], 'Q': ['', ''], 'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''],
'T': ['', ''], 'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'D': {'A': ['01:19', '04:19'], 'C': ['00:09', '00:30'], 'B': ['00:31', '01:18'], 'E': ['', ''],
'D': ['00:00', '00:08'], 'G': ['', ''], 'F': ['', ''], 'I': ['', ''], 'H': ['', ''],
'K': ['', ''], 'J': ['', ''], 'M': ['', ''], 'L': ['', ''], 'O': ['', ''], 'N': ['', ''],
'Q': ['', ''], 'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''],
'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'G': {'A': ['01:42', '04:42'], 'C': ['00:32', '00:53'], 'B': ['00:54', '01:41'],
'E': ['00:14', '00:22'], 'D': ['00:23', '00:31'], 'G': ['00:00', '00:06'],
'F': ['00:07', '00:13'], 'I': ['', ''], 'H': ['', ''], 'K': ['', ''],
'J': ['', ''], 'M': ['', ''], 'L': ['', ''], 'O': ['', ''], 'N': ['', ''], 'Q': ['', ''],
'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''],
'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'F': {'A': ['01:35', '04:35'], 'C': ['00:25', '00:46'], 'B': ['00:47', '01:34'],
'E': ['00:08', '00:15'], 'D': ['00:16', '00:24'], 'G': ['', ''], 'F': ['00:00', '00:07'],
'I': ['', ''], 'H': ['', ''], 'K': ['', ''], 'J': ['', ''], 'M': ['', ''], 'L': ['', ''],
'O': ['', ''], 'N': ['', ''], 'Q': ['', ''], 'P': ['', ''], 'S': ['', ''], 'R': ['', ''],
'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''],
'Z': ['', '']},
'I': {'A': ['01:54', '04:54'], 'C': ['00:44', '01:05'], 'B': ['01:06', '01:53'],
'E': ['00:27', '00:34'], 'D': ['00:35', '00:43'], 'G': ['00:12', '00:18'],
'F': ['00:19', '00:26'], 'I': ['00:00', '00:05'], 'H': ['00:06', '00:11'], 'K': ['', ''],
'J': ['', ''], 'M': ['', ''], 'L': ['', ''], 'O': ['', ''], 'N': ['', ''], 'Q': ['', ''],
'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''],
'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'H': {'A': ['01:48', '04:48'], 'C': ['00:38', '00:59'], 'B': ['01:00', '01:47'],
'E': ['00:21', '00:28'], 'D': ['00:29', '00:37'], 'G': ['00:06', '00:12'],
'F': ['00:13', '00:20'], 'I': ['', ''], 'H': ['00:00', '00:05'], 'K': ['', ''], 'J': ['', ''],
'M': ['', ''], 'L': ['', ''], 'O': ['', ''], 'N': ['', ''], 'Q': ['', ''], 'P': ['', ''],
'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''],
'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'K': {'A': ['02:05', '05:05'], 'C': ['00:55', '01:15'], 'B': ['01:17', '02:04'],
'E': ['00:38', '00:45'], 'D': ['00:46', '00:54'], 'G': ['00:23', '00:29'],
'F': ['00:30', '00:37'], 'I': ['00:11', '00:16'], 'H': ['00:17', '00:22'],
'K': ['00:00', '00:04'], 'J': ['00:05', '00:10'], 'M': ['', ''], 'L': ['', ''], 'O': ['', ''],
'N': ['', ''], 'Q': ['', ''], 'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''],
'T': ['', ''], 'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'J': {'A': ['02:00', '05:00'], 'C': ['00:50', '01:11'], 'B': ['01:12', '01:59'],
'E': ['00:32', '00:40'], 'D': ['00:41', '00:49'], 'G': ['00:18', '00:24'],
'F': ['00:25', '00:31'], 'I': ['00:06', '00:11'], 'H': ['00:12', '00:17'],
'K': ['', ''], 'J': ['00:00', '00:05'], 'M': ['', ''], 'L': ['', ''], 'O': ['', ''],
'N': ['', ''], 'Q': ['', ''], 'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''],
'T': ['', ''], 'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'M': {'A': ['02:15', '05:15'], 'C': ['01:05', '01:25'], 'B': ['01:26', '02:14'],
'E': ['00:47', '00:55'], 'D': ['00:56', '01:04'], 'G': ['00:33', '00:39'],
'F': ['00:40', '00:46'], 'I': ['00:20', '00:25'], 'H': ['00:26', '00:32'],
'K': ['00:10', '00:14'], 'J': ['00:15', '00:19'], 'M': ['00:00', '00:04'],
'L': ['00:05', '00:09'], 'O': ['', ''], 'N': ['', ''], 'Q': ['', ''], 'P': ['', ''],
'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''],
'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'L': {'A': ['02:10', '05:10'], 'C': ['01:00', '01:21'], 'B': ['01:22', '02:09'],
'E': ['00:43', '00:50'], 'D': ['00:51', '00:59'], 'G': ['00:28', '00:34'],
'F': ['00:35', '00:42'], 'I': ['00:16', '00:21'], 'H': ['00:22', '00:27'],
'K': ['00:05', '00:09'], 'J': ['00:10', '00:15'], 'M': ['', ''], 'L': ['00:00', '00:04'],
'O': ['', ''], 'N': ['', ''], 'Q': ['', ''], 'P': ['', ''], 'S': ['', ''], 'R': ['', ''],
'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''],
'Z': ['', '']},
'O': {'A': ['02:24', '05:24'], 'C': ['01:13', '01:34'], 'B': ['01:35', '02:23'],
'E': ['00:56', '01:03'], 'D': ['01:04', '01:12'], 'G': ['00:42', '00:47'],
'F': ['00:48', '00:55'], 'I': ['00:29', '00:34'], 'H': ['00:35', '00:41'],
'K': ['00:18', '00:23'], 'J': ['00:24', '00:28'], 'M': ['00:09', '00:12'],
'L': ['00:13', '00:17'], 'O': ['00:00', '00:03'], 'N': ['00:04', '00:08'],
'Q': ['', ''], 'P': ['', ''], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''],
'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'N': {'A': ['02:19', '05:19'], 'C': ['01:09', '01:30'], 'B': ['01:31', '02:18'],
'E': ['00:52', '00:59'], 'D': ['01:00', '01:08'], 'G': ['00:37', '00:43'],
'F': ['00:44', '00:51'], 'I': ['00:25', '00:30'], 'H': ['00:31', '00:36'],
'K': ['00:14', '00:18'], 'J': ['00:19', '00:24'], 'M': ['00:04', '00:08'],
'L': ['00:09', '00:13'], 'O': ['', ''], 'N': ['00:00', '00:03'], 'Q': ['', ''], 'P': ['', ''],
'S': ['', ''], 'R': ['', ''], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''],
'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'Q': {'A': ['02:31', '05:31'], 'C': ['01:21', '01:42'], 'B': ['01:43', '02:30'],
'E': ['01:04', '01:11'], 'D': ['01:12', '01:20'], 'G': ['00:49', '00:55'],
'F': ['00:56', '01:03'], 'I': ['00:37', '00:42'], 'H': ['00:43', '00:48'],
'K': ['00:26', '00:30'], 'J': ['00:31', '00:36'], 'M': ['00:17', '00:20'],
'L': ['00:21', '00:25'], 'O': ['00:08', '00:11'], 'N': ['00:12', '00:16'],
'Q': ['00:00', '00:03'], 'P': ['00:04', '00:07'], 'S': ['', ''], 'R': ['', ''], 'U': ['', ''],
'T': ['', ''], 'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'S': {'A': ['02:39', '05:39'], 'C': ['01:28', '01:49'], 'B': ['01:50', '02:38'],
'E': ['01:11', '01:18'], 'D': ['01:19', '01:27'], 'G': ['00:57', '01:03'],
'F': ['01:04', '01:10'], 'I': ['00:44', '00:49'], 'H': ['00:50', '00:56'],
'K': ['00:33', '00:38'], 'J': ['00:39', '00:43'], 'M': ['00:24', '00:27'],
'L': ['00:28', '00:32'], 'O': ['00:15', '00:18'], 'N': ['00:19', '00:23'],
'Q': ['00:07', '00:10'], 'P': ['00:11', '00:14'], 'S': ['00:00', '00:03'],
'R': ['00:04', '00:06'], 'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''],
'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'R': {'A': ['02:35', '05:35'], 'C': ['01:25', '01:46'], 'B': ['01:47', '02:34'],
'E': ['01:08', '01:15'], 'D': ['01:16', '01:24'], 'G': ['00:53', '00:59'],
'F': ['01:00', '01:07'], 'I': ['00:41', '00:46'], 'H': ['00:47', '00:52'],
'K': ['00:30', '00:34'], 'J': ['00:35', '00:40'], 'M': ['00:20', '00:24'],
'L': ['00:25', '00:29'], 'O': ['00:12', '00:15'], 'N': ['00:16', '00:19'],
'Q': ['00:04', '00:07'], 'P': ['00:08', '00:11'], 'S': ['', ''], 'R': ['00:00', '00:03'],
'U': ['', ''], 'T': ['', ''], 'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''],
'Z': ['', '']},
'U': {'A': ['02:45', '05:45'], 'C': ['01:35', '01:56'], 'B': ['01:57', '02:44'],
'E': ['01:18', '01:25'], 'D': ['01:26', '01:34'], 'G': ['01:03', '01:09'],
'F': ['01:10', '01:17'], 'I': ['00:51', '00:56'], 'H': ['00:57', '01:02'],
'K': ['00:40', '00:44'], 'J': ['00:45', '00:50'], 'M': ['00:30', '00:34'],
'L': ['00:35', '00:39'], 'O': ['00:22', '00:25'], 'N': ['00:26', '00:29'],
'Q': ['00:14', '00:17'], 'P': ['00:18', '00:21'], 'S': ['00:07', '00:09'],
'R': ['00:10', '00:13'], 'U': ['00:00', '00:02'], 'T': ['00:03', '00:06'],
'W': ['', ''], 'V': ['', ''], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'T': {'A': ['02:42', '05:42'], 'C': ['01:32', '01:53'], 'B': ['01:54', '02:41'],
'E': ['01:14', '01:22'], 'D': ['01:23', '01:31'], 'G': ['01:00', '01:06'],
'F': ['01:07', '01:13'], 'I': ['00:48', '00:53'], 'H': ['00:54', '00:59'],
'K': ['00:37', '00:41'], 'J': ['00:42', '00:47'], 'M': ['00:27', '00:31'],
'L': ['00:32', '00:36'], 'O': ['00:18', '00:22'], 'N': ['00:23', '00:26'],
'Q': ['00:11', '00:13'], 'P': ['00:14', '00:17'], 'S': ['00:03', '00:06'],
'R': ['00:07', '00:10'], 'U': ['', ''], 'T': ['00:00', '00:02'], 'W': ['', ''], 'V': ['', ''],
'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'W': {'A': ['02:51', '05:51'], 'C': ['01:41', '02:02'], 'B': ['02:03', '02:50'],
'E': ['01:24', '01:31'], 'D': ['01:32', '01:40'], 'G': ['01:09', '01:15'],
'F': ['01:16', '01:23'], 'I': ['00:57', '01:02'], 'H': ['01:03', '01:08'],
'K': ['00:46', '00:50'], 'J': ['00:51', '00:56'], 'M': ['00:37', '00:40'],
'L': ['00:41', '00:45'], 'O': ['00:28', '00:31'], 'N': ['00:32', '00:36'],
'Q': ['00:20', '00:23'], 'P': ['00:24', '00:27'], 'S': ['00:13', '00:15'],
'R': ['00:16', '00:19'], 'U': ['00:06', '00:08'], 'T': ['00:09', '00:12'],
'W': ['00:00', '00:02'], 'V': ['00:03', '00:05'], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'V': {'A': ['02:48', '05:48'], 'C': ['01:38', '01:59'], 'B': ['02:00', '02:47'],
'E': ['01:21', '01:28'], 'D': ['01:29', '01:37'], 'G': ['01:06', '01:12'],
'F': ['01:13', '01:20'], 'I': ['00:54', '00:59'], 'H': ['01:00', '01:05'],
'K': ['00:43', '00:47'], 'J': ['00:48', '00:53'], 'M': ['00:34', '00:37'],
'L': ['00:38', '00:42'], 'O': ['00:25', '00:28'], 'N': ['00:29', '00:33'],
'Q': ['00:17', '00:20'], 'P': ['00:21', '00:24'], 'S': ['00:10', '00:12'],
'R': ['00:13', '00:16'], 'U': ['00:03', '00:05'], 'T': ['00:06', '00:09'],
'W': ['', ''], 'V': ['00:00', '00:02'], 'Y': ['', ''], 'X': ['', ''], 'Z': ['', '']},
'Y': {'A': ['02:57', '05:57'], 'C': ['01:47', '02:08'], 'B': ['02:09', '02:56'],
'E': ['01:30', '01:37'], 'D': ['01:38', '01:46'], 'G': ['01:15', '01:21'],
'F': ['01:22', '01:29'], 'I': ['01:03', '01:08'], 'H': ['01:09', '01:14'],
'K': ['00:52', '00:56'], 'J': ['00:57', '01:02'], 'M': ['00:42', '00:46'],
'L': ['00:47', '00:51'], 'O': ['00:34', '00:37'], 'N': ['00:38', '00:41'],
'Q': ['00:26', '00:29'], 'P': ['00:30', '00:33'], 'S': ['00:19', '00:21'],
'R': ['00:22', '00:25'], 'U': ['00:12', '00:14'], 'T': ['00:15', '00:18'],
'W': ['00:06', '00:08'], 'V': ['00:09', '00:11'], 'Y': ['00:00', '00:02'],
'X': ['00:03', '00:05'], 'Z': ['', '']},
'X': {'A': ['02:54', '05:54'], 'C': ['01:44', '02:05'], 'B': ['02:06', '02:53'],
'E': ['01:27', '01:34'], 'D': ['01:35', '01:43'], 'G': ['01:12', '01:18'],
'F': ['01:19', '01:26'], 'I': ['01:00', '01:05'], 'H': ['01:06', '01:11'],
'K': ['00:49', '00:53'], 'J': ['00:54', '00:59'], 'M': ['00:40', '00:43'],
'L': ['00:44', '00:48'], 'O': ['00:31', '00:34'], 'N': ['00:35', '00:39'],
'Q': ['00:23', '00:26'], 'P': ['00:27', '00:30'], 'S': ['00:16', '00:18'],
'R': ['00:19', '00:22'], 'U': ['00:09', '00:11'], 'T': ['00:12', '00:15'],
'W': ['00:03', '00:05'], 'V': ['00:06', '00:08'], 'Y': ['', ''], 'X': ['00:00', '00:02'],
'Z': ['', '']},
'Z': {'A': ['03:00', '06:00'], 'C': ['01:50', '02:11'], 'B': ['02:12', '02:59'],
'E': ['01:32', '01:40'], 'D': ['01:41', '01:49'], 'G': ['01:18', '01:24'],
'F': ['01:25', '01:31'], 'I': ['01:06', '01:11'], 'H': ['01:12', '01:17'],
'K': ['00:55', '00:59'], 'J': ['01:00', '01:05'], 'M': ['00:45', '00:49'],
'L': ['00:50', '00:54'], 'O': ['00:36', '00:40'], 'N': ['00:41', '00:44'],
'Q': ['00:29', '00:31'], 'P': ['00:32', '00:35'], 'S': ['00:21', '00:24'],
'R': ['00:25', '00:28'], 'U': ['00:15', '00:17'], 'T': ['00:18', '00:20'],
'W': ['00:09', '00:11'], 'V': ['00:12', '00:14'], 'Y': ['00:03', '00:05'],
'X': ['00:06', '00:08'], 'Z': ['00:00', '00:02']},
'P': {'P': ['00:00', '00:03'], 'O': ['00:04', '00:07'], 'N': ['00:08', '00:12'],
'M': ['00:13', '00:16'], 'L': ['00:17', '00:21'], 'K': ['00:22', '00:27'],
'J': ['00:28', '00:32'], 'I': ['00:33', '00:38'], 'H': ['00:39', '00:45'],
'G': ['00:46', '00:51'], 'F': ['00:52', '00:59'], 'E': ['01:00', '01:07'],
'D': ['01:08', '01:16'], 'C': ['01:17', '01:38'], 'B': ['01:39', '02:27'],
'A': ['02:28', '05:28'], 'Q': ['', ''], 'R': ['', ''], 'S': ['', ''],
'T': ['', ''], 'U': ['', ''], 'V': ['', ''], 'W': ['', ''], 'X': ['', ''],
'Y': ['', ''], 'Z': ['', '']}
}
padi_table_2 = {10: {'Y': (199, 20), 'X': (178, 41), 'W': (160, 59), 'V': (145, 74), 'U': (133, 84), 'T': (122, 97),
'S': (112, 107), 'R': (104, 115), 'Q': (95, 124), 'P': (88, 131), 'O': (82, 137), 'N': (75, 144),
'M': (70, 149), 'L': (64, 155), 'K': (59, 160), 'J': (54, 165), 'I': (50, 169), 'H': (45, 174),
'G': (41, 178), 'F': (37, 182), 'E': (34, 185), 'D': (30, 189), 'C': (26, 193), 'B': (20, 199),
'A': (10, 209)},
12: {'Y': (134, 14), 'X': (125, 22), 'W': (116, 31), 'V': (108, 39), 'U': (101, 46), 'T': (94, 53),
'S': (88, 59), 'R': (82, 65), 'Q': (76, 71), 'P': (71, 76), 'O': (66, 81), 'N': (57, 90),
'M': (57, 90), 'L': (53, 94), 'K': (49, 98), 'J': (45, 102), 'I': (42, 105), 'H': (38, 109),
'G': (35, 112), 'F': (32, 115), 'E': (29, 118), 'D': (26, 121), 'C': (23, 124), 'B': (17, 130),
'A': (9, 138)},
14: {'X': (92, 6), 'W': (87, 11), 'V': (82, 16), 'U': (77, 21), 'T': (73, 25), 'S': (68, 30),
'R': (64, 34), 'Q': (61, 37), 'P': (57, 41), 'O': (53, 45), 'N': (50, 48), 'M': (47, 51),
'L': (43, 55), 'K': (40, 58), 'J': (37, 61), 'I': (35, 63), 'H': (32, 66), 'G': (29, 69),
'F': (27, 71), 'E': (24, 74), 'D': (22, 76), 'C': (19, 79), 'B': (15, 83), 'A': (8, 90)},
16: {'W': (70, 2), 'V': (67, 5), 'U': (63, 9), 'T': (60, 12), 'S': (56, 16), 'R': (53, 19),
'Q': (50, 22), 'P': (48, 24), 'O': (45, 27), 'N': (42, 30), 'M': (39, 33), 'L': (37, 35),
'K': (34, 38), 'J': (32, 40), 'I': (29, 43), 'H': (27, 45), 'G': (25, 47), 'F': (23, 49),
'E': (21, 51), 'D': (19, 53), 'C': (17, 55), 'B': (13, 59), 'A': (7, 65)},
18: {'U': (53, 3), 'T': (51, 5), 'S': (48, 8), 'R': (46, 10), 'Q': (43, 13), 'P': (41, 15),
'O': (39, 17), 'N': (36, 20), 'M': (34, 22), 'L': (32, 24), 'K': (30, 26), 'J': (28, 28),
'I': (26, 30), 'H': (24, 32), 'G': (22, 34), 'F': (20, 36), 'E': (18, 38), 'D': (16, 40),
'C': (15, 41), 'B': (11, 45), 'A': (6, 50)},
20: {'S': (42, 3), 'R': (40, 5), 'Q': (38, 7), 'P': (36, 9), 'O': (34, 11), 'N': (32, 13),
'M': (30, 15), 'L': (28, 17), 'K': (26, 19), 'J': (25, 20), 'I': (23, 22), 'H': (21, 24),
'G': (20, 25), 'F': (18, 27), 'E': (16, 29), 'D': (15, 30), 'C': (13, 32), 'B': (10, 35),
'A': (6, 39)},
22: {'Q': (34, 3), 'P': (32, 5), 'O': (30, 7), 'N': (29, 8), 'M': (27, 10), 'L': (25, 12),
'K': (24, 13), 'J': (22, 15), 'I': (21, 16), 'H': (19, 18), 'G': (18, 19), 'F': (16, 21),
'E': (15, 22), 'D': (13, 24), 'C': (12, 25), 'B': (9, 28), 'A': (5, 32)},
25: {'O': (26, 3), 'N': (25, 4), 'M': (23, 6), 'L': (22, 7), 'K': (21, 8), 'J': (19, 10), 'I': (18, 11),
'H': (17, 12), 'G': (15, 14), 'F': (14, 15), 'E': (13, 16), 'D': (11, 18), 'C': (10, 19),
'B': (8, 21), 'A': (4, 25)},
30: {'L': (17, 3), 'K': (16, 4), 'J': (15, 5), 'I': (14, 6), 'H': (13, 7), 'G': (12, 8), 'F': (11, 9),
'E': (10, 10), 'D': (9, 11), 'C': (8, 12), 'B': (6, 14), 'A': (3, 17)},
35: {'H': (11, 3), 'G': (10, 4), 'F': (9, 5), 'E': (9, 5), 'D': (98, 6), 'C': (7, 7), 'B': (5, 9),
'A': (3, 11)},
40: {'B': (5, 4), 'A': (2, 7)}
}
max_bottom_times = {10: 219, 12: 147, 14: 98, 16: 72, 18: 56, 20: 45, 22: 37, 25: 29, 30: 20, 35: 14, 40: 9}
end_pressure_groups = sorted(string.ascii_uppercase, reverse=True)
def get_depth_group(depth):
depths = sorted(padi_table_1.keys())
last_dep = 0
for d in depths:
if last_dep < depth <= d:
return d
last_dep = d
def max_bottom_time(depth):
dep_group = get_depth_group(depth)
return max_bottom_times[dep_group]
def get_nearest_time_frame(dive_time, depth):
times = sorted([int(x) for x in padi_table_1[depth].keys()])
last_time = 0
for t in times:
if last_time < dive_time <= t:
return t
last_time = t
def get_end_pres(time, depth):
depth = get_depth_group(depth)
time = str(get_nearest_time_frame(time, depth))
pressure = padi_table_1[depth][time]
return pressure
# calculate required surface interval for desired pressure group
def get_interval(pressure_i, pressure_e):
interval = surface_table[pressure_i][pressure_e]
return interval
# time string to seconds
def time2secs(str_time):
hour_seconds = int(str_time.split(':')[0])*60*60
min_seconds = int(str_time.split(':')[1])*60
return hour_seconds + min_seconds
# get pressure group after given time and start group
def pressure_after_time(start_p, surf_time):
surf_time *= 60
if surf_time >= 3*60*60:
return 'A'
intervals = surface_table[start_p]
for x in intervals.keys():
interval = intervals[x]
if time2secs(interval[0]) <= surf_time <= time2secs(interval[1]):
return x
def min_d2_start_pressure(d2_depth, d2_time):
closest_depth = get_depth_group(d2_depth)
max_times = padi_table_2[closest_depth]
for x in sorted(max_times.keys(), reverse=True):
abt = max_times[x][1]
if d2_time > abt:
continue
else:
return x
def min_surface(d1_end_p, d2_depth, d2_time):
d2_start_p = min_d2_start_pressure(d2_depth, d2_time)
if d1_end_p < d2_start_p:
return 0
else:
surface_interval = get_interval(d1_end_p, d2_start_p)
get_min_minutes = time2secs(surface_interval[0]) / 60
return get_min_minutes
def repeat_dive_end_pressure(si_p_end, d2_depth, d2_time):
closest_depth = get_depth_group(d2_depth)
bottom_time_adjustment = padi_table_2[closest_depth][si_p_end][0]
adjusted_time = d2_time + bottom_time_adjustment
return get_end_pres(adjusted_time, closest_depth)