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

Home » Public Forums » archive » Assign data point to n-Dimensional grid
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: Assign data point to n-Dimensional grid [message #80691 is a reply to message #80599] Tue, 26 June 2012 00:43 Go to previous message
antar3s86 is currently offline  antar3s86
Messages: 8
Registered: June 2012
Junior Member
Hi

I have manages to find the nearest neighbor for one parameter using something like that

ii = VALUE_LOCATE(grid, x)
wh = WHERE((grid[ii+1] - x) LT (x-grid[ii]), ct)
if ct GT 0 then ii[wh] = ii[wh]+1
nn = grid(ii)

but I discovered that not all of my parameters are independent. So I split the problem up and located the independent parameters with the procedure above and the dependent ones with a 2-D search using nearestn (http://www.ifa.hawaii.edu/~beaumont/code/nearestn.html). This is a pure coincidence and if I ever have to face a problem with more dependent parameters I will have to think of something else.

Now I face a different problem which I want to describe with an example:

Suppose my grid consists of three parameters, so e.g. gridx = [2,5,10], gridy = [10,40,50], and gridz = [100,101,102]. I need to fit my data point to the first two which can be done with the nearest neighbor method I solved for now. So for two test data points, say, x = [3,11], y = [8,47] they will snap to xs = [2,10], ys = [10,50] which is the 0th and 2nd position in the grid. From that I want to know which z-value and the third grid is assigned to them.

Any ideas how to solve that, meaning how to know at which position the test data points lie in the grid?
[Message index]
 
Read Message
Read Message
Previous Topic: @named_structure % Error opening file. File: named_structure
Next Topic: Matching elements in two arrays of different sizes

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

Current Time: Sun Oct 12 19:22:46 PDT 2025

Total time taken to generate the page: 7.76230 seconds