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

Home » Public Forums » archive » Re: Real Number on PVWAVE
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: Real Number on PVWAVE [message #17890 is a reply to message #17878] Wed, 17 November 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Windows PostScript Preview Image
Next Topic: Re: At Last! A Subsititute for CW_Field.

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

Current Time: Fri Oct 10 15:50:22 PDT 2025

Total time taken to generate the page: 0.55546 seconds