Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: Multi bands...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 5410 of 6248
Post > Topic >>

Re: Multi bands mean

by David Fanning <news@[EMAIL PROTECTED] > Feb 8, 2008 at 10:05 AM

jujo@[EMAIL PROTECTED]
 writes:

> I have a multi-bands image. I need to calculate the mean value of each
> pixel, considering all the bands. It can be easily done using:
> 
> mean_image=total(multi_bands_image, 3) / number of bands
> 
> However, I have some nan values, which have to be discarded before the
> calculation. I can do that:
> 
> mean_image=total(multi_bands_image, 3, /nan) / number of bands
> 
> However, if I do that, the nan values become zeros and the average
> includes them. How can I do to calculate the mean without considering
> nan values?

Seems to me you want this:

mean_image=total(multi_bands_image, 3, /nan) / total(finite(a),3)

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Se****e ma de ni thui. ("Perhaps thou speakest truth.")
 




 5 Posts in Topic:
Multi bands mean
jujo@[EMAIL PROTECTED]   2008-02-08 08:50:32 
Re: Multi bands mean
David Fanning <news@[E  2008-02-08 10:05:16 
Re: Multi bands mean
David Fanning <news@[E  2008-02-08 10:09:34 
Re: Multi bands mean
David Fanning <news@[E  2008-02-08 10:15:37 
Re: Multi bands mean
jujo@[EMAIL PROTECTED]   2008-02-08 09:44:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 14:16:20 CDT 2008.