Skip to content

Commit 72375a5

Browse files
committed
feat: google maps
Google maps page added, Js and html adjusted accordingly API key added the genmaps.py git ignore to remove key from version control
1 parent af5d8d8 commit 72375a5

5 files changed

Lines changed: 236 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ updateNDrive.sh
2727
progress.md
2828
AppSecretKey.txt
2929
AQMeshCodes.txt
30+
Python/GM_API_KEY.txt

Python/generateMaps.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ def Read_Two_Column_File(file_name):
8585
font.set_family('monospace')
8686
#####
8787

88+
if generateGoogleMaps:
89+
codesFile = os.path.join('GM_API_KEY.txt')
90+
assert os.path.exists(codesFile), "Can't find file GM_API_KEY.txt in same directory as python script"
91+
f = open(codesFile, 'r')
92+
lines = f.readlines()
93+
f.close()
94+
googlekey = lines[0].strip()
95+
8896
# CHECK PATHS/FILES EXIST
8997
assert os.path.exists(concDir), "CALPUFF output directory does not exist for this date."
9098
assert os.path.exists(xyFile), "Cannot find data/xy_masaya.dat coordinate data file."
@@ -229,7 +237,8 @@ def Read_Two_Column_File(file_name):
229237

230238
if generateGoogleMaps:
231239
gmap = gmplot.GoogleMapPlotter(min(lat) + np.ptp(lat) / 2.,
232-
min(lon) + np.ptp(lon) / 2., zoom=11)
240+
min(lon) + np.ptp(lon) / 2., zoom=11,
241+
apikey=googlekey)
233242
for i in np.arange(0, nx):
234243
for j in np.arange(0, ny):
235244
for k in np.arange(0, len(binLims)-1):
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
<!DOCTYPE html>
2+
<!-- Template by Quackit.com -->
3+
<!-- Images by various sources under the Creative Commons CC0 license and/or the Creative Commons Zero license.
4+
Although you can use them, for a more unique website, replace these images with your own. -->
5+
<html lang="en">
6+
7+
<head>
8+
9+
<meta charset="utf-8">
10+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
11+
<meta name="viewport" content="width=device-width, initial-scale=1">
12+
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
13+
14+
<title>SO2 concentrations Masaya</title>
15+
16+
<!-- Bootstrap Core CSS -->
17+
<link href="../../css/bootstrap.min.css" rel="stylesheet">
18+
19+
<!-- Custom CSS: You can use this stylesheet to override any Bootstrap styles and/or apply your own styles -->
20+
<link href="../../css/custom.css" rel="stylesheet">
21+
<link rel="stylesheet" type="text/css" href="../../css/styles.css">
22+
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
23+
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
24+
<!--[if lt IE 9]>
25+
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
26+
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
27+
<![endif]-->
28+
29+
<!-- Custom Fonts from Google -->
30+
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
31+
<script language="javascript" type="text/javascript" src="../../js/anime.js"></script>
32+
</head>
33+
34+
<body onLoad= "GoToImageG();">
35+
36+
<!-- Navigation -->
37+
<nav id="siteNav" class="navbar navbar-default navbar-fixed-top" role="navigation">
38+
<div class="container">
39+
<!-- Logo and responsive toggle -->
40+
<div class="navbar-header">
41+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
42+
<span class="sr-only">Toggle navigation</span>
43+
<span class="icon-bar"></span>
44+
<span class="icon-bar"></span>
45+
<span class="icon-bar"></span>
46+
</button>
47+
<a class="navbar-brand" href="https://www.cemac.leeds.ac.uk/" target="_blank">
48+
<span class="glyphicon glyphicon-cloud"></span>
49+
CEMAC
50+
</a>
51+
</div>
52+
<!-- Navbar links -->
53+
<div class="collapse navbar-collapse" id="navbar">
54+
<ul class="nav navbar-nav navbar-left">
55+
<li>
56+
<a href="../../index.html">Home</a>
57+
</li>
58+
<li>
59+
<a href="../../About.html">About</a>
60+
</li>
61+
<li class="dropdown">
62+
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">UNRESP <span class="caret"></span></a>
63+
<ul class="dropdown-menu" aria-labelledby="about-us">
64+
<li><a href="../../UNRESP.html">UNRESP_HOME</a></li>
65+
<li><a href="../20181018" >Original</a></li>
66+
<li><a href="../20181019" >Update 1</a></li>
67+
<li><a href="./index.html" >Prototype</a></li>
68+
</ul>
69+
</li>
70+
</ul>
71+
<ul class="nav navbar-nav navbar-right">
72+
<li >
73+
<a href="./index.html">Satellite</a>
74+
</li>
75+
<li>
76+
<a href="./index_topo.html">Topo</a>
77+
</li>
78+
<li class="active">
79+
<a href="./index_google.html">GoogleMaps</a>
80+
</li>
81+
<li>
82+
<a href="./index_AQts.html">Sensor Data</a>
83+
</li>
84+
<li class="dropdown">
85+
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">AQSensor<span class="caret"></span></a>
86+
<ul class="dropdown-menu" aria-labelledby="about-us">
87+
<li><a href="./index_AQts.html">Today</a></li>
88+
<li><a href="AQSensor/EP_index.html" >El Panama</a></li>
89+
<li><a href="AQSensor/EC_index.html" >El Crucero</a></li>
90+
<li><a href="AQSensor/SJ_index.html" >San Juan</a></li>
91+
<li><a href="AQSensor/A_index.html" >Station A</a></li>
92+
<li><a href="AQSensor/B_index.html" >Station B</a></li>
93+
</ul>
94+
</li>
95+
</ul>
96+
</div><!-- /.navbar-collapse -->
97+
</div><!-- /.container -->
98+
</nav>
99+
100+
<!-- Content 1 -->
101+
<section class="content">
102+
<div class="container">
103+
<div class="col-sm-15">
104+
<center>
105+
<h1 class="section-heading" align="center"> UNRESP Sulphur Dioxide - SO<sub>2</sub> </h1>
106+
<h2 style="color:#800000;"><span style="color:#800000;">The forecasting model is under development and should not be used operationally</span></h2>
107+
<div class="container">
108+
<iframe width="650" height="300" frameborder="0" style="border:0" id="animation" src="./google_concrec010001.html" name="animation" alt="UNRESP - University of Leeds 2018"></iframe>
109+
<h3 style="color:#800000;"><span style="color:#800000;">GoogleMaps in Free Mode will not load afer 25,000 loads / month</span></h2>
110+
<table border="0" cellspacing="0" cellpadding="0" align="center">
111+
<td>
112+
<a href="./google_concrec010001.html" target="animation" class="btn btn-primary btn-sm"> + 1 hour</a><br />
113+
<a href="./google_concrec010002.html" target="animation" class="btn btn-primary btn-sm"> + 2 hours</a><br />
114+
<a href="./google_concrec010003.html" target="animation" class="btn btn-primary btn-sm"> + 3 hours</a><br />
115+
<a href="./google_concrec010004.html" target="animation" class="btn btn-primary btn-sm"> + 4 hours</a><br />
116+
<a href="./google_concrec010005.html" target="animation" class="btn btn-primary btn-sm"> + 5 hours</a><br />
117+
<a href="./google_concrec010006.html" target="animation" class="btn btn-primary btn-sm"> + 6 hours</a><br />
118+
<a href="./google_concrec010007.html" target="animation" class="btn btn-primary btn-sm"> + 7 hours</a><br />
119+
<a href="./google_concrec010008.html" target="animation" class="btn btn-primary btn-sm"> + 8 hours</a><br />
120+
</td><td>
121+
<a href="./google_concrec010009.html" target="animation" class="btn btn-primary btn-sm"> + 9 hours</a><br />
122+
<a href="./google_concrec010010.html" target="animation" class="btn btn-primary btn-sm"> + 10 hours</a><br />
123+
<a href="./google_concrec010011.html" target="animation" class="btn btn-primary btn-sm"> + 11 hours</a><br />
124+
<a href="./google_concrec010012.html" target="animation" class="btn btn-primary btn-sm"> + 12 hours</a><br />
125+
<a href="./google_concrec010013.html" target="animation" class="btn btn-primary btn-sm"> + 13 hours</a><br />
126+
<a href="./google_concrec010014.html" target="animation" class="btn btn-primary btn-sm"> + 14 hours</a><br />
127+
<a href="./google_concrec010015.html" target="animation" class="btn btn-primary btn-sm"> + 15 hours</a><br />
128+
<a href="./google_concrec010016.html" target="animation" class="btn btn-primary btn-sm"> + 16 hours</a><br />
129+
</td><td>
130+
<a href="./google_concrec010017.html" target="animation" class="btn btn-primary btn-sm"> + 17 hours</a><br />
131+
<a href="./google_concrec010018.html" target="animation" class="btn btn-primary btn-sm"> + 18 hours</a><br />
132+
<a href="./google_concrec010019.html" target="animation" class="btn btn-primary btn-sm"> + 19 hours</a><br />
133+
<a href="./google_concrec010020.html" target="animation" class="btn btn-primary btn-sm"> + 20 hours</a><br />
134+
<a href="./google_concrec010021.html" target="animation" class="btn btn-primary btn-sm"> + 21 hours</a><br />
135+
<a href="./google_concrec010022.html" target="animation" class="btn btn-primary btn-sm"> + 22 hours</a><br />
136+
<a href="./google_concrec010023.html" target="animation" class="btn btn-primary btn-sm"> + 23 hours</a><br />
137+
<a href="./google_concrec010024.html" target="animation" class="btn btn-primary btn-sm"> + 24 hours</a><br />
138+
</td><td>
139+
<a href="./google_concrec010025.html" target="animation" class="btn btn-primary btn-sm"> + 25 hours</a><br />
140+
<a href="./google_concrec010026.html" target="animation" class="btn btn-primary btn-sm"> + 26 hours</a><br />
141+
<a href="./google_concrec010027.html" target="animation" class="btn btn-primary btn-sm"> + 27 hours</a><br />
142+
<a href="./google_concrec010028.html" target="animation" class="btn btn-primary btn-sm"> + 28 hours</a><br />
143+
<a href="./google_concrec010029.html" target="animation" class="btn btn-primary btn-sm"> + 29 hours</a><br />
144+
<a href="./google_concrec010030.html" target="animation" class="btn btn-primary btn-sm"> + 30 hours</a><br />
145+
<a href="./google_concrec010031.html" target="animation" class="btn btn-primary btn-sm"> + 31 hours</a><br />
146+
<a href="./google_concrec010032.html" target="animation" class="btn btn-primary btn-sm"> + 32 hours</a><br />
147+
</td><td>
148+
<a href="./google_concrec010033.html" target="animation" class="btn btn-primary btn-sm"> + 33 hours</a><br />
149+
<a href="./google_concrec010034.html" target="animation" class="btn btn-primary btn-sm"> + 34 hours</a><br />
150+
<a href="./google_concrec010035.html" target="animation" class="btn btn-primary btn-sm"> + 35 hours</a><br />
151+
<a href="./google_concrec010036.html" target="animation" class="btn btn-primary btn-sm"> + 36 hours</a><br />
152+
<a href="./google_concrec010037.html" target="animation" class="btn btn-primary btn-sm"> + 37 hours</a><br />
153+
<a href="./google_concrec010038.html" target="animation" class="btn btn-primary btn-sm"> + 38 hours</a><br />
154+
<a href="./google_concrec010039.html" target="animation" class="btn btn-primary btn-sm"> + 39 hours</a><br />
155+
<a href="./google_concrec010040.html" target="animation" class="btn btn-primary btn-sm"> + 40 hours</a><br />
156+
</td><td>
157+
<a href="./google_concrec010041.html" target="animation" class="btn btn-primary btn-sm"> + 41 hours</a><br />
158+
<a href="./google_concrec010042.html" target="animation" class="btn btn-primary btn-sm"> + 42 hours</a><br />
159+
<a href="./google_concrec010043.html" target="animation" class="btn btn-primary btn-sm"> + 43 hours</a><br />
160+
<a href="./google_concrec010044.html" target="animation" class="btn btn-primary btn-sm"> + 44 hours</a><br />
161+
<a href="./google_concrec010045.html" target="animation" class="btn btn-primary btn-sm"> + 45 hours</a><br />
162+
<a href="./google_concrec010046.html" target="animation" class="btn btn-primary btn-sm"> + 46 hours</a><br />
163+
<a href="./google_concrec010047.html" target="animation" class="btn btn-primary btn-sm"> + 47 hours</a><br />
164+
<a href="./google_concrec010048.html" target="animation" class="btn btn-primary btn-sm"> + 48 hours</a><br />
165+
</td>
166+
</table>
167+
</div>
168+
</div>
169+
</center>
170+
</div>
171+
</section>
172+
173+
</body>
174+
<!-- Footer -->
175+
<footer class="page-footer">
176+
177+
<!-- Copyright etc -->
178+
<div class="small-print">
179+
<div class="container">
180+
<p>Copyright &copy; CEMAC (UoL) 2018</p>
181+
</div>
182+
</div>
183+
184+
</footer>
185+
186+
<!-- jQuery -->
187+
<script src="../../js/jquery-1.11.3.min.js"></script>
188+
189+
<!-- Bootstrap Core JavaScript -->
190+
<script src="../../js/bootstrap.min.js"></script>
191+
192+
<!-- Plugin JavaScript -->
193+
<script src="../../js/jquery.easing.min.js"></script>
194+
195+
<!-- Custom Javascript -->
196+
<script src="../../js/custom.js"></script>
197+
198+
</body>
199+
200+
</html>

