Re: Scientific Notation [message #62468 is a reply to message #5711] |
Mon, 08 September 2008 16:25  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeff writes:
> have a trouble with a very large number... Comments are welcome!!!
>
> I have the following data subset:
>
> lat, long, data
> -24.2 -56.3 234.4
> -24.1 -56.2 456.5
> -24.2 -56.2 NaN
> -24.5 -56.3 232.4
> -24.7 -52.3 NaN
> ....
> I need to fill the NaN cells with 1.70171e38. I'm doing this:
>
> index = where(finite(temp, /nan), count)
> if count ne 0 then temp[index] = 1.70141e38
>
> It works fine. Then I'm exporting it to an ascii file (using
> output_to_ascii_doit) and I got:
>
> -24.2 -56.3 234.4
> -24.1 -56.2 456.5
> -24.2 -56.2 ********************
> -24.5 -56.3 232.4
> -24.7 -52.3 *******************
> ....
>
> How can I write this right number (1.70171e38) correctly?
Pass OUTPUT_TO_ASCII_DOIT the correct output format. That
is to say, something other than the F6.1 you appear to be
using. You will need something with enough width to accommodate
this number.
Cheers,
David
P.S. I don't know OUTPUT_TO_ASCII_DOIT, but presumably
you can pass it some kind of a format, perhaps via a
FORMAT keyword.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|