Assignment 2 River Data
| categories: Assignments
Due Monday 24 September at 5pm accepted till 11pm
This assignment involves working with and plotting data in arrays. Download this zip file and extract it onto your Desktop. It should create a folder named “A2″ with the things you need inside. You will develop your script starting from the template A2.py provided.
The template A2.py reads several datasets from files. These datasets are:
Monthly Jordan and Falls Lake data (from Army Corps of Engineers)
depth: a 276×2 array with depth of Jordan and Falls lakes for each month from Jan 1985 to Dec 2007, which is 23 years. Data that is not available is NaN.
rain: a 276×2 array with total rainfall in inches for each month
Daily Haw river and Jordan Lake data (from USGS)
hawgage: a 365×4 array of daily average river or lake height (ft) at Haw River, Bynum, and above & below the Jordan Lake Dam by Moncure. (These sites are listed upstream to downstream, but the gauges are not in that order.)
hawrain: a 365×2 array of daily rainfall (in) measured at two rain gauges from 29 Aug 07 –28 Aug 08.
Things to do with the Monthly Jordan and Falls Lake data
- Plot a line graph of depths for both lakes.
- The targets for Jordan and Falls lakes are 216ft and 251.5ft, respectively. For how many months was each lake over its target?
- Plot the rain in August as a line graph over years for both lakes.
- Compute the average height that Falls Lake is relative to its target for each month over the 23 years from 1985-2007, and display as bar chart with a bar for each month. Plot the line for 2007 in red on top of this bar chart. Note: height relative to target allows for negative numbers; the lake is sometimes below its target.
Things to do with the daily Haw river/Jordan Lake data
- Determine how many days had more than 1 in of precipitation at both the two sites in hawrain on the same day (you'll need logical_and), and how many days had less than 1/4 in.
- Plot line graphs showing the cumulative amount of rain over the past year at both sites. Which of the two locations (1 or 2) received the most rain? (answer in the file)
- Determine the lowest height for each gauge in hawgage, and create an array of adjusted heights by subtracting the corresponding lowest heights. Plot these adjusted heights as a line graph.
- Determine the maximum increase and maximum decrease in height from one day to the next for each of the four gauges in hawgage. Print the most positive change (maximum increase) for the 4 gages and the most negative change (maximum decrease).
Submit your results
You should submit your results on Sakai in Assignment 2 as a single zip file. That is you should zip up the folder A2 containing your script and images into A2.zip and upload it to Sakai.