|
Re: rebin (corrected): msg#00077python.numeric.general
At 10:56 AM -0700 2004-08-30, Tim Hochberg wrote: [SNIP] I agree that it would be nice to avoid the extra calculation involved in convolution or boxcar averaging, and the extra temp storage. Your algorithm certainly looks promising, but I'm not sure there's any space saving when the array shape is not an exact multiple of the bin factor. Duplicating the last value is probably the most reasonable alternative for my own applications (imaging). To use your algorithm, I guess one has to increase the array first, creating a new temporary array that is the same as the original except expanded to an even mutiple of the bin factor. In theory one could avoid duplication, but I suspect to do this efficiently one really needs to use C code. I personally have no strong opinion on averaging vs summing. Summing retains precision but risks overflow. Averaging potentially has the opposite advantages, though avoiding overflow is tricky. Note that Nadav Horesh's suggested solution (convolution with a mask of 1s instead of boxcar averaging) computed the sum. -- 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> |
|---|---|---|
| Previous by Date: | Re: rebin (corrected): 00077, Tim Hochberg |
|---|---|
| Next by Date: | Re: rebin (corrected): 00077, Tim Hochberg |
| Previous by Thread: | Re: rebin (corrected)i: 00077, Tim Hochberg |
| Next by Thread: | Re: rebin (corrected): 00077, Tim Hochberg |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |