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

Home » Public Forums » archive » Scientific Notation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Scientific Notation [message #62470] Mon, 08 September 2008 16:02 Go to next message
Jeff[2] is currently offline  Jeff[2]
Messages: 18
Registered: November 2007
Junior Member
Hello,

I 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?

Thanks!
Re: Scientific Notation [message #62552 is a reply to message #62470] Mon, 15 September 2008 11:31 Go to previous message
kishore1818 is currently offline  kishore1818
Messages: 24
Registered: June 2007
Junior Member
On Sep 8, 8:02 pm, Jeff <julio.esque...@gmail.com> wrote:
> Hello,
>
> I 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?
>
> Thanks!

Hi,

Ok, but output you declared float but you are replacing exponential
format.
do this
temp[index] = 999.0 then it will workout.

Kishore
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How do I return a 2d array in a system routine?
Next Topic: IDL is giving me a syntax error out of nowhere

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

Current Time: Fri Oct 10 23:09:43 PDT 2025

Total time taken to generate the page: 1.44090 seconds