forked from jessykate/nasaprofiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
helper.py
146 lines (134 loc) · 5.17 KB
/
helper.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
# Organizational_units = {
#
#
# ARC=Ames%20Research%20Center
#
# DFRC=Dryden%20Flight%20Research%20Center
#
# EOS=Earth%20Observing%20System
# //GSFC
#
# IVV=Fairmont%20IVV%20Facility
# //LaRC
#
# GISS=Goddard%20Institute%20for%20Space%20Studies
# //GSFC
#
# GRC=Glenn%20Research%20Center
#
# GSFC=Goddard%20Space%20Flight%20Center
#
# HQ=Headquarters
#
# JPL=Jet%20Propulsion%20Laboratory
#
# JSC=Johnson%20Space%20Center
#
# KSC=Kennedy%20Space%20Center
#
# LaRC=Langley%20Research%20Center
#
# MSFC=Marshall%20Space%20Flight%20Center
#
# MAF=Michoud%20Assembly%20Facility
# //KSC
#
# NSSC=NASA%20Shared%20Services%20Center
# //SSC
#
# NS=Network%20Services
# //MSFC
#
# SSC=Stennis%20Space%20Center%2co
#
# RJSP=Russia%20Joint%20Space%20Project
# //JSC
#
# WFF=Wallops%20Flight%20Facility
# //GSFC
#
# WSTF=White%20Sands%20Test%20Facility
# //JSC
#
# }
Address = {
"NASA Ames Research Center": "Moffett Field, California 94035",
"NASA Dryden Flight Research Center": "4800 Lilly Drive, Edwards, California 93523-0273",
"NASA Glenn Research Center": "21000 Brookpark Rd, Cleveland, OH 44135",
"Goddard Space Flight Center": "Greenbelt, MD 20771",
"NASA Global Institute of Space Studies": "2880 Broadway, New York, NY",
"NASA Fairmont IVV Facility": "100 University Dr Fairmont, WV 26554",
"Jet Propulsion Laboratory": "4800 Oak Grove Drive, Pasadena, California 91109",
"NASA Johnson Space Center": "Houston, TX 77058",
"NASA Kennedy Space Center": "FL 32899-0001",
"NASA Langley Research Center": "Hampton, Virginia 23681",
"NASA Marshall Spaceflight Center": "One Tranquility Base, Huntsville, AL 35805",
"NASA Headquarters": "300 E Street SW, Washington, DC 20546",
"NASA Shared Services Center": "Building 1111 C Road, MS 39529",
"NASA Stennis Space Center": "MS,39529",
"NASA Wallops Flight Facility": "VA 23337",
"NASA White Sands Test Facility": "12600 NASA Road Las Cruces, NM 88012"
}
Centers = {
"NASA Ames Research Center": "label:ARC|37.411870,-122.062333",
"NASA Dryden Flight Research Center": "label:DFRC|34.901944,-117.891026",
"Glenn Research Center": "label:GRC|41.412728,-81.862178", # checked
"Goddard Space Flight Center": "label:GSFC|38.995938,-76.851768", # checked
"Jet Propulsion Laboratory": "label:JPL|34.203138,-118.172207", #checked
"NASA Johnson Space Center": "label:JSC|29.560726,-95.093365",
"NASA Kennedy Space Center": "label:KSC|28.58583,-80.651321",
"NASA Langley Research Center": "label:LaRC|37.102681,-76.385536",
"NASA Marshall Space Flight Center": "label:MSFC|34.696988,-86.684361",
"NASA Stennis Space Center": "label:SSC|30.302121,-89.594879",
"NASA Headquarters": "label:HQ|38.883128,-77.016413"
}
category_lookup = {
"developer": "<img src='/static/images/category/developer.png'>",
"scientist": "<img src='/static/images/category/scientist.png'>",
"engineer": "<img src='/static/images/category/engineer.png'>",
"management": "<img src='/static/images/category/management.png'>",
"center_ops": "<img src='/static/images/category/center_ops.png'>",
"mission_ops": "<img src='/static/images/category/mission_ops.png'>",
"admin": "<img src='/static/images/category/administrative.png'>",
"legal": "<img src='/static/images/category/legal.png'>",
"finance": "<img src='/static/images/category/finance.png'>",
"communications": "<img src='/static/images/category/communications.png'>"
}
category_sm_lookup = {
"developer": "<img src='/static/images/category/developer_sm.png'>",
"scientist": "<img src='/static/images/category/scientist_sm.png'>",
"engineer": "<img src='/static/images/category/engineer_sm.png'>",
"management": "<img src='/static/images/category/management_sm.png'>",
"center_ops": "<img src='/static/images/category/center_ops_sm.png'>",
"mission_ops": "<img src='/static/images/category/mission_ops_sm.png'>",
"admin": "<img src='/static/images/category/administrative_sm.png'>",
"legal": "<img src='/static/images/category/legal_sm.png'>",
"finance": "<img src='/static/images/category/finance_sm.png'>",
"communications": "<img src='/static/images/category/communications_sm.png'>"
}
def mailing(address):
if address in Address:
mailing_address = Address[address]
return mailing_address
else: return ''
def map(center):
""" return a google maps static url for a nasa center """
selected = '|'.join(["markers=size:large|color:red", Centers.get(center,'')])
others = '|'.join(["markers=size:tiny|color:orange"] + Centers.values())
return "http://maps.google.com/maps/api/staticmap?" + \
"&".join(["center=United+States",
"zoom=3",
"size=320x220",
"maptype=hybrid",
selected,
others,
"sensor=false",
"key=ABQIAAAAcA1uAFMrbjLedVsnIfdzKBTB6AAoiF2DC7aNiN_b61fgFnS7FhTHUsE12TUzpqrichBbMDc2ZKHDlw"])
def category_sm(category):
category_img = category_sm_lookup[category]
return category_img
def category(category):
category_img = category_lookup[category]
return category_img
if __name__ == '__main__':
print map('LaRC')