I have two different sets of data represented in Contourplots:

Data 1


As you can see, in different positions of space, both have these very characteristic sets of four peaks (2 blue and 2 yellow). What I want to know if there is a function or method in Mathematica to spot those similarities and overlay them spacially by shifting the x and y coordinates, similar to what ImageAlign[] does to images I think.

Edit: I created two fileshare links including a .txt file with the data corresponding to each plot. The .txt files have three columns, x,y and f(x,y):

http://www.filedropper.com/data1_3 ; http://www.filedropper.com/data2_2


1 Answer 1


I can't try without the actual data, but my first attempt would be a 2nd derivative Gaussian filter:

GaussianFilter[data, filterSize, {1,1}]

where filterSize is roughly the size of the 2 peak/2 value structure you're looking for.

This essentially convolves the data with a filter kernel that looks like this:

enter image description here

i.e. a Gaussian derived by x and y.

  • $\begingroup$ I edited my post and uploaded the data, in case you are available to try this out yourself. I will definitely try out your suggestion with GaussianFilter[] though, thank you very much $\endgroup$
    – Filipe
    Sep 4, 2016 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.