Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: Interpolati...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 5636 of 5734
Post > Topic >>

Re: Interpolation

by Spon <christoph.blau@[EMAIL PROTECTED] > Apr 14, 2008 at 08:34 AM

On Apr 13, 1:56 am, tarequea...@[EMAIL PROTECTED]
 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




 8 Posts in Topic:
Interpolation
tarequeaziz@[EMAIL PROTEC  2008-04-11 20:05:44 
Re: Interpolation
"ben.bighair" &  2008-04-12 08:57:08 
Re: Interpolation
tarequeaziz@[EMAIL PROTEC  2008-04-12 13:24:26 
Re: Interpolation
"ben.bighair" &  2008-04-12 15:26:48 
Re: Interpolation
tarequeaziz@[EMAIL PROTEC  2008-04-12 17:56:57 
Re: Interpolation
Spon <christoph.blau@[  2008-04-14 08:34:15 
Re: Interpolation
Spon <christoph.blau@[  2008-04-14 11:44:48 
Re: Interpolation
tarequeaziz@[EMAIL PROTEC  2008-04-14 13:13:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 23:45:15 CDT 2008.