Re: Real Number on PVWAVE [message #17890 is a reply to message #17878] |
Wed, 17 November 1999 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Daniele Monti (daniele.monti@usa.net) writes:
> Thanks a lot for your help
> I've already tried to print data as you said but if I read these
> numbers using " DC_READ_FREE" :
>
> 37374.000200
> 37374.000400
> 37374.000600
> 37374.000800
> 37374.001000
> 37374.001200
> 37374.001400
> 37374.001600
> 37374.001800
> 37374.002000
>
>
> The result I get is:
>
> WAVE> Print, x , Format='(D20.6)'
> 37374.000000
> 37374.000000
> 37374.000000
> 37374.000000
> 37374.000000
> 37374.000000
> 37374.000000
> 37374.000000
> 37374.000000
> 37374.003906
>
> Why????
Well, I suspect that DC_READ_FREE is reading the
data as Floats, rather than as Doubles. I'm not
familiar with the routine, but I'd guess it was
written in the PV-Wave language and probably of
the same quality as something like READ_IMAGE
in IDL. :-)
Is there a DOUBLE keyword that you can set?
In any case, I put your data into a text file
named "test.txt" and read it perfectly like this:
OpenR, lun, 'test.txt', /Get_Lun
data = DblArr(10)
ReadF, lun, data
Free_Lun, lun
Print, data, Format='(F20.6)'
Here is the output:
37374.000200
37374.000400
37374.000600
37374.000800
37374.001000
37374.001200
37374.001400
37374.001600
37374.001800
37374.002000
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
|
|
|