1. Make a directory called ~/h597/4. Set protection so only you can read and write in this directory.
2. For this assignment, we will examine historical temperature data for Tucson, Arizona. We would like to examine average temperature as it relates to the day of the week here in Tucson. It has been noted that planetary temperature is higher during the work week than during the weekend. Your task is to examine a year's worth of temperature data for Tucson and see if indeed, the average temperatures are higher during the week. See World Climate Report for more information on this phenomenon. This is a typical problem you may encounter, i.e. extracting only relevant data from a complex datafile.
3. Here is a portion of one of the historic datafiles. This file is for January, 1995. Click here to download the actual data for each month. You should download 12 F-6 data files, one for each month of the year you choose to analyze.
Preliminary Local Climatological Data (WS Form: F-6)
Station: WSO TUCSON ARIZONA
Month: JAN
Year: 1995
Temperature in F : :Pcpn :Snow: Wind :Sunshine: Sky :Pk Wnd
===================================== Columns =================================
1 2 3 4 5 6a 6b 7 8 9 10 11 12 13 14 15 16 17 18
Dy Max Min Avg Dep HDD CDD Wtr Snw Dpth Avg Spd Dir Min Psbl S-S Wx Spd Dr
===============================================================================
1 66 37 52 1 13 0 0.00 0.0 0 7.1 16 130 190 31 10 20 E
2 66 44 55 4 10 0 T 0.0 0 9.8 18 130 258 43 7 25 SE
3 64 41 53 2 12 0 T 0.0 0 5.5 10 160 206 34 9 14 E
4 55 46 51 0 14 0 0.46 0.0 0 8.1 21 160 45 7 10 1 23 SE
4. We need to extract just the temperature data for days 1-31 from each file. There are 12 files, one for each month. After extracting the data, we need to concatenate all the data into a single file that contains 365 lines. While doing this, we only need to save the average temperature (which is field 4). We then need to encode the day of the week onto each line. For plotting purposes, it will be easier to encode the days of the week as numbers, e.g. Mon --> 1, Tue --> 2, etc. For example, the year 1995 started on a Sunday, so the output after encoding the day of the week would be:
7 52 1 55 2 53 3 51 4 54 5 49 6 52 7 57 1 59 . . .
5. Your program should prompt you for the start day and then prompt to plot the data. You can find out which day the year 1995 started on by using the "cal" command. For example, cal 1 1995
6. I have created the solution for you to try out. You will not be able to copy it or edit it, you can only execute it. It is: ~h597/bin/try_hw4. You should be able to execute it from any location, make sure the directory has permissions 755. You also need to have an xvgr parameter file in your working directory. Copy it like this: "cp ~h597/bin/temp.par ."
7. Your script should be well-commented and robust. Make sure you test it out with bad data. I will test it when I grade it. Please turn in your xvgr parameter file also. Name it whatever you want. Good luck!
9. turnin hw4 do_hw4 parameter_file