Home »
Public Forums »
archive »
Irregular grid -> 2D binned
Irregular grid -> 2D binned [message #49418] |
Fri, 21 July 2006 20:27 |
will[1]
Messages: 6 Registered: July 2006
|
Junior Member |
|
|
I've sucked it up, I think I need a push in the right direction.
Imagine that I have a long (~6 million points) list of data that
includes three fields: latitude, longitude, abundance. The lats and
lons are all over the place (i.e. no regular grid) and I'd like to bin
them into an image. Additionally I'd like to average abundance of each
bin to be the color for the image.
I can use the reverse indices keword in histogram. I can even use mean
pretty well. I can get a binned histogram using histo_2D. But I'm
having a hard time thinking about how to go from the reverse indices of
histogram to the histo_2D case which doesn't offer the same keyword.
The only way I can think of to do this is to:
a) do a histogram of the latitudes (using RI)
b) do a histogram of the longitudes (using RI)
c) find the intersection of indices for each bin that I want
d) "flatten" the lat, lon, indices/abund cube with matrix
multiplication
It's the "c" part I'm sketched out on, my brain's can't think around
anything but a very evil Loop.
Has this really easy or been answered here before? (Array decimation
was the closest thing I found).
Thanks in advance!
|
|
|
Current Time: Wed Oct 08 13:51:25 PDT 2025
Total time taken to generate the page: 0.00543 seconds