Saturday, February 27, 2010

How stations will be presented

The raw data was downloaded from Environment Canada's website using this routine:



Dim FSO As New FileSystemObject
Dim TextObj As TextStream
Dim FromThis As String
Dim RecItem As ListItem
Dim Maindb As MCSADODB

FromThis = "<table class=" & Chr(34) & "dataTable" & Chr(34)
ToThis = "<form action"

Set Maindb = New MCSADODB

Maindb.OpenDB "L:\global warming\Databases\", "MasterStations.mdb"

For Each RecItem In LocationsList.ListItems

If RecItem.SubItems(3) = "" Then

If RecItem.SubItems(2) = "CC" Then

If Not FSO.FileExists("L:\global warming\RawTextFiles\" & RecItem.Text & " RawData.txt") Then

RecItem.SubItems(3) = "Downloading"

Set TextObj = FSO.CreateTextFile("L:\global warming\RawTextFiles\" & RecItem.Text & " RawData.txt")

For YearIndex = 1900 To 2009

For MonthIndex = 1 To 12

Text1.Text = "http://www.climate.weatheroffice.ec.gc.ca/climateData/bulkdata_e.html?timeframe=2&Prov=XX&StationID=" & RecItem.Text & "&Year=" & YearIndex & "&Month=" & MonthIndex & "&Day=1&format=csv&type=dly"

ReturnedString = Inet1.OpenURL(Text1.Text)
ReturnedString = Replace(ReturnedString, ",", Chr(9))
ReturnedString = Replace(ReturnedString, Chr(34), "")
TextObj.WriteLine ReturnedString

List1.AddItem "ID=" & RecItem.Text & ", Year=" & YearIndex & ", Month =" & MonthIndex, 0

Next

Next

TextObj.Close

RecItem.Bold = True
RecItem.SubItems(3) = "Yes"
RecItem.EnsureVisible

Else

RecItem.SubItems(3) = "Previous"

End If

Maindb.EditRecord "Stations", "StnID", StationID

Maindb.SetField "DownLoaded", "Yes"

Maindb.UpdateRecord

End If

End If

Next

Inet1.Cancel

MsgBox "done"




Each station raw data was stored in a text file. A VB6 routine was then run on those text files to import the records into an Access database, one for each station. The raw data was stored as is in one table. It was then appended into a second table clearing out any nulled values. This second table contained only the date fields, max temp, mean temp and min temp fields. All analysis was done on this table.

Each database was then looped to get a summary of the range of dates, number of records for each station and stored in a master mdb file. This database will also be used to store the trends for each stations so that regional and country summary can be easily calculated.

The data was also broken into regions. West Coast (BC), Central Canada, Southern Ontario, Quebec south, Maritimes, and Arctic. A separate mdb file was created for each of these and all stations for that region appended into it.

Analysis was done using Excel files. A VB6 routine was written to execute the required query in the station mdb file, copied, and then pasted into a template xls file, the range of the series of the graphs changed to match the number of records, the trend equations copied and pasted into cells and the master mbd, and then saved by the station id. Thus one xls for each station.

Each station will be presented in the same way as outlined in my second video.




Each temperature graph will contain the following:

  • Highest of the max temps plot and trend with equation.
  • The upper Standard Deviation of the max temps plot and trend with equation
  • The average of the mean temps plot and trend with equation
  • The lower Standard Deviation of the min temps plot and trend with equation
  • The lowest of the min temps plot and trend with equation

These five points on a graph will show the entire range of yearly temps, not just the average of the mean which is the one AGW proponents use to claim the planet is getting hotter.

At the top of every graph is a summary of the trends over the length of the station's temps.

Each station report will also contain the following graphs:

  1. Length of winter, calculated based on the number days from the first night fall frost to the last night spring frost (the growing season).
  2. The number of hot days. AGW proponents claim the planet is heating up, there will be more heat waves. If so, this graph should show that, if it's true.
  3. The number of extreme cold days.

Each station will also contain a precipitation graph showing rain and snow fall for that location.

Any specific stations presented here individually will be chosen based on the length of data they contain. The criteria will be that a station must have at least 80% of the days from Jan 1, 1900 to Dec 31, 2009. Because so few stations fit into that criteria, there will hence be few stations that will fill the criteria.

The next post will evaluate the state of all the stations.

No comments:

Post a Comment

About Me

jrwakefield (at) mcswiz (dot) com