Quiz: Online WeatherSTEM time series extractor

In this quiz, you want to develop a web application that takes and parses user requests, forwards them to the WeatherSTEM server, receives and parses a response into time series data, and finally plots it on the user’s browser.

Submit these two (or three if you did Section 4.4) files in FirstLastnname_quiz3.zip:

File naming penalty: -2 for each

1   Required request syntax

Syntax should be case-insensitive.

Plot rainfall
Retrieve Rain Rate data for today since 00:00:00 until now
Plot temperature
Retrieve Thermometer data for today since 00:00:00 until now
Plot pressure
Retrieve Barometer data for today since 00:00:00 until now
Plot rainfall from yyyy-mm-dd to YYYY-MM-DD
Retrieve Rain Rate data from yyyy-mm-dd 00:00:00 to YYYY-MM-DD 23:59:59
Plot temperature from yyyy-mm-dd to YYYY-MM-DD
Retrieve Thermometer data from yyyy-mm-dd 00:00:00 to YYYY-MM-DD 23:59:59
Plot pressure from yyyy-mm-dd to YYYY-MM-DD
Retrieve Barometer data from yyyy-mm-dd 00:00:00 to YYYY-MM-DD 23:59:59

2   Bottle template

10 points

Create a Bottle template index.tpl with the following elements in that order:

  • H1 for the web application title “Online WeatherSTEM Time Series Extractor”,
  • FORM for taking and passing user requests to the back-end script using the GET method
    • INPUT for typing user requests
    • INPUT for submitting user requests
  • Optional A for allowing the user to download an output CSV file (bonus, see Section 4.1)
  • H2 for the name of time series
  • IMG for displaying time series data

3   Back-end code

90 points

Create a back-end Python script weather_web.py. I will grade the completeness of your back-end script.

Use your own WeatherSTEM API key!

4   Bonus

Credits for bonus questions are all or nothing. Only complete implementation will receive full credits. Otherwise, you will get a 0 for each question.

4.1   Time series CSV file

20 points

Create an output CSV file with time series data and embed it in an A tag using data URLs to avoid creating a physical file and race conditions. There should be two columns: time and rainfall_in_hr (temperature_fahrenheit or pressure_bar). Use the default units from the server and rename the second column accordingly. In the time column, data should be in YYYY-MM-DD hh:mm:ss.

4.2   Multiple weather stations and sensors

10 points

Implement it for multiple weather stations.

Plot rainfall in Gainesville, Hall county
Retrieve Rain Rate data for today since 00:00:00 until now
Plot temperature in Gainesville, Hall county
Retrieve Thermometer data for today since 00:00:00 until now
Plot pressure in Gainesville, Hall county
Retrieve Barometer data for today since 00:00:00 until now
Plot rainfall in Gainesville, Hall county from yyyy-mm-dd to YYYY-MM-DD
Retrieve Rain Rate data from yyyy-mm-dd 00:00:00 to YYYY-MM-DD 23:59:59
Plot temperature from yyyy-mm-dd to YYYY-MM-DD
Retrieve Thermometer data from yyyy-mm-dd 00:00:00 to YYYY-MM-DD 23:59:59
Plot pressure in Gainesville, Hall county from yyyy-mm-dd to YYYY-MM-DD
Retrieve Barometer data from yyyy-mm-dd 00:00:00 to YYYY-MM-DD 23:59:59

4.3   All sensors

10 points

Implement it for all the sensors and list accepted sensor names in the template.

Plot soil moisture
Retrieve Rain Rate data for today since 00:00:00 until now
Plot dewpoint from yyyy-mm-dd to YYYY-MM-DD
Retrieve Rain Rate data from yyyy-mm-dd 00:00:00 to YYYY-MM-DD 23:59:59

4.4   Porting webmap.py

30 points

Port my shared webmap.py from GeoPandas to GDAL and remove dependency on GeoPandas.