VIZ_SITE_CODE/public_html/js/anime.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ function GoToImage(number){
66
viewPic(number);
77
document.control_form.SequenceForm.value=nameSequence;
88
}
9+
function GoToImageG(){
10+
var iframe = document.createElement("iframe"),
11+
iframeWindow;
12+
iframe.src = "google_concrec010001.html";
13+
document.body.appendChild(iframe);
14+
iframeWindow = iframe.contentWindow || iframe.contentDocument.parentWindow;
15+
iframeWindow.onload = function(){
16+
};
17+
}
918
function animate_fwd(){
1019
if(play_mode==0){return;}
1120
if(current_image>last_pict){

updatesite.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
#!/bin/bash
2+
rundate=$(date +%Y%m%d)
3+
# If the vis hasn't been done yet
4+
runVIS=false
5+
if [ "$runVIS" = true ]; then
6+
echo "### RUNNING VISUALISATION TOOLS"
7+
rm -rf ./vis/${rundate}
8+
mkdir ./vis/${rundate}
9+
cd Python
10+
./generateMaps.py ${rundate}
11+
cd ..
12+
cd vis/${rundate}
13+
ffmpeg -f image2 -r 4 -i static_concrec0100%02d.png -vcodec mpeg4 -y -s 7680x4320 movie_${rundate}.mp4
14+
cd ../..
15+
echo " ---> FINISHED ###"
16+
fi
217
cwd=$(pwd)
318
FNAME=$(date +%Y%m%d)
419
VIZPATH=~/public_html/UNRESP/UNRESP_VIZ/
520
cd vis/$FNAME
6-
mogrify -format jpg *.png
21+
# mogrify -format jpg *.png
722
setfacl -m other:r-x *
823
chmod og+rx *
924
if [ ! -e $VIZPATH$FNAME ]

0 commit comments

Comments
 (0)