Homework 03: due Thursday, October 18, 2017 (HW03)


UNH has a [http://www.weather.unh.edu/graph_page.pl | weather station], which gives you nice graphs of current and historical weather parameters. The data are also available from a web server. According to Mark Maciolek, who runs the server:

The radiation sensor was dead for a few years at least all of 2014,2015 till July 2016
The wind data is bad for most of 2015 till July of 2016 when the hardware was replaced. Also the layout of the files changed with the new hardware.
This page explains the changes:
http://www.weather.unh.edu/display.mp?FILE=about

I have put the data files on http://jr.sr.unh.edu/~jraeder/weatherdata/.
  1. Write a Perl script that automatically downloads the data.
  2. For each of the variables (temperature,wind_speed,wind_direction) extract the data and store them in a file where each record (line) consists of date/time (both [https://en.wikipedia.org/wiki/Coordinated_Universal_Time | UTC] in [https://en.wikipedia.org/wiki/ISO_8601 | ISO8601] format and UNIX time) and the corresponding value. Watch out for "fill values" that may be inserted for missing data. Also, the time is local time. Make sure you properly convert to UTC.
  3. The data come in 1 minute averages. Average the data to a given (longer) interval DT. The times of the averaged data should be properly centered, i.e., the average at T should be from the data of T-0.5*DT to T+0.5*DT. If there are no data available for an averaging interval, leave a gap in the output. Do the averaging in a Perl sub that you can eventually reuse.
  4. Fill the data gaps by linear interpolation. Again, write a sub that can be reused.
  5. Do not turn in the data files, just the code.