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

Home » Public Forums » archive » hist_nd for creative grid resampling on big arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
hist_nd for creative grid resampling on big arrays [message #48670] Tue, 09 May 2006 13:19
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
Hey IDL Geniuses!

It starts with one of these:

> help, MyBigGrid
> MYBIGGRID BYT [43200,21600]

That's 30-second data over the whole globe. For my application, I'd
like to have a 1-degree grid where each point is the histogram of
values within that area. With unlimited memory, I could do something
like this:

> Xs1 = (lindgen(43200)/120.)-180+(1/120.); longitudes of columns
> Ys1 = (lindgen(21600)/120.)-90+(1/120.); latitude of rows
> Xs2 = rebin(Xs1,43200,21600); longitude of cells
> Ys2 = rebin(transpose(Ys1),43200,21600); latitude of cells
> EndProduct = hist_nd([[[Xs2]],[[Ys2]],[[MyBigGrid]]],[1.,1.,1],min=[-180. ,-90.,0],max=[179.999,89.999,255])

Due to the size of the arrays, I don't have enough memory to quite pull
this off. But maybe there is some way to trick the histogram routine
into parcelling MyBigGrid according to Xs1|Ys1 without having to put
Xs2|Ys2 into memory. What do you think?

The workaround looks like this:

> EndProduct = lonarr(360,180,256)
> for ix=0,359 do for iy=0,179 do EndProduct[ix,iy,*] = $
> histogram((MyBigGrid[((ix*120):((ix*120)+119)),*])[*,((iy*12 0):((iy*120)
> +119))],min=0,max=100,bin=1)

My workaround has been running for a few minutes now. It probably
worked, but I'd like something more elegant (and faster) as this
problem comes up all the time.

Any histogram masters out there, a faster solution to this general
class of problem would be a big help.
[Message index]
 
Read Message
Previous Topic: How to rotate a figure in PLOT?
Next Topic: scatter_surface

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

Current Time: Sat Oct 11 15:09:11 PDT 2025

Total time taken to generate the page: 1.19525 seconds