-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdd_dirction.py
More file actions
28 lines (20 loc) · 757 Bytes
/
dd_dirction.py
File metadata and controls
28 lines (20 loc) · 757 Bytes
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
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Platform : dd_direction
# Project Name : SYNOP DATA DECODER
# Author : Nikhil Dhandre
#------------------------------------------------------------------------------
import csv
def dd_direction(x):
with open('db/dd_direction.csv') as csvfile:
dd_data=csv.reader(csvfile, delimiter=',')
code_all=[]
dd_all=[]
for row in dd_data:
code=row[0]
dd=row[1]
code_all.append(code)
dd_all.append(dd)
index=code_all.index(x)
return dd_all[index]
#------------------------------------------------------------------------------