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

Home » Public Forums » archive » Re: Calculating a mean band
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: Calculating a mean band [message #54825] Wed, 11 July 2007 08:48 Go to previous message
Conor is currently offline  Conor
Messages: 138
Registered: February 2007
Senior Member
On Jul 11, 11:32 am, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> Julio wrote:
>> Hi there!
>
>> Very simple question... I have a multi-band image (36 bands) and I
>> need to calcultate the average of the bands, pixel by pixel.
>
>> If I do that:
>
>> average_array=mean(multi_band)
>
>> I get a single value, because it doesn't work pixel by pixel. So, how
>> can I do to make a mean band of all the 36 bands??
>
>> Comments welcome.
>
>> Best!
>> Julio
>
> Hi,
>
> You can easily make the sum of you band along a dimension... so
> average_array = total(multi_band, 3) / nbOfBands
>
> Jean


You could also do it this way, assuming image=fltarr(x,y,36)

mean_image = rebin(x,y,1)

I'm not sure which way is faster
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: text positioning within multiple plots
Next Topic: Re: Griddata and Contour questions

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

Current Time: Wed Oct 08 15:33:14 PDT 2025

Total time taken to generate the page: 0.00441 seconds