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

Home » Public Forums » archive » 3d Interpolation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
3d Interpolation [message #93031] Wed, 13 April 2016 05:40 Go to next message
there _is_hope is currently offline  there _is_hope
Messages: 3
Registered: April 2016
Junior Member
Dear All IDL users,

I am currently looking for the best way to interpolate an irregular 3-d data set to a regular 3-d grid.

I start with a 2d array of density e.g. 50 x 100, where the first dimension represents the density as a function of energy and the second the density as a function of theta (4) and phi (25) field of view angles.

I wish to interpolate the density data to a regular grid of energy, theta and phi of equal dimensions to that of the initial irregular set.

The energy, theta and phi are all irregularly spaced, but can be converted to an equivalent x, y, z location by considering energy as some sort of radial distance. Due to ease of perform the interpolation the arrays of density, energy, theta, phi, x, y, z can be collapsed to a 1-d array.

The question is there any idl function/procedure that can then perform a 3d interpolation on this data? If not I would very much appreciate any suggestions on how best to perform such an interpolation?

Thank for your time and I look forward to hearing everyones thoughts.
Regards.
Re: 3d Interpolation [message #93032 is a reply to message #93031] Wed, 13 April 2016 05:50 Go to previous messageGo to next message
there _is_hope is currently offline  there _is_hope
Messages: 3
Registered: April 2016
Junior Member
On Wednesday, April 13, 2016 at 8:40:11 AM UTC-4, there _is_hope wrote:
> Dear All IDL users,
>
> I am currently looking for the best way to interpolate an irregular 3-d data set to a regular 3-d grid.
>
> I start with a 2d array of density e.g. 50 x 100, where the first dimension represents the density as a function of energy and the second the density as a function of theta (4) and phi (25) field of view angles.
>
> I wish to interpolate the density data to a regular grid of energy, theta and phi of equal dimensions to that of the initial irregular set.
>
> The energy, theta and phi are all irregularly spaced, but can be converted to an equivalent x, y, z location by considering energy as some sort of radial distance. Due to ease of perform the interpolation the arrays of density, energy, theta, phi, x, y, z can be collapsed to a 1-d array.
>
> The question is there any idl function/procedure that can then perform a 3d interpolation on this data? If not I would very much appreciate any suggestions on how best to perform such an interpolation?
>
> Thank for your time and I look forward to hearing everyones thoughts.
> Regards.

Just in case anyone points me to the various IDL routines for 3d interpolation, such as grid3, please can you provide instructions on how to achieve the above properly.

For example in 1d it is straight forward, int_data_1d = interpol(data_1d, x_1d, int_x_1d) where you provide the abscissa values for the input and output.

However I do not immediately see how to achieve a similar result when using grid3 e.g.

Result = GRID3(X, Y, Z, F).

Thanks
Re: 3d Interpolation [message #93035 is a reply to message #93032] Wed, 13 April 2016 08:12 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 04/13/16 08:50, ysoobiah@googlemail.com wrote:
> On Wednesday, April 13, 2016 at 8:40:11 AM UTC-4, there _is_hope
> wrote:
>> Dear All IDL users,
>>
>> I am currently looking for the best way to interpolate an irregular
>> 3-d data set to a regular 3-d grid.
>>
[snip
> However I do not immediately see how to achieve a similar result when
> using grid3 e.g.
>
> Result = GRID3(X, Y, Z, F).

Does
http://www.harrisgeospatial.com/docs/GRID3.html
provide additional info for your needs?

cheers,

paulv
Re: 3d Interpolation [message #93036 is a reply to message #93035] Wed, 13 April 2016 08:24 Go to previous messageGo to next message
there _is_hope is currently offline  there _is_hope
Messages: 3
Registered: April 2016
Junior Member
On Wednesday, April 13, 2016 at 11:12:34 AM UTC-4, Paul van Delst wrote:
> On 04/13/16 08:50, ysoobiah@googlemail.com wrote:
>> On Wednesday, April 13, 2016 at 8:40:11 AM UTC-4, there _is_hope
>> wrote:
>>> Dear All IDL users,
>>>
>>> I am currently looking for the best way to interpolate an irregular
>>> 3-d data set to a regular 3-d grid.
>>>
> [snip
>> However I do not immediately see how to achieve a similar result when
>> using grid3 e.g.
>>
>> Result = GRID3(X, Y, Z, F).
>
> Does
> http://www.harrisgeospatial.com/docs/GRID3.html
> provide additional info for your needs?
>
> cheers,
>
> paulv

From what I can tell it is unable to interpolate to a specific pre-defined set of points and only interpolates to an equally spaced grid of a certain number of points in x, y, z, which is not what I want.

A compromise would be to be able to interpolate to a number of points within a particular range range, e.q. theta - -40 to +40 for example, but I don't think it can do this either as I am assuming the number points are scaled between 0 and 1.

If anyone can instruct on how to use grid3 to achieve what I am after I would be very grateful.

Thanks.
Re: 3d Interpolation [message #93039 is a reply to message #93036] Thu, 14 April 2016 02:18 Go to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le mercredi 13 avril 2016 17:24:24 UTC+2, ysoo...@googlemail.com a écrit :
> On Wednesday, April 13, 2016 at 11:12:34 AM UTC-4, Paul van Delst wrote:
>> On 04/13/16 08:50, ysoobiah@googlemail.com wrote:
>>> On Wednesday, April 13, 2016 at 8:40:11 AM UTC-4, there _is_hope
>>> wrote:
>>>> Dear All IDL users,
>>>>
>>>> I am currently looking for the best way to interpolate an irregular
>>>> 3-d data set to a regular 3-d grid.
>>>>
>> [snip
>>> However I do not immediately see how to achieve a similar result when
>>> using grid3 e.g.
>>>
>>> Result = GRID3(X, Y, Z, F).
>>
>> Does
>> http://www.harrisgeospatial.com/docs/GRID3.html
>> provide additional info for your needs?
>>
>> cheers,
>>
>> paulv
>
> From what I can tell it is unable to interpolate to a specific pre-defined set of points and only interpolates to an equally spaced grid of a certain number of points in x, y, z, which is not what I want.
>
> A compromise would be to be able to interpolate to a number of points within a particular range range, e.q. theta - -40 to +40 for example, but I don't think it can do this either as I am assuming the number points are scaled between 0 and 1.
>
> If anyone can instruct on how to use grid3 to achieve what I am after I would be very grateful.
>
> Thanks.

The available 3D-interpolators in IDL are GRID3 or the combination QHULL/QGRID3.
The first one fits a smooth function by using the Shepard method, the second build a regular grid from a Delaunay triangulation. In both, you can define the output nodes.
For instance, the call R = grid3(X, Y, Z, F, Gx, Gy, Gz) interpolates the function F given at coordinates X,Y,Z on a regular grid (the array R) or the G nodes when specified.
Please carefully read the documentation before to post.
alx.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Should SORT(Undefined) give an error message?
Next Topic: Accessing numbered arrays

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

Current Time: Wed Oct 08 15:14:34 PDT 2025

Total time taken to generate the page: 0.00624 seconds