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

Home » Public Forums » archive » Resample (neighborhood averaging) a 3D array with missing data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Resample (neighborhood averaging) a 3D array with missing data [message #86768 is a reply to message #86767] Mon, 02 December 2013 02:44 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le lundi 2 décembre 2013 11:39:19 UTC+1, alx a écrit :
> Le lundi 2 décembre 2013 11:35:47 UTC+1, alx a écrit :
>
>> Le lundi 2 décembre 2013 02:51:50 UTC+1, zhang...@gmail.com a écrit :
>
>>
>
>>> Hello, everyone:
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> I want to resample a 128x20000x32 (sample,line, band) image with missing data into a 32x5000x32 image, using neighborhood averaging over 4x4 pixels.
>
>>
>
>>>
>
>>
>
>>> The REBIN function cannot help, since it has no NaN keyword like MEAN; The "Average Arrays with Missing Data" tip in the "Examples To Illuminate the IDL Way" is for two arrays (http://www.idlcoyote.com/idl_way/smallexamples.html).
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> The total amount of images is hundreds of gigabytes. Is there any fast solution to this?
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Thanks.
>
>>
>
>>>
>
>>
>
>>> Clark
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> resampled_array = mean(mean(reform(array,4,32,4,5000,32,/OVER),DIM=1,/NAN),DIM =2,/NAN)
>
>>
>
>>
>
>>
>
>> alx.
>
>
>
> Maybe faster would be:
>
> resampled_array=mean(transpose(reform(array,4,32,4,5000,32,/ OVER),[0,2,1,3]), DIM=1,/NAN)
>
>
>
> alx.

Sorry, I forgot a more REFORM !

resampled_array=mean(reform(transpose(reform(array,4,32,4,50 00,32,/OVER),[0,2,1,3]),8,32,5000,32,/OVER),DIM=1,/NAN)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8.3???
Next Topic: Color Data with Colorbar OOB Colors

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

Current Time: Wed Oct 08 17:02:40 PDT 2025

Total time taken to generate the page: 0.00401 seconds