From a wave to another

Dear IgorPro users,

I am looking for a procedure to export a 2D wave with a certain scale (x1,y1) into another wave with a different size and scale (x2,y2) and I know the transformation from x1 to x2 (see this topic : https://www.wavemetrics.com/forum/general/convert-real-space-reciprocal…). I have a solution using the interp2D function but I want to do the same operation without this function for several reasons like loss of time and other problems. The principle is to check the scale coordinates of a certain data cell and convert them into the new wave scale. After that I have two cases, first if I find these coordinates on a new wave, I put the data on this cell (or the sum if the new cell corresponds to several old cells see attachment). Second, if the coordinates of the new wave do not match the old wave, the corresponding cell will be empty.
In other words, I want the same behavior as interpolation without interpolation (second case) and I want some kind of binning algorithm (first case).

I can't get started on this problem, if you have any ideas I am interested

Principle

If you return to https://www.wavemetrics.com/forum/general/cutting-shape-image you will find that I suggested that you look at the Affine transformation in ImageInterpolate.  At the risk of repeating myself, I should point out the following:  Interp2d() computes the result for a single position.  That means that when you are trying to interpolate a 2D matrix you are calling the interp2d() function once for each point.  The overhead in function calls is a problem. 

ImageInterpolate is an operation that was designed to set up the interpolation once for a whole matrix and then, it attempts to efficiently compute (some use of automatic multithreading) the interpolation for all data points.  The operation supports a number of interpolation methods in addition to Affine. 

If you find that none of the methods is appropriate for your application I would suggest that you email a concise set of equations that defines the desired transformation to support@wavemetrics.com and I'll see if we can help.

 

A.G.

thank you, now my team has decided to stop igorpro and migrate to python. I won't need this part of the code.