##NOAA - 5 deg cells #readme: ftp://ftp.ncdc.noaa.gov/pub/data/er-ghcn-sst/er-ghcn-sst.readme.txt #http://www.ncdc.noaa.gov/gcag/gcagmerged.jsp #The ERSST version 2 (ERSST.v2) is used for the merged analysis. That SST analysis is monthly on a 2-degree spatial grid, beginning January 1854 and updated monthly using the available in situ data updates. The ERSST.v2 anomalies are averaged to a 5-degree spatial grid to match the grid of the land data. Because of sparse observations before 1880, the ERSST analysis is heavily damped towards climatology in those years. #The merged analysis is not formed before 1880. #ftp://ftp.ncdc.noaa.gov/pub/data/er-ghcn-sst/temp5d6c.v2.adj.1880.last.dat.gz 6/9/2009 #from E to W and N to S #72 longitudes per lat line make.noaa.trp=function() { url="ftp://ftp.ncdc.noaa.gov/pub/data/er-ghcn-sst/temp5d6c.v2.adj.1880.last.dat.gz" download.file(url,"temp.dat",mode="wb") handle=gzfile("temp.dat") fred=readLines(handle) n=nchar(fred);unique(n) # 10 504 index=fred[n==10] fred=fred[n==504] writeLines(fred,"temp.dat") x=scan("temp.dat") N=length(x); N # 4028482 item N/2592 #1553 x=array(x,dim=c(2592,N/2592) ) noaa=ts( t(x),start=1880,freq=12) #eliminate month year #start at 1880 1 tsp(noaa) #1880.000 2009.333 12.000 temp= noaa== -999.9 noaa[temp]=NA #image.plot( seq(-177.5,177.5,5),seq(-87.5,87.5,5),array(noaa[1553,],dim=c(72,36))[,36:1] ) #world(add=TRUE) grid.noaa= data.frame(long= rep( seq(-177.5,177.5,5),36),lat= gl(36,72,labels= seq(87.5,-87.5,-5)) ) grid.noaa$lat=as.numeric(as.character(grid.noaa$lat) ) temp= abs(grid.noaa$lat)<20 ;sum(temp) #576 noaa.trp = ts(apply(noaa[,temp],1,mean,na.rm=T),start=c(1880,1),freq=12) return(noaa.trp) }