Re: Can I use HISTOGRAM to do this? [message #39991] |
Tue, 29 June 2004 01:08 |
Chris Lee
Messages: 101 Registered: August 2003
|
Senior Member |
|
|
In article <6e84eb0a.0406281357.6a6cde84@posting.google.com>, "bridgemat"
<bridgemat@yahoo.com> wrote:
> Re: Can I use HISTOGRAM to do this?
Histogram can do anything, no really :)
I'm dutybound to refer you to the histogram tutorial at
http://www.dfanning.com/tips/histogram_tutorial.html
You want to read the section on Reverse indices. Essentially, histogram
can give you the index numbers of the elements which go into each bin in
your histogram, so..
hist=histogram(geo.lat,min=30,max=90,nbins=61,reverse_indice s=ri)
ind=indgen(61) + 30.5
avg=fltarr(61)
value=fltarr(90,90) ; your array of time values
;the histogram tutorial says what each element of 'ri' is for
for i=0, 60 do if(ind[i] ne 0) then avg[i]=mean(value[ ri[ ri[i]:ri[i+1]-1 ] ])
;end
Chris
|
|
|