I want to perform a map based correlation of two gridded maps to determine how similar they are. Either giving a correlation coefficient or a map of correlation values.
I have a range of synthesised maps to correlate with a real map to figure out which ones match the best. The following code, shows the gridded data, zi and zi2 which I want to compare
xi=np.linspace(min(x),max(x),200)
yi=np.linspace(min(yd),max(y),200)
zi = griddata((x, y), synth_data, (xi[None,:], yi[:,None]), method='cubic')
zi2 = griddata((x, y), real_data, (xi[None,:], yi[:,None]), method='cubic')
would desire some sort of 2D correlation coefficient or cross correlation map.
You can flatten your 2d grids and then just apply pearson correlation.
An other approach zu see similarity ist just subtracting the two scalar fields and then sum the differences. This sum will be an indication for similarity, too.
My favourite approach zu calculate field similarity is described in this paper.