(real_spectrum[i]-SR_spectrum[i])^2
chi^2 = SUM(i) ----------------------------
error[i]^2
For each cell of the T beta histogram, the SR spectrum changes with the T and beta of that cell. Therefore the chi^2 is different for each cell. Plotting the 2-D histogram one can see the valley in the chi^2 space.
From tables of chi^2 probability (such as from Advanced Engineering Mathematics, Erwin Kreyszig, John Wiley & sons) one can then determine from the number of degrees of freedom and the desired probability level the corresponding chi^2. The 2-D chi^2 plot is then drawn with a contour of the chi^2 determined from the probability table.