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

Home » Public Forums » archive » Interpolation
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: Interpolation [message #59877 is a reply to message #2184] Mon, 14 April 2008 08:34 Go to previous messageGo to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Apr 13, 1:56 am, tarequea...@gmail.com wrote:
> Step one: Real data in a XY frame
> Step two: 'Design a new xy frame, say X'Y' frame, whose values are
> generated from a chosen r_vec and theta_vec.
> Step 3: Now interpolate from XY to X'Y'.
>
> Tareque

Hi Tareque,

I'm guessing you know whereabouts your small frame is, within your big
frame, right?
So, if you take your big normal (x'y') frame, your small frame can be
defined by two points,
bottom-left and top-right - let's call them (b,l) & (t,r) - in terms
of x'y' grid co-oords.

-----
; Once you've worked out where these two points are, you can use
CONGRID on your xy dataset:
tempx = r - l ; How many data points of the x'y' grid does the xy grid
span
tempy = t - b ; in each dimension?

; interpolate to new sub-grid
newdata = congrid(data, tempx, tempy)

; Your x'y' frame co-ordinates for this data are
newx = l + lindgen(tempx)
newy = b + lindgen(tempy)

; (this bit is just array juggling to avoid for loops)
newx = rebin(newx,tempx,tempy)
newy = rebin(reform(newy,1,tempy),tempx,tempy)
newx = reform(newx,n_elements(newx))
newy = reform(newy,n_elements(newy))

; x'y' co-ordinates for ever datapoint in 'newdata'
xycoords = transpose([[newx],[newy]])

; so your new data should be at r/theta co-ordinates defined by:
polarcoords = cv_coord(from_rect = xycoords, /to_polar)
-----

I've assumed that your big circle is centered on the origin.
I've also assumed your small circle is in the upper-right quadrant of
your large circle here,
so I don't have to wrap my mind around minus-signs and the like...

I hope this helps and that I've understood your question
correctly. :-)

Regards,
Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDLDOC question
Next Topic: Plotting one ps file with different plots in separate pages

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

Current Time: Wed Oct 08 19:12:48 PDT 2025

Total time taken to generate the page: 0.00530 seconds