Saturday, March 23, 2013

In a previous post I showed an active viewer for the Marcott et al proxies, and in the next I described the code. There has been interest in various extensions, to give the option of showing the revised dating of Marcott et al, and also to show a closeup on more recent times.

This is a combined viewer that does those things. The format change is simply that there are a few more entries in the key table, in black at the start. They are

"AuthHolo", for Published (author) dating, -50 to 11300 BP

"MarcHolo", for Marcott et al dating, -50 to 11300 BP

"Auth2000", for Published (author) dating, -50 to 1950 BP

"Marc2000", for Marcott et al dating, -50 to 1950 BP

If you click on any of these, it will change to that scale. You have to click again to select a proxy.

Friday, March 22, 2013

There's a mixture of trends this month. GISS LOTI went from 0.6°C in January to 0.49°C. Satellite measures were well down, but NOAA rose from 0.54°C to 0.58°C. TempLS showed a small decline.

In other news, the equatorial Pacific jet changed from cold to warm in March. That may be transient.

The GISS map for Feb is not yet available. I'll update with a comparison when it is.Update The map is available - I've compared below.

Update. The GISS site had this note:"2013-03-21: The update this month was postponed a week while we investigated some bad reports from various stations in Mongolia. NCDC eliminated the reports today."
Here is the GISS map for Feb 2013:

And here, with the same scale and color scheme, is the earlier TempLS map using spherical harmonics

Thursday, March 21, 2013

I have occasionally posted active viewers of spaghetti plots - most recently the Marcott proxies. There has been interest in how it's done, so I am posting here a fairly generic code. A combination of R and Javascript is required, although I've been able to make the Javascript work from data, so it doesn't have to be specially written for each plot. The work is done in R.

So I'll post the R code and make the Javascript available in a zip file. In R, the spaghetti plot is made, and then a minimal plot with transparent background is made of each component curve, in black. These are png files. The Javascript organises the superposition of them.

Everything you need should be on this zip file. You need to run your data through the makejs() R routine, then display the active.html file.Update 11.47am 21/3 GMT I fixed something in the zip file

The R program

The key element of the R program is the function makejs(). This takes arguments similar to what you would supply to a spaghetti plot routine. The first, xy, is a list of 2-column coordinate matrices, one for each curve. Then xlim, ylim are the x and y ranges, eg c(0,9). These are all required, as is a vector of labels for each curve, to go in the clickable table.

Then there are inputs with defaults. met is a vector of metadata to be displayed with each visible curve, one string of HTML for each. Default is "", which means no display. Fil is a vector with first component a directory, and second a filename prefix. The directory and prefix will be attached to graphics files, and the directory is passed to the Javascript.

In the program as shown, I then assemble the inputs for the Marcott proxies and run the function. Outputs are the spaghetti plot, black line plots and a file called prox.js, which carries information to the Javascript.

HTML and Javascript

It's best at this stage to run with all files in the same directory, with the images in a subdirectory. The html is called active.html, and you can run it locally. Just click in the file explorer. Files you should have there are:
active.html, prox.js
reddot.gif, X.png, X101.png et seq, and Xkey.png (the table).
X is your file prefix (input to makejs()); images should be in your designated graphics dir.

The Marcott stuff uses prox.sav as data - also on the zip.

The R program code

# This program was written by Nick Stokes, www.moyhu.blogspot.com Mar 21 2013, to process input for a complex plot, and to output the graphics and js files for an active plotter. Describes at: www.moyhu.blogspot.com
# Made available under the terms of the GNU GPL

#The key routine is makesjs(), which can be used generally.
#I am using it here for the Marcott et al proxies, described
#https://moyhu.blogspot.com.au/2013/03/an-active-viewer-for-marcott-et-al.html

Tuesday, March 19, 2013

In previousposts I have been going through a simplified emulation of the Marcott et al Holocene temperature reconstruction. I think it will be helpful to provide an active Javascript viewer of the individual proxy data given with that paper.

I made a spaghetti plot of the linearly interpolated proxy temperature anomalies (base 4500-5500 BP) against published dates (not modified). There is a table that you can click on to make each one show up as a black curve. At the same time, the metadata from the Marcott et al SM is shown, and there is a map which shows where the proxy is from.

