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

Home » Public Forums » archive » Bounding
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: Bounding [message #17742 is a reply to message #17704] Fri, 12 November 1999 00:00 Go to previous message
Michael Asten is currently offline  Michael Asten
Messages: 53
Registered: March 1999
Member
Brian wrote:

> I am looking for some help with interpolating a surface from ungridded
> data points. I have several thousand measurements in a river with
> corresponding latitudes and longitudes for each of the points. I would
> like to make a surface of these data, but have run into a small
> problem. I have been using a combination of TRIANGULATE and TRIGRID to
> grid the data into a surface, however I end up with data being
> interpolated outside the bounds of the river. Is there any way to bound
> the resulting grid to only include data within the river banks?

Ive seen it done very efffectively using a mask on the grid . As I recall
the logic used was like this (pseudo code ).

gridded data is n points in vectors xgrid,ygrid,zgrid
raw data is m points at locations given by vectors xdata,ydata
cell_size is length of edge of grid cell
no_value =-1.e10 ; is a flag value which is ignored when contouring

dmin=fltarr(n)
for i=0,n-1 do begin
d= sqrt( (xgrid(i)-xdata)^2 + (ygrid(i)-ydata))^2 ) ; vector length m
of distances
dmin(i)=min(d)
endfor
b=where(dmin gt cell_size) ; grid points which are too far from any
measurement point
if b[0] ne -1 then zgrid[b]=no_value ; kill them

contour,zgrid,xgrid,ygrid,min_value=-1.e9

end


Ive been meaning to implement it for some time. I'll be interested to know
whether
Ive got the logic right.

Regards,
Michael Asten
[Message index]
 
Read Message
Read Message
Previous Topic: Eigenvalues
Next Topic: Conversions among datums and geographic coordinates

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

Current Time: Wed Oct 08 19:31:10 PDT 2025

Total time taken to generate the page: 0.00610 seconds