####COLLATION OF VERSIONS OF HANSEN DATA ###### ## Version ending in 1987 preserved in North Carolina stats class test<-scan("http://www.stat.unc.edu/faculty/rs/s133/Data/hansen.dat") v1987<-ts(test,start=1880) ## Hansen and Lebedeff 1987 contains a hardcopy version ending in 1985 with only a couple of differences from UNC version #a couple of changes were made manually and visually compared to hardcopy hardcopy<-ts(test[(1880:1985)-1879],start=1880) hardcopy[102:103]<-c(.42,.03) ##version ending in 1994 in deg C (beginning in 1867) ###table downloaded manually from http://ingrid.ldeo.columbia.edu/SOURCES/.Indices/.HANSEN/.Global/.Annual/Temperature/T+exch+table-+text+text+skipanyNaN+-table+.html #saved as giss.1994.txt giss94<-read.table("http://www.climateaudit.org/data/hansen/giss.1994.txt",sep="\t") giss94<-ts(giss94[,2],start=giss94[1,1]) giss94=giss94-mean(giss94[(1951:1980)-tsp(giss94)[1]+1]) #version ending in 1996 (Starting in 1867) f<-function(url){ fred<-readLines(url);N<-length(fred) test<-as.numeric(substr(fred,1,4)) temp<-!is.na(test); year<-test[temp] giss<-as.numeric(substr(fred,68,72))[temp] f<-ts(giss[!is.na(giss)],start=year[1])/100 f} url<-"ftp://disc1.gsfc.nasa.gov/data/inter_disc/surf_temp_press/old_tmp_dev/giss_glb_ts.txt" giss96= f(url) ##version ending in 1997 starting in 1861 giss98<-f("ftp://disc1.gsfc.nasa.gov/data/inter_disc/surf_temp_press/tmp_dev/giss/giss_glb_ts.txt") ## current version f<-function(url,skip0=4) { fred<-readLines(url);N<-length(fred) giss<-read.table(url,skip=skip0,nrow=N-5) temp<-(giss=="*") giss[temp]<-NA giss[,3]<-as.numeric(as.character(giss[,3])) f<-ts(giss[,2],start=giss[1,1]) f} url<-"http://data.giss.nasa.gov/gistemp/graphs/Fig.A2.txt" giss06=f(url) ## 11 year smoothed version with implied 1992 ending obtained from Willie Soon by email #saved as giss.1992.txt url<-"http://climateaudit.org/data/hansen/willie_soon.txt" willie<-read.table(url);willie=ts(willie[,2],start=willie[1,1]) #this is an 11-year smooth ending 1987 starting 1885 #so original ends in 1992 ###COLLATION name0=c("year","HL87","1987","Soon","1994","1996","1998","2006") hansen<-ts.union(ts(1861:2006,start=1861),hardcopy,v1987,willie,giss94,giss96,giss98,giss06); dimnames(hansen)[[2]]=name0 #write.table(hansen,file="d:/climate/data/gridcell/giss/hansen.collation.dat",sep="\t",row.name=FALSE) M<-ncol(hansen);hansen=hansen[,2:M] ts.plot(ts(hansen[(1880:1990)-1860,],start=1880),col=c(1,3,2,4:7)) lines(1861:2006,hansen[,"Soon"],col="red",lwd=2) legend(1878,.5,fill=c(1,3,2,4:7),legend=name0[2:8],cex=.8) hansen.smooth=hansen for (i in c(1:2,4:7))){hansen.smooth[,i]=filter(hansen[,i],rep(1/11,11))} ts.plot(ts(hansen.smooth[(1880:1990)-1860,]+.4,start=1880),col=c(1,3,2,4:7),ylim=c(-.18,.78),las=1,xlim=c(1880,1990)) lines(1861:2006,hansen.smooth[,3]+.4,col="red",lwd=2) legend(1878,.85,fill=c(1,3,2,4:7),legend=name0[2:8],cex=.8) #durkin3.gif lines(1861:2006,hansen.smooth[,1]+.4,lty=2) ##SAVE COLLATION hansen<-ts.union(ts(1861:2006,start=1861),hardcopy,v1987,willie,giss94,giss96,giss98,giss06);dimnames(hansen)[[2]]=name0