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

Home » Public Forums » archive » Re: Help: Plotting 3d data as 2d intensity map or histogram
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: Help: Plotting 3d data as 2d intensity map or histogram [message #41397] Mon, 25 October 2004 10:20 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 21 Oct 2004 20:07:14 -0700, Gianguido wrote:

> Hi everyone,
>
> here's my problem:
> I have an 3 x N array. the 3 cols represent r,t and F(r,t). I don't
> know what the function F is I just have some noisy data to fill the
> matrix.
>
> I would like to compute a 2d image where the intensity of each pixel
> is proportional to the average value of F(r,t) and where the
> coordinates of the pixel in question is related to the value of r and
> t.
>
> I have two further points:
>
> 1) r and t are continuous so I would like to create bins along the
> axes
> 2) within a given bin (or a given r and t range) F(r,t) can have
> different values, so I need to compute the average of F over the bin.
>
> I thought hist_2d could do it but that is not what I need... any help
> or suggestions? I have no idea about how to go about coding...
>
> Many thanks for any help you can give!

Using HIST_ND (http://www.dfanning.com/programs/hist_nd.pro) with
reverse indices should do the trick. You bin the data in 2D (choose an
appropriate number of bins in each direction), and then compute the
total (or average) F value in each bin by visiting the reverse indices
one at a time (they will be indices to the row of the 3xn array you
mention).

All together it would look like, calling your array "a":

im=hist_nd(a[0:1,*],NBINS=[20,20],REVERSE_INDICES=ri)
F_im=make_array(/FLOAT,size(im,/DIMENSIONS))
for j=0,n_elements(im)-1 do if ri[j+1] gt ri[j] then $
F_im[j]=total(a[2,ri[ri[j]:ri[j+1]-1]])

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CW_FORM: Can't seem to get SET_VALUE to work
Next Topic: Re: 2D histogram color plot

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

Current Time: Sat Oct 11 22:26:56 PDT 2025

Total time taken to generate the page: 0.39975 seconds