BWI Climate Data Analysis with MatLab

SO503 Spring 2010

(2/24/2010)   

We will investigate the PGO (Professor Guth Oscillation), which proposes that severe snowfall occurs at BWI every year Professor Guth has a sabbatical (AY 95-96, 02-03, and 09-10).  These are the years with the greatest snowfall on record.

This will be due at 2359 on Wed 3 March 2010.


There is an m file to get you started.  The main learning point of this lab is to create a double loop.

Modified BWI temperature file for easy import to Matlab.  The sample program uses a double loop to create time and temperature vectors; you will do this same procedure with the snowfall data.  If you are feel adventurous, you could import this data as a matrix instead of vectors, and shorten the program substantially. 

Matlab resources.


Weather data for BWI are available from the National Weather Service.   http://www.weather.gov/climate/index.php?wfo=lwx

We want to get the BWI average monthly snowfalls, on the Local Data/Records tab.

Since this is missing all of this year's excitement, we will add those totals from the observed weather tab, where you can get Preliminary Montly Climate Data or the Monthly Weather Summary for the months needed to extend the record to get all of this winter's snow.:

The file will probably have these issues, which you will have to address:.  You can regard this as a pilot project, so you can clean the file up manually.


Much of the buzz about our snowfall has blamed El Nino.  You can get the SOI (Southern Oscillation Index) at:

Get the data from both sources, clean it up, and import it into Matlab.  Call them the UCAR SOI and the OZ SOI.

To compare the BWI data with the SOI, we want to compute the monthly deviation in temperature from average temperature for that month.  Positive values will be higher than normal, and negative values lower.  We will call this the BWI temperature anomaly.


There is an NAO, Northern Oscillation Index, that might be more relevant to our snow


Adjust all the time series so they start at the same time, and end at the same time.  Rather than throwing out the Jan and February snowfall, extrapolate values for those months in the SOI and NAO.  You might also have to extrapolate for the entire 2010 year.

Perform cross correlations for:

Because the months with no snow probably cause problems for our analysis, we are going to get a single annual value for each series (NAO, SOI, BWI-Snow, and annual temperature anomaly). Look at the patterns in the SIO and NAO, and propose a number of months to average to get an annual value which will show the magnitude of the anomaly, and then compute those values. 


Requirements:

Create graphs with the following, in a format that they can be quickly compared to see if there are any relationships:

Create graphs with the following, in a format that they can be quickly compared to see if there are any relationships:

Discuss what these show, including the results of your cross correlations.  Discuss how you determined your annual values, and why you picked that measure.


Hints:

You are likely to encounter two types of errors:

  1. Syntax errors.  You will write something that Matlab does not like, and it will not go past the offending line.  You should look in the command window, where you should see a message.  Part of debugging is learning what the various messages mean.  These are usually (at least with experience) the easier class of error to correct.
  2. Logic errors.  Matlab has no problems with what you commanded, but when it does the computations, you get bad results.  In this case, looking at either a graph of the results, or the array editor (click on your new variables in the workspace panel to bring it up).  In this case you should be able to follow the monthly temperatures and see how they are being entered in the final array.
This shows the results from the time and temp arrays.

While the graph looks fine (see below), there is actually a subtle error here in the time column.

Look carefully at rows 4 and 5, or 16 and 17.  You now have to go back to your code, and see what you did wrong.