Update. I've made an extended viewer which lets you look at the effect of dating change, and to see a plot of just the last 2000 years. Update. At Climate Audit, it was suggested that it would be good to be able to black two (or more) curves at once. That is easy, but it is not so easy to make clear which is which. So I've added a swap button. To compare two curves, select one, then the other, and then click swap as often as you want. The last two curves will alternate.

Sunday, March 17, 2013

In my last post, I described a rather primitive emulation of a long period proxy temperature reconstruction by Marcott et al, going back to 11300 BP. I tried first using the published dates, and got a fairly unsurprising result, similar to the paper, except that it lacked a recent spike visible there. Then I tried using the modified dates of Marcott et al, and got s generally similar result, except for a very large initial spike.

I have found a rather trivial reason for this, but I'm not sure what to make of it. At least one proxy sheet in the spreadsheet, proxy 65 RAPID-12-1K, had some junk in a block of numbers well down from the main data block. These are in the data columns E:G, which are, respectively, published date, temperature, and Marcott date. Update, 64 and 68 have similar junk.

My program read those as data, and for some proxies it considerably affected the interpolation. The reason for the difference is that for published dates, the extra numbers seemed to be dates beyond 11300, which did no harm. But in col G, the Marcott dates, they were small numbers, and interpreted as early years.

When I fixed this, and read only numbers in the consecutive data block, the numbers were much more reasonable, although a spike remained.

I don't know if a corresponding issue may have affected the paper. I would doubt it, although it would explain the discrepancy between the thesis version and the Science paper.

Update - I have made some minor changes to the plots:1. I changed the anomaly base from 5800-6200 BP to 4500-5500. The period I initially used was from Fig S26, but the latter is the right one. I don't think it made a perceptible difference2. Romanm at CA noted some spurious zeroes in proxy 62. These caused the earlier dip at about 9000.3. I improved the y-axis alignment of the combined plots.

Details below.
Here are the plots. Firstly the new plot with published dates, which is not much changed:

Then the plot with Marcott revised dates. This has a still considerable spike, but less than before:

And here are the two orange curves solo:

Discussion

The new spike is less than before, and less than for Marcott et al. But it still represents a change caused by dating, and I'm looking into the reasons. I think it may be particular proxies; theree are two main contributions.

One is from, 44: Mount Honey on Campbell Island, has the early part of the date range rather compressed - about 30yr intervals go to about 10 years. The temperatures themselves are unremarkable, but the trends increase.

The other comes from two proxies which have large negative anomalies, but which disappear from the early years on redating. These are 54: OCE326-GGC30 and 58: Flarken Lake. In both cases, re-dating moves the date back 100 and 150 years respectively. In both cases there had been substantial cooling over many centuries.

Code

I won't post a new version yet. There are no method changes; just messing around to get a contiguous block of numbers, and some convenience stuff (which is useful) connected with the two date cases.

Saturday, March 16, 2013

There has been much discussion of a paper by Marcott et al, which is a proxy temperature reconstruction of low resolution proxies going back to 11300 BP. They are distinguished by not requiring calibration relative to measured temperatures.

There has been discussion in make places, but specially at CA and WUWT, where it isn't popular. Steve McIntyre at CA has done a similar emulation.

The complaints are mainly about some recent spikes. My main criticism of the paper so far is that they do plot data in recent times with few proxies to back it. It shows a "hockey stick" which naturally causes excitement. I think they shouldn't do this - the effect is fragile, and unnecessary. Over the last century we have good thermometer records and don't need proxy reinforcement. Indeed the spikes shown are not in accord with the thermometer record, and I doubt if anyone thinks they are real.

Anyway, I thought I would try for a highly simplified recon to see if the main effects could be emulated. R code is provided.

Update - I've done another recon using the revised Marcott dating - see below. It makes a big difference at the recent end, but not much elsewhere.

Further update - I've found why the big spike is introduced. See next post.

Data

The data is an XL spreadsheet. It is in a modern format which the R utility doesn't seem to read, so I saved it, read it in to OpenOffice, and saved it in an older format. There are 73 sheets for the various proxies, over varying time intervals. The paper and SM have details. I'm just using the "published dates" and temperatures. The second sheet has the lat/lon information.

