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

Home » Public Forums » archive » Re: divide by zero problems
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: divide by zero problems [message #15358 is a reply to message #15355] Tue, 11 May 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mark Rehbein (mrehbein@aims.gov.au) writes:

> I'm having problems with floating point divide by zero's. The
> application I'm using IDL for is image composition and masking.
> Now to composite or average the images I do the following:
>
> composite=sum image/ sum mask.
>
> sometimes my images are very cloudy and as such my "sum mask" has zero's
> in it and likewise for my "sum image". So I get divide by zero's and
> NaN's in my resultant composite image. In fact I get whole image of
> NaN's in my composite even though my sum image and sum mask have decent
> values in them.

Usually, something like this works:

composite = sum_image / (sum_mask > 10E-6)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Making an array of structures containing pointers
Next Topic: coherence test implementation

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

Current Time: Sat Oct 11 06:57:30 PDT 2025

Total time taken to generate the page: 0.71901 seconds