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

Home » Public Forums » archive » Re: How do I prevent underflow errors?
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: How do I prevent underflow errors? [message #14361 is a reply to message #14351] Wed, 17 February 1999 00:00 Go to previous messageGo to previous message
Michael Viskum is currently offline  Michael Viskum
Messages: 2
Registered: February 1999
Junior Member
Craig Markwardt wrote:

> Phillip & Suzanne David <pdavid@earthling.net> writes:
>>
>> I have a large array of data that I'd like to plot with the contour routine.
>> However, the dynamic range of the data is very large, with values as large as
>> 1e36 and as small as 1e-40. I noticed that contour accepts float data, not
>> double data. This data is outside the range of float data, so it needs to be
>> scaled for the contour routine. I don't really care to differentiate the
>> 1e-40 from 0, but would like to be able to handle values up to the 1e36. I
>> was going to scale the data by the largest value (i.e.,
>> PlotData=Float(Data/Max(Abs(Data)))). This puts the data in the range of -1.0
>> to 1.0. This should be fine for Contour, but I get an underflow error when
>> converting from double data to float data. I understand that the data will
>> come out with a 0 instead of 1e-76, and don't really care. How do I get IDL
>> to ignore the underflow and just convert the value?
>>
>> Phillip
>>
>
> Greetings,
>
> Try the following with check_math(), which is documented in IDL.
>
> dummy = check_math(1, 1)
> .... commands with math errors are placed here ...
> dummy = check_math(0, 0)
>
> Most of your messages will go away (except for maybe the last one).
>
> Craig
>
> --
> ------------------------------------------------------------ --------------
> Craig B. Markwardt, Ph.D. EMAIL: craigmnet@astrog.physics.wisc.edu
> Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
> ------------------------------------------------------------ --------------

Hi,

Try also to have a look at the !EXCEPT system variable. It can have 3 possible
values.
If !EXCEPT=0 then IDL will not report any exceptions.

cheers

Michael


--
____________________________________________________________ ____________

Michael Viskum, Ph.D.
UNI�C, Scientific Computing
Olof Palmes Alle 38
DK-8200 Aarhus N, Denmark

Phone (+45) 8937 6614 - Fax (+45) 8937 6677
Michael.Viskum@uni-c.dk
http://www.uni-c.dk
____________________________________________________________ _____________
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Byte to Real conversion
Next Topic: IDL and Image Segmentation

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

Current Time: Fri Oct 10 01:31:21 PDT 2025

Total time taken to generate the page: 7.27795 seconds