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

Home » Public Forums » archive » Re: Calculate the mean of many images
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: Calculate the mean of many images [message #63647 is a reply to message #63646] Sun, 16 November 2008 11:08 Go to previous messageGo to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
> What does finite(img) EQ 1 mean here? Can I write this statement as
> the following?

finitie(img) eq 1 will evaluate to the same thing as finite(img) - the
finite function returns a 1 or a zero depending on whether the input
is finite.

> mask = (qa EQ 1.000 and qa EQ 0.000 ) AND (finite(img) EQ 1.000 &&
> 0.000)

this statement is mutually exclusive (qa can't equal 1 and zero at the
same time). The finite part is equally problematic. I'm not sure what
you want mask to be. But anyways, once you know how to properly phrase
the logical test for your mask, I would do the following:

;- calculate the average
mask = .... logical test on QA which is TRUE for a pixel which you
want to consider ...
average_image = total(im * mask, 3) / total(mask, 3)

;- check for and pixels where there were no good images
bad = where(total(mask,3) eq 0, ct)
if ct eq 0 then average_image[bad] = !values.f_nan

maybe a good mask would look like
mask = finite(qa) if anything finite is good or,
if you want to pull out specific qa values,
mask = ((qa eq 1) or (qa eq 2))

chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL and sqlite
Next Topic: A Simple IDL Manifesto

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

Current Time: Fri Oct 10 07:32:03 PDT 2025

Total time taken to generate the page: 3.12091 seconds