How do I prevent underflow errors? [message #14365] |
Tue, 16 February 1999 00:00 |
Phillip & Suzanne
Messages: 31 Registered: June 1998
|
Member |
|
|
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
|
|
|