comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » linear interpolation to form a deformation field
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: linear interpolation to form a deformation field [message #88435 is a reply to message #88431] Thu, 24 April 2014 12:06 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Dear G,
I'll answer you email here to keep what started in the forum in the forum.

Your Email:
You understand well I am working on 2D. My data (from the image) are on csv form. I insert my data and then I create the two deformation fields Dx and Dy. I had a look on the code you send me but I don't know how to use my data on the INTRPOLATE() function. I have to use the tvscl? I didn't know this procedure before. I followed your code and I tried the following but I got error:


Dx= [[1,2,1,1],[2,1,3,1],[5,8,1,2],[3,8,2,1]]


Dy= [[1,2,3,1],[2,5,4,1],[6,8,1,3],[5,7,2,9]]



tvscl, rebin(array,50,50), 0 ;(array=data from the image)



ERRORS:
REBIN: String expression not allowed in this context: ARRAY.


I need to convert the string to numeric first?


My Answer:
Yes, you need to convert a string to numerical before you can interpolate or do any sort of mathematical operation.
Given an array named array, you obtain the numerical variable with:

numArray = float(array)

then given two arrays that define the new x and y coordinates, you could proceed this way:

new_x_coords= [0.5,0.7,1.9,2.3,7.1]
new_y_coords= [2.5,3.2,4.1,5.3,9.1]

If I define my array as:
x = findgen(10,10)
numArray = (x-3)^2

print, interpolate(numArray,new_x_coords,new_y_coords, /grid)

This will give you the values of the function (x-3)^2 in (0.5,2.5) in the first coordinate point of the result [0,0] in the array. And so on for the other points.

I'm not sure that what you need is interpolation... do *you* know what you need?

cheers
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: xprinter
Next Topic: Re: Error detected while calling MPFIT_FDJAC2

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:35:25 PDT 2025

Total time taken to generate the page: 0.00403 seconds