Puzzled by ImageInterpolate
Annalisa Scimemi
I have 3 waves (the xwave, ywave, zwave) and I initially created a contour plot with them (image on the left in the attached file). At this point, I wanted to interpolate the data of the contour plot and create a smooth image plot. I have tried various types of linear interpolations (passing through Interpolate2/T, XYGridandZtoMatrix, XYZtoMatrix, ImageInterpolate/S), but what I get is a very pixelated image (image on the right in the attached file) and sometimes the outlines of the interpolation do noto follow the outlines of the contour plot. As you can see, my data are displayed as a log-log plot, but I am still confused as to whether this contributes to the weird look of my images. I have looked at similar posts but seem to be unable to find a solution. Thanks!
November 11, 2012 at 07:56 am - Permalink
It is difficult to give you a definitive answer without having access to the data but I suspect the issue here is that you are expecting an interpolation in log scaled data while ImageInterpolate splits the range that you specify with the /S={...} flag into equal (rectangular intervals) in linear space.
As I see it, you have two choices: one is to use /S flag with dx, and dy that correspond to the smallest interval size that you wish to have in log scale. This may require very dense sampling. The second solution is for you to write a function that uses contourZ() and then you are free to interpolate anywhere you want within the convex domain defined by your data.
If you are not sure how to proceed feel free to send us an IGOR experiment with this data set.
A.G.
WaveMetrics, Inc.
November 12, 2012 at 09:15 am - Permalink
November 12, 2012 at 10:48 am - Permalink
To investigate this I executed:
NewGizmo; ModifyGizmo ShowInfo
AppendToGizmo DefaultScatter=root:Graph0:tripletwave,
This shows me that your data consist of multiple samples that are effectively clustered at the four corners of the XY domain with relatively large variations in the z-values at inside each cluster.
I then executed:
This is not very high resolution but should give me an idea about possible issues. Note that I went outside the convex domain of the data to be sure I am not missing anything. To add this to the Gizmo plot:
At this point you can display M_InterpolatedImage as an image and use log scale axes. You should expect to have some NaNs in the display as a result of exceeding the boundary in the /S flag above. Overall I do not see a major problem here as long as you control the resolution of your image with the dx, dy parameters of the /S flag.
I hope this helps,
A.G.
WaveMetrics, Inc.
November 13, 2012 at 12:30 pm - Permalink
However, I still cannot explain the fact that the interpolated image does not look like what I would have expected from the contour plot. In the example exp that I sent out, you can see that the contours define 6 concentric sections (<1.5; 1.5-2; 2-2.5; 2.5-3; 3-3.5; >3.5). I was expecting that, with the image interpolation, I would have obtained an image with the same sections described above, not separated by lines (as in the contour plot) but by color gradients. I am essentially trying to obtain an image interpolation of the contour plot.
Thanks,
Annalisa
November 13, 2012 at 03:20 pm - Permalink
I'm not sure these are concentric sections but then again I can't tell from your graph.
If you follow my directions above and after displaying the image you can add a contour using:
you should get contour lines that cover the range of interpolation. Alternatively, if you want to see more detail in your original contour you can execute:
If you think there is something obvious that I am missing here please contact support@wavemetrics.com so we can resolve this promptly.
A.G.
WaveMetrics, Inc.
November 13, 2012 at 04:03 pm - Permalink