Marcott et al do all kinds of wizardry (I don't know if they are wizards); I'm going to cut lots of corners. Their basic "stack" is a 5x5 degree grid; I could probably start without the weighting, but I've done it. But then I just linearly interpolate the data to put it onto regular 20-year intervals strating at 1940 (going back). They also use this spacing.

Weighting

The trickiest step is weighting. I have to count how many proxies are in each cell at any one time, and down-weight where there are more than one per cell. The Agassiz/Renland was a special issue with two locations; I just used the first lat/lon.

After that, the recon is just the weighted average.

Update - I should note that I am not using strict area weighting, in that I don't account for the reduced area of high latitude cells. I thought it was unreasonable to do so because of the sparsity. An Arctic proxy alone in a cell is likely to be surrounded by empty cells, as are proxies elsewhere, and so downweighting it by its cell area just has the effect of downweighting high latitudes for no good reason. I only downweighted where multiple proxies share a cell. That is slightly favorable to Arctic, since theoretically they can be closer without triggering this downweight. However, in practice that is minor, whereas the alternative of strict area weighting is a real issue.

Graphics

I made a png file with a transparent background, and pasted it over the Marcott Fig 1B, which is the 5x5 recon over 11300 years. There was a lot of trial and error to get them to match. I kept both axes and labels so I could check alignment.

The plot

Mine is the orange curve overwriting their central curve and blue CI's.

Discussion

The most noticeable think is that I get a late rise but not a spike. Again I'm not doing the re-dating etc that they do.

Another interesting effect is that the LIA dips deeper earlier, at about 500 BP, and then gradually recovers, while M et al get the minimum late.

Overall, there is much less smoothing, which is probably undesirable, given the dating uncertainty of the proxies. There is a big dip just after 10k BP, and a few smaller ones.

Aside from that, it tracks pretty well.

Re-dating

Update:
I ran the code again using the revised dating put forward by Marcott et al. It's mostly Marine09, but not always. It doesn't make much difference to the curve overall, but does make a big difference at the recent end. Here is the revised overlay plot:

The code

There is a zip file with this code, the spreadsheet in suitable format, and other input files here. I've done some minor editing for format to the spreadsheet, which may help.Update - Carrick reported that Mac users can't use the xlsRead utility. I've modified the code so that it immediately writes the input to a R binary file, which I have put (prox.sav) in the zip file. So if you have this in the directory, you can just set getxls=F below.

# Need this package:
getxls=F # set to T if you need to read the XL file directly
if(getxls) library("xlsReadWrite")
# The spreadsheet is at this URL "https://www.sciencemag.org/content/suppl/2013/03/07/339.6124.1198.DC1/Marcott.SM.database.S1.xlsx"
# Unfortunately it can't be downloaded and used directly because the R package can't read the format. You need to open it in Excel or OpenOffice and save in an older format.

for(i in 1:73){
u=prox[[i]]
g[[i]]=approx(u[[1]],u[[2]],xout=tm) # R's linear int
y=g[[i]]$y
y=y-mean(y[-25:25+250]) # anomaly to 4500-5500 BR # period changed from 5800-6200
h=cbind(h,y)
}
r=NULL # Will be the recon
# now the tricky 5x5 weighting - different for each time step
for(i in 1:nrow(h)){
o=!is.na(h[i,]) # marks the data this year
g=h[i,o];
u=wu[o]; n=match(u,u); a=table(n); d=as.numeric(names(a));
e=u;e[d]=a;wt=1/e[n]; #wt=weights
r=c(r,sum(g*wt)/sum(wt))
}
# Now standardize to 1961-90, but via using M et al value = -0.04 at 1950 BP
r=r-r[98]-0.04
# now tricky graphics. my.png is the recon. ma.png is cut from fig 1b of the paper. You have to cut it exactly as shown to get the alignment right
png("myrecon.png",width=450,height=370)
par(bg="#ffffff00") # The transparent background
par(mar=c(5.5,5,2.5,0.5)) # changed to better align y-axis
plot(tm,r,type="l",xlim=c(11300,0),ylim=c(-1.2,0.8),col="#ff4400",lwd=3,yaxp=c(-1.2,0.8,5))
dev.off()
# Now an ImageMagick command to superpose the pngs
# You can skip this if you don't have IM (but you should)
system("composite myrecon.png ma.png recons.png")

Saturday, March 9, 2013

The TempLS monthly anomaly for February 2013 was 0.417°C, down slightly from 0.433° in January. I had earlier calculated a rather larger drop, but more incoming data have reduced that. It's still rather early, but there are 3832 data points, which is quite a good number.

This contrasts with very large drops in the satellite indices. But again, they had risen much more in the previous month.
Here is the spherical harmonics plot of the temperature distribution: