logo       

rebin: msg#00070

python.numeric.general

Subject: rebin

Any suggestions on an efficient means to bin a 2-d array? REBIN is the IDL
function I'm trying to mimic. Binning allows one to combine sets of pixels from
one array to form a new array that is smaller by a given factor along each
dimension.

To nxm bin a 2-dimensional array, one averages (or sums or ?) each nxm block of
entries from the input image to form the corresponding entry of the output
image.

For example, to 2x2 bin a two-dimensional image, one would:
average (0,0), (0,1), (1,0), (1,1) to form (0,0)
average (0,2), (0,3), (1,2), (1,3) to form (0,1)
...

In case it helps, in my immediate case I'm binning a boolean array (a mask) and
thus can live with almost any kind of combination.

-- Russell


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise