Initial Public Release
This commit is contained in:
commit
c537cc0ec6
32 changed files with 17902 additions and 0 deletions
6
snapindices/templates/404.html
Normal file
6
snapindices/templates/404.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>404 Page Not Found</h1>
|
||||
<p>What you were looking for is just not there.</p>
|
||||
<p><a href="{{ url_for('index') }}">Main</a></p>
|
||||
{% endblock %}
|
6
snapindices/templates/500.html
Normal file
6
snapindices/templates/500.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>500 Internal Server Error</h1>
|
||||
<p>Something didn't work</p>
|
||||
<p><a href="{{ url_for('reset') }}">Main</a></p>
|
||||
{% endblock %}
|
12
snapindices/templates/_formhelpers.html
Normal file
12
snapindices/templates/_formhelpers.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% macro render_field(field) %}
|
||||
{{ field(**kwargs)|safe }}
|
||||
{% if field.errors %}
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
{% for error in field.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
34
snapindices/templates/base.html
Normal file
34
snapindices/templates/base.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{title}}</title>
|
||||
<link href="/static/css/bootstrap-readable.min.css" rel="stylesheet">
|
||||
<link href="/static/css/snapindices.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
</head>
|
||||
<body>
|
||||
<script type=text/javascript>
|
||||
var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
|
||||
</script>
|
||||
<div class="container" style="max-width:90%">
|
||||
<div class="page-header">
|
||||
<h1>{{title}}<br><small>alaska climate data</small></h1>
|
||||
</div>
|
||||
{% block content %}{% endblock %}
|
||||
<hr>
|
||||
|
||||
<div id="footer">
|
||||
<div class="container">
|
||||
<p class="text-muted credit">SNAPIndices is powered by the <a href="http://www.snap.uaf.edu">SNAP project.</a>
|
||||
<br>
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/80x15.png" /></a> This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.
|
||||
<br>
|
||||
<small>Created by <a href="mailto:mrdillon@alaska.edu">Matthew Dillon</a>, 2013.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
65
snapindices/templates/datatypes.html
Normal file
65
snapindices/templates/datatypes.html
Normal file
|
@ -0,0 +1,65 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<h3>Model Details</h3>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>CCCMA CGCM 3.1</dt>
|
||||
<dd>
|
||||
Canadian Centre for Climate Modelling and Analysis – General Circulation Model version 3.1 - t47
|
||||
</dd>
|
||||
<dt>MPI ECHAM 5</dt>
|
||||
<dd>
|
||||
Max Planck Institute for Meteorology – European Centre Hamburg Model 5
|
||||
</dd>
|
||||
<dt>GFDL CM 2.1</dt>
|
||||
<dd>
|
||||
Geophysical Fluid Dynamics Laboratory – Coupled Climate Model 2.1
|
||||
</dd>
|
||||
<dt>UKMO HADCM 3.0</dt>
|
||||
<dd>
|
||||
UK Met Office - Hadley Centre – Coupled Model 3.0
|
||||
</dd>
|
||||
<dt>MIROC 3.2</dt>
|
||||
<dd>
|
||||
Center for Climate System Research – Model for Interdisciplinary Research on Climate (medium resolution)
|
||||
</dd>
|
||||
<dt>5 Model Average</dt>
|
||||
<dd>
|
||||
A composite of the five models listed above
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Emmission Scenario Details (from <a href="http://www.snap.uaf.edu/faq.php#faq_4">SNAP</a>)</h3>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Scenario A1B</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>Rapid economic growth</li>
|
||||
<li>A global population that reaches 9 billion in 2050 and then gradually declines</li>
|
||||
<li>The quick spread of new and efficient technologies</li>
|
||||
<li>A convergent world - income and way of life converge between regions</li>
|
||||
<li>Extensive social and cultural interactions worldwide</li>
|
||||
<li>A balanced emphasis on all energy sources</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt>Scenario B1</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>Rapid economic growth as in A1B, but with rapid changes towards a service and information economy</li>
|
||||
<li>Population rising to 9 billion in 2050 and then declining as in A1</li>
|
||||
<li>Reductions in material intensity and the introduction of clean and resource efficient technologies</li>
|
||||
<li>An emphasis on global solutions to economic, social and environmental stability</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt>Scenario A2</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>A world of independently operating, self-reliant nations</li>
|
||||
<li>Continuously increasing population</li>
|
||||
<li>Regionally oriented economic development</li>
|
||||
<li>Slower and more fragmented technological changes and improvements to per capita income</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
{% endblock %}
|
68
snapindices/templates/details.html
Normal file
68
snapindices/templates/details.html
Normal file
|
@ -0,0 +1,68 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
|
||||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
|
||||
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
|
||||
|
||||
<h2>{{ community_name }}</h4>
|
||||
|
||||
<div id="map" style="width: 500px; height: 300px"></div>
|
||||
<br>
|
||||
|
||||
<h3>Monthly Temperatures</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Year<br> </th>
|
||||
<th>January<br>°C</th>
|
||||
<th>February<br>°C</th>
|
||||
<th>March<br>°C</th>
|
||||
<th>April<br>°C</th>
|
||||
<th>May<br>°C</th>
|
||||
<th>June<br>°C</th>
|
||||
<th>July<br>°C</th>
|
||||
<th>August<br>°C</th>
|
||||
<th>September<br>°C</th>
|
||||
<th>October<br>°C</th>
|
||||
<th>November<br>°C</th>
|
||||
<th>December<br>°C</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for temp in temps %}
|
||||
<tr>
|
||||
<td>{{ temp[0]|int }}</td>
|
||||
<td>{{ temp[1]|round(2) }}</td>
|
||||
<td>{{ temp[2]|round(2) }}</td>
|
||||
<td>{{ temp[3]|round(2) }}</td>
|
||||
<td>{{ temp[4]|round(2) }}</td>
|
||||
<td>{{ temp[5]|round(2) }}</td>
|
||||
<td>{{ temp[6]|round(2) }}</td>
|
||||
<td>{{ temp[7]|round(2) }}</td>
|
||||
<td>{{ temp[8]|round(2) }}</td>
|
||||
<td>{{ temp[9]|round(2) }}</td>
|
||||
<td>{{ temp[10]|round(2) }}</td>
|
||||
<td>{{ temp[11]|round(2) }}</td>
|
||||
<td>{{ temp[12]|round(2) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<script>
|
||||
var map = L.map('map').setView([{{ lat }}, {{ lon }}], 5);
|
||||
|
||||
L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg', {
|
||||
maxZoom: 18,
|
||||
attribution: '{{ community_name }}, AK'
|
||||
}).addTo(map);
|
||||
|
||||
var marker_1 = L.marker([{{ lat }}, {{ lon }}]);
|
||||
marker_1.bindPopup("{{ community_name }}, AK<br>{{ lat }}° N, {{ lon }}° W");
|
||||
map.addLayer(marker_1)
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
211
snapindices/templates/index.html
Normal file
211
snapindices/templates/index.html
Normal file
|
@ -0,0 +1,211 @@
|
|||
{% extends "base.html" %}
|
||||
{% from "_formhelpers.html" import render_field %}
|
||||
{% block content %}
|
||||
|
||||
<p class="lead" align="justify">
|
||||
Air temperature data from over 400 communities, reduced to relevant engineering parameters
|
||||
(<a href="#info">Additional info</a>)
|
||||
</p>
|
||||
|
||||
<h3>Search</h3>
|
||||
|
||||
<form action="" method="post" role="form">
|
||||
{{ form.csrf_token }}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="communityinput">Community</label>
|
||||
{{ render_field(form.community, class='form-control', id='communityinput') }}
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="modelinput">Dataset</label>
|
||||
{{ render_field(form.model, class='form-control', id='modelinput') }}
|
||||
<small>Historical (1901-2009) or Projection (2001-2099)<br>
|
||||
<a href="{{ url_for('datatypes') }}" target="_blank">
|
||||
Learn more about the models and scenarios
|
||||
</a></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="minyearinput">Start Year</label>
|
||||
{{ render_field(form.minyear, class='form-control', id='minyearinput') }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="maxyearinput">End Year</label>
|
||||
{{ render_field(form.maxyear, class='form-control', id='maxyearinput') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group col-md-4">
|
||||
<input type="submit" name="submit" class="btn btn-primary form-control" value="Get Temperatures" >
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<input type="button" name="reset" class="btn btn-danger form-control"
|
||||
onclick="window.location.href='{{ url_for('reset') }}'"
|
||||
value="Clear All Data" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<h3>Results</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Community<br> </th>
|
||||
<th>Years<br> </th>
|
||||
<th>T<sub>avg</sub><br>°C</th>
|
||||
<th>ATI<br>°C-days</th>
|
||||
<th>AFI<br>°C-days</th>
|
||||
<th>DTI<br>°C-days</th>
|
||||
<th>DFI<br>°C-days</th>
|
||||
<th>Type<br> </th>
|
||||
<th width="50px">Add/<br>Remove</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="active">
|
||||
<td colspan="9" align="center">
|
||||
Current Search
|
||||
</td>
|
||||
</tr>
|
||||
{% if session['avg_temp'] %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('details', lat=session['community_data']['latitude'],
|
||||
lon=session['community_data']['longitude'],
|
||||
name=session['community_data']['name'],
|
||||
datasets=session['datasets'],
|
||||
community_id=session['community_data']['id'],
|
||||
minyear=session['minyear'],
|
||||
maxyear=session['maxyear']) }}"
|
||||
target="_blank">
|
||||
{{ session['community_data']['name'] }}<br>
|
||||
<small>{{ session['community_data']['latitude'] }}° N,
|
||||
{{ session['community_data']['longitude'] }}° W</small></a></td>
|
||||
<td>{{ session['minyear'] }} - {{ session['maxyear'] }}</td>
|
||||
<td>{{ session['avg_temp']|round(1) }}</td>
|
||||
<td>{{ session['avg_indices'][0] }}</td>
|
||||
<td>{{ session['avg_indices'][1] }}</td>
|
||||
<td>{{ session['des_indices'][0] }}</td>
|
||||
<td>{{ session['des_indices'][1] }}</td>
|
||||
<td>{{ session['ds_name'][0][0] }} ({{ session['ds_name'][0][1] }})</td>
|
||||
<td><button type="button" class="btn btn-success btn-sm"
|
||||
onclick="window.location.href='{{ url_for('save') }}'"
|
||||
title="Click to save this search">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</button></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="9" align="center">
|
||||
[no data]
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{#
|
||||
<tr>
|
||||
<td colspan="9"> </td>
|
||||
</tr>
|
||||
#}
|
||||
<tr class="active">
|
||||
<td colspan="9" align="center">
|
||||
Saved Searches
|
||||
</td>
|
||||
</tr>
|
||||
{% if session.save %}
|
||||
{% for key, value in session.save|dictsort %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('details', lat=value['community_data']['latitude'],
|
||||
lon=value['community_data']['longitude'],
|
||||
name=value['community_data']['name'],
|
||||
datasets=value['datasets'],
|
||||
community_id=value['community_data']['id'],
|
||||
minyear=value['minyear'],
|
||||
maxyear=value['maxyear']) }}"
|
||||
target="_blank">
|
||||
{{ value['community_data']['name'] }}<br>
|
||||
<small>{{ value['community_data']['latitude'] }}° N,
|
||||
{{ value['community_data']['longitude'] }}° W</small></a></td>
|
||||
<td>{{ value['minyear'] }} - {{ value['maxyear'] }}</td>
|
||||
<td>{{ value['avg_temp']|round(1) }}</td>
|
||||
<td>{{ value['avg_indices'][0] }}</td>
|
||||
<td>{{ value['avg_indices'][1] }}</td>
|
||||
<td>{{ value['des_indices'][0] }}</td>
|
||||
<td>{{ value['des_indices'][1] }}</td>
|
||||
<td>{{ value['ds_name'][0][0] }} ({{ value['ds_name'][0][1] }})</td>
|
||||
<td><button type="button" class="btn btn-danger btn-sm"
|
||||
onclick="window.location.href='{{ url_for('delete', record=key) }}'"
|
||||
title="Click to delete this search">
|
||||
<span class="glyphicon glyphicon-trash"></span></button></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="9" align="center">
|
||||
[no data]
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div align="justify">
|
||||
<a name="info"></a>
|
||||
<h3>Info</h3>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>What</dt>
|
||||
<dd>SNAPIndices provides basic engineering climate parameters that are commonly used for engineering and
|
||||
site-development purposes. These parameters include:
|
||||
<ul>
|
||||
<li><strong>T<sub>avg</sub>:</strong> The average (arithmetic mean) air temperature, based on all of
|
||||
the monthly air temperautures for the specified range of years.
|
||||
</li>
|
||||
<li><strong>ATI:</strong> The average (arithmetic mean) annual thawing index. The thawing index is the
|
||||
total number of degree-days above the freezing point. The number displayed by SNAPIndices is the
|
||||
average of the annual indices for the specified range of years.
|
||||
</li>
|
||||
<li><strong>AFI:</strong> The average (arithmetic mean) annual freezing index. The freezing index is the
|
||||
total number of degree-days below the freezing point. The number displayed by SNAPIndices is the
|
||||
average of the annual indices for the specified range of years.
|
||||
</li>
|
||||
<li><strong>DTI:</strong> The design thawing index. The number displayed by SNAPIndices is the
|
||||
arithmetic mean of the three warmest thawing indices for the specified range of years. If less
|
||||
than three years are displayed, the DTI is listed as 'None.' Typically, the DTI is calculated
|
||||
over a 30-year or 10-year time span.
|
||||
</li>
|
||||
<li><strong>DFI:</strong> The design freezing index. The number displayed by SNAPIndices is the
|
||||
arithmetic mean of the three coolest freezing indices for the specified range of years. If less
|
||||
than three years are displayed, the DFI is listed as 'None.' Typically, the DFI is calculated
|
||||
over a 30-year or 10-year time span.
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt>Why</dt>
|
||||
<dd>SNAPIndices provides quick and simple access to the massive amounts of data released by the SNAP
|
||||
group. It does not aim to replace, modify, or build on SNAP's work, but rather provide an alternative
|
||||
means for users to explore and understand the data.</dd>
|
||||
<dt>How</dt>
|
||||
<dd>SNAPIndices is built with <a href="http://www.python.org">python</a>. Check out the GitHub pages for
|
||||
<a href="http://github.com/thermokarst/snapextract">SNAPExtract</a> and
|
||||
<a href="http://github.com/thermokarst/snapindices">SNAPIndices</a> for more info
|
||||
on how to install on your own machine, fork the project, or submit bug reports.
|
||||
</dd>
|
||||
<dt>Who</dt>
|
||||
<dd>This project would not exist without <a href="http://www.snap.uaf.edu">SNAP</a> – take a look at their
|
||||
page to learn about the science and the methods behind their products. On that note, SNAPIndices is not endorsed or supported by SNAP in any way. Similarly, this product is provided as-is, with
|
||||
no warranty express or implied. Use at your own risk.
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue