ATMS 305 HW 7 (redo opportunity)
Due Wednesday, March 29 at 9:30 AM.
Copy and paste the answers you had before. If you want this assignment regraded, send [email protected] an email when you're ready.
Problem 1
I've included the Champaign Weather Data in this assignment (daily_wx_data_champaign.csv
), as well as the climate indicies data file from last week (*.data
). I've also included the code to load the daily weather data into a pandas
data frame into a data frame called daily_data
, while the climate indicies are loaded into a pandas
data frame called climate_inds
.
(a) Plot a time series of the climate data, with the x-axis being "Time (years)", and add a legend for each inded.
Date | ENSO | PDO | NAO | |
---|---|---|---|---|
0 | 1948-01-01 | 0.26 | -0.11 | -99.90 |
1 | 1948-02-01 | 0.43 | -0.74 | -99.90 |
2 | 1948-03-01 | 0.72 | -0.03 | -99.90 |
3 | 1948-04-01 | 0.21 | -1.33 | -99.90 |
4 | 1948-05-01 | 0.24 | -0.23 | -99.90 |
5 | 1948-06-01 | 0.41 | 0.08 | -99.90 |
6 | 1948-07-01 | 0.08 | -0.92 | -99.90 |
7 | 1948-08-01 | 0.25 | -1.56 | -99.90 |
8 | 1948-09-01 | 0.45 | -1.74 | -99.90 |
9 | 1948-10-01 | -0.64 | -1.32 | -99.90 |
10 | 1948-11-01 | -0.21 | -0.89 | -99.90 |
11 | 1948-12-01 | 0.58 | -1.70 | -99.90 |
12 | 1949-01-01 | 0.18 | -2.01 | -99.90 |
13 | 1949-02-01 | 0.13 | -3.60 | -99.90 |
14 | 1949-03-01 | -0.55 | -1.00 | -99.90 |
15 | 1949-04-01 | 0.15 | -0.53 | -99.90 |
16 | 1949-05-01 | 0.43 | -1.07 | -99.90 |
17 | 1949-06-01 | 0.00 | -0.70 | -99.90 |
18 | 1949-07-01 | -0.06 | -0.56 | -99.90 |
19 | 1949-08-01 | 0.08 | -1.30 | -99.90 |
20 | 1949-09-01 | -0.42 | -0.93 | -99.90 |
21 | 1949-10-01 | -0.59 | -1.41 | -99.90 |
22 | 1949-11-01 | -0.29 | -0.83 | -99.90 |
23 | 1949-12-01 | -0.91 | -0.80 | -99.90 |
24 | 1950-01-01 | -0.74 | -2.13 | 0.56 |
25 | 1950-02-01 | -1.70 | -2.91 | 0.01 |
26 | 1950-03-01 | -1.43 | -1.13 | -0.78 |
27 | 1950-04-01 | -1.29 | -1.20 | 0.65 |
28 | 1950-05-01 | -1.22 | -2.23 | -0.50 |
29 | 1950-06-01 | -1.69 | -1.77 | 0.25 |
... | ... | ... | ... | ... |
798 | 2014-07-01 | 0.42 | 0.70 | 0.21 |
799 | 2014-08-01 | 0.70 | 0.67 | -2.28 |
800 | 2014-09-01 | 0.97 | 1.08 | 1.72 |
801 | 2014-10-01 | 0.76 | 1.49 | -0.87 |
802 | 2014-11-01 | 1.24 | 1.72 | 0.58 |
803 | 2014-12-01 | 0.87 | 2.51 | 1.63 |
804 | 2015-01-01 | 0.94 | 2.45 | 1.57 |
805 | 2015-02-01 | 0.14 | 2.30 | 1.05 |
806 | 2015-03-01 | 0.91 | 2.00 | 1.12 |
807 | 2015-04-01 | 0.83 | 1.44 | 0.64 |
808 | 2015-05-01 | 1.69 | 1.20 | 0.19 |
809 | 2015-06-01 | 1.53 | 1.54 | 0.24 |
810 | 2015-07-01 | 2.34 | 1.84 | -3.14 |
811 | 2015-08-01 | 2.60 | 1.56 | -1.10 |
812 | 2015-09-01 | 2.92 | 1.94 | -0.49 |
813 | 2015-10-01 | 2.77 | 1.47 | 0.99 |
814 | 2015-11-01 | 1.99 | 0.86 | 1.70 |
815 | 2015-12-01 | 1.91 | 1.01 | 1.99 |
816 | 2016-01-01 | 2.96 | 1.53 | -0.37 |
817 | 2016-02-01 | 3.05 | 1.75 | 1.35 |
818 | 2016-03-01 | 1.23 | 2.40 | 0.37 |
819 | 2016-04-01 | 1.78 | 2.62 | 0.26 |
820 | 2016-05-01 | 0.07 | 2.35 | -0.67 |
821 | 2016-06-01 | -0.40 | 2.03 | -0.13 |
822 | 2016-07-01 | -0.56 | 1.25 | -1.72 |
823 | 2016-08-01 | -0.93 | 0.52 | -2.24 |
824 | 2016-09-01 | -1.25 | 0.45 | 0.74 |
825 | 2016-10-01 | -0.25 | 0.56 | 0.96 |
826 | 2016-11-01 | -0.14 | 1.88 | -0.31 |
827 | 2016-12-01 | -0.39 | 1.17 | 0.35 |
828 rows × 4 columns
(b) Plot a time series of the average high and low, and record high and low for the period 1880-2016.
(c) Plot a 3-panel scatter plot using the plot
command of monthly average high temperature vs. ENSO, PDO, and NAO for the period 1950-2016. Be sure to label each plot accordingly (titles, axis labels, units if applicable).
---
---
(a) Create a pandas
data frame containing monthly time series from 1901 to 2017 of mean global temperature, and at the grid point closest to Champaign-Urbana (latitude 40N, longitude 88W).
air | lat | lon | |
---|---|---|---|
time | |||
1901-01-01 | 2.148875 | 41.0 | 273.0 |
1901-02-01 | -4.549070 | 41.0 | 273.0 |
1901-03-01 | -0.112080 | 41.0 | 273.0 |
1901-04-01 | -1.268340 | 41.0 | 273.0 |
1901-05-01 | -0.822690 | 41.0 | 273.0 |
1901-06-01 | 1.292585 | 41.0 | 273.0 |
1901-07-01 | 3.419330 | 41.0 | 273.0 |
1901-08-01 | 0.839621 | 41.0 | 273.0 |
1901-09-01 | 0.039970 | 41.0 | 273.0 |
1901-10-01 | 0.569880 | 41.0 | 273.0 |
1901-11-01 | -1.913354 | 41.0 | 273.0 |
1901-12-01 | -2.497545 | 41.0 | 273.0 |
1902-01-01 | 1.241045 | 41.0 | 273.0 |
1902-02-01 | -4.336280 | 41.0 | 273.0 |
1902-03-01 | 2.226600 | 41.0 | 273.0 |
1902-04-01 | -0.879625 | 41.0 | 273.0 |
1902-05-01 | 1.774370 | 41.0 | 273.0 |
1902-06-01 | -1.651875 | 41.0 | 273.0 |
1902-07-01 | 0.334765 | 41.0 | 273.0 |
1902-08-01 | -1.400959 | 41.0 | 273.0 |
1902-09-01 | -1.731610 | 41.0 | 273.0 |
1902-10-01 | 0.754615 | 41.0 | 273.0 |
1902-11-01 | 3.917701 | 41.0 | 273.0 |
1902-12-01 | -1.297650 | 41.0 | 273.0 |
1903-01-01 | 0.791595 | 41.0 | 273.0 |
1903-02-01 | -0.532330 | 41.0 | 273.0 |
1903-03-01 | 3.727795 | 41.0 | 273.0 |
1903-04-01 | 0.004295 | 41.0 | 273.0 |
1903-05-01 | 1.624905 | 41.0 | 273.0 |
1903-06-01 | -3.041575 | 41.0 | 273.0 |
... | ... | ... | ... |
2014-08-01 | 0.246421 | 41.0 | 273.0 |
2014-09-01 | -0.741530 | 41.0 | 273.0 |
2014-10-01 | -0.430990 | 41.0 | 273.0 |
2014-11-01 | -3.243764 | 41.0 | 273.0 |
2014-12-01 | 2.330320 | 41.0 | 273.0 |
2015-01-01 | -0.100380 | 41.0 | 273.0 |
2015-02-01 | -5.614221 | 41.0 | 273.0 |
2015-03-01 | -0.913440 | 41.0 | 273.0 |
2015-04-01 | 0.875785 | 41.0 | 273.0 |
2015-05-01 | 1.951535 | 41.0 | 273.0 |
2015-06-01 | -0.080650 | 41.0 | 273.0 |
2015-07-01 | -0.844920 | 41.0 | 273.0 |
2015-08-01 | -0.563179 | 41.0 | 273.0 |
2015-09-01 | 2.317325 | 41.0 | 273.0 |
2015-10-01 | 0.810130 | 41.0 | 273.0 |
2015-11-01 | 2.896001 | 41.0 | 273.0 |
2015-12-01 | 6.489240 | 41.0 | 273.0 |
2016-01-01 | 1.573245 | 41.0 | 273.0 |
2016-02-01 | 2.807405 | 41.0 | 273.0 |
2016-03-01 | 4.639920 | 41.0 | 273.0 |
2016-04-01 | 0.166800 | 41.0 | 273.0 |
2016-05-01 | -0.003800 | 41.0 | 273.0 |
2016-06-01 | 1.297495 | 41.0 | 273.0 |
2016-07-01 | 0.372935 | 41.0 | 273.0 |
2016-08-01 | 1.910696 | 41.0 | 273.0 |
2016-09-01 | 2.613180 | 41.0 | 273.0 |
2016-10-01 | 2.727770 | 41.0 | 273.0 |
2016-11-01 | 3.689041 | 41.0 | 273.0 |
2016-12-01 | -0.675730 | 41.0 | 273.0 |
2017-01-01 | 4.579619 | 41.0 | 273.0 |
1393 rows × 3 columns
(b) Plot time series created in (a) in a two panel plot, stacked vertically. Use symbols and lines for each time series. Do this globally and for the grid point closest to Champaign-Urbana. Include appropriate titles (with units) and legends.
(c) Create a scatterplot (using the scatter
command) of ENSO index on the y-axis, PDO index on the x-axis, colored by Champaign-Urbana GISS monthly temperature anomaly. Be sure to include a title, axis labels, units, and a colorbar. Hint: You're going to have to create a new pandas
data frame that covers the same time periods so each of the datasets match up in time.
Date | ENSO | PDO | NAO | Shampoo | |
---|---|---|---|---|---|
0 | 1948-01-01 | 0.26 | -0.11 | -99.90 | -1.963040 |
1 | 1948-02-01 | 0.43 | -0.74 | -99.90 | 0.122245 |
2 | 1948-03-01 | 0.72 | -0.03 | -99.90 | 0.540310 |
3 | 1948-04-01 | 0.21 | -1.33 | -99.90 | 2.090145 |
4 | 1948-05-01 | 0.24 | -0.23 | -99.90 | -1.429335 |
5 | 1948-06-01 | 0.41 | 0.08 | -99.90 | -0.264860 |
6 | 1948-07-01 | 0.08 | -0.92 | -99.90 | 0.365600 |
7 | 1948-08-01 | 0.25 | -1.56 | -99.90 | 0.457111 |
8 | 1948-09-01 | 0.45 | -1.74 | -99.90 | 1.215015 |
9 | 1948-10-01 | -0.64 | -1.32 | -99.90 | -1.594350 |
10 | 1948-11-01 | -0.21 | -0.89 | -99.90 | 2.071966 |
11 | 1948-12-01 | 0.58 | -1.70 | -99.90 | 1.498210 |
12 | 1949-01-01 | 0.18 | -2.01 | -99.90 | 3.826670 |
13 | 1949-02-01 | 0.13 | -3.60 | -99.90 | 1.986925 |
14 | 1949-03-01 | -0.55 | -1.00 | -99.90 | 0.907950 |
15 | 1949-04-01 | 0.15 | -0.53 | -99.90 | -0.785005 |
16 | 1949-05-01 | 0.43 | -1.07 | -99.90 | 0.880065 |
17 | 1949-06-01 | 0.00 | -0.70 | -99.90 | 1.709075 |
18 | 1949-07-01 | -0.06 | -0.56 | -99.90 | 1.938615 |
19 | 1949-08-01 | 0.08 | -1.30 | -99.90 | 0.534321 |
20 | 1949-09-01 | -0.42 | -0.93 | -99.90 | -3.056800 |
21 | 1949-10-01 | -0.59 | -1.41 | -99.90 | 2.088940 |
22 | 1949-11-01 | -0.29 | -0.83 | -99.90 | 0.413606 |
23 | 1949-12-01 | -0.91 | -0.80 | -99.90 | 2.423145 |
24 | 1950-01-01 | -0.74 | -2.13 | 0.56 | 5.202685 |
25 | 1950-02-01 | -1.70 | -2.91 | 0.01 | 0.302845 |
26 | 1950-03-01 | -1.43 | -1.13 | -0.78 | -1.808610 |
27 | 1950-04-01 | -1.29 | -1.20 | 0.65 | -3.613455 |
28 | 1950-05-01 | -1.22 | -2.23 | -0.50 | 0.629835 |
29 | 1950-06-01 | -1.69 | -1.77 | 0.25 | -0.771305 |
... | ... | ... | ... | ... | ... |
798 | 2014-07-01 | 0.42 | 0.70 | 0.21 | -2.557265 |
799 | 2014-08-01 | 0.70 | 0.67 | -2.28 | 0.246421 |
800 | 2014-09-01 | 0.97 | 1.08 | 1.72 | -0.741530 |
801 | 2014-10-01 | 0.76 | 1.49 | -0.87 | -0.430990 |
802 | 2014-11-01 | 1.24 | 1.72 | 0.58 | -3.243764 |
803 | 2014-12-01 | 0.87 | 2.51 | 1.63 | 2.330320 |
804 | 2015-01-01 | 0.94 | 2.45 | 1.57 | -0.100380 |
805 | 2015-02-01 | 0.14 | 2.30 | 1.05 | -5.614221 |
806 | 2015-03-01 | 0.91 | 2.00 | 1.12 | -0.913440 |
807 | 2015-04-01 | 0.83 | 1.44 | 0.64 | 0.875785 |
808 | 2015-05-01 | 1.69 | 1.20 | 0.19 | 1.951535 |
809 | 2015-06-01 | 1.53 | 1.54 | 0.24 | -0.080650 |
810 | 2015-07-01 | 2.34 | 1.84 | -3.14 | -0.844920 |
811 | 2015-08-01 | 2.60 | 1.56 | -1.10 | -0.563179 |
812 | 2015-09-01 | 2.92 | 1.94 | -0.49 | 2.317325 |
813 | 2015-10-01 | 2.77 | 1.47 | 0.99 | 0.810130 |
814 | 2015-11-01 | 1.99 | 0.86 | 1.70 | 2.896001 |
815 | 2015-12-01 | 1.91 | 1.01 | 1.99 | 6.489240 |
816 | 2016-01-01 | 2.96 | 1.53 | -0.37 | 1.573245 |
817 | 2016-02-01 | 3.05 | 1.75 | 1.35 | 2.807405 |
818 | 2016-03-01 | 1.23 | 2.40 | 0.37 | 4.639920 |
819 | 2016-04-01 | 1.78 | 2.62 | 0.26 | 0.166800 |
820 | 2016-05-01 | 0.07 | 2.35 | -0.67 | -0.003800 |
821 | 2016-06-01 | -0.40 | 2.03 | -0.13 | 1.297495 |
822 | 2016-07-01 | -0.56 | 1.25 | -1.72 | 0.372935 |
823 | 2016-08-01 | -0.93 | 0.52 | -2.24 | 1.910696 |
824 | 2016-09-01 | -1.25 | 0.45 | 0.74 | 2.613180 |
825 | 2016-10-01 | -0.25 | 0.56 | 0.96 | 2.727770 |
826 | 2016-11-01 | -0.14 | 1.88 | -0.31 | 3.689041 |
827 | 2016-12-01 | -0.39 | 1.17 | 0.35 | -0.675730 |
828 rows × 5 columns