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

Home » Public Forums » archive » Re: Unknown data type
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: Unknown data type [message #42102] Sat, 01 January 2005 02:25 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:

> Julio writes:
>
>> The files I want to read haven't any typical format. Each file has
>> information in the first line (like number of rows and columns), but
>> anything about data typeᅵ
>>
>> So, I followed the tips of David. I carried out a "trial read" usingᅵ
>>
>> Data_type=integer ; I assume all the files are integer
>> ON_IOERROR, bad
>> OPENR,lun, arq, /GET_lun
>> test = make_array(nc, nl,/integer)
>> READU, lun, test ; reading the file into an integer array
>> GOTO, Ok
>> bad: data_type=byte ; if the file coudn't be read into an integer
>> array
>> Ok: FREE_LUN, lun
>>
>> As I told you first, I have only two possible data types: byte and
>> integer. So, using it, I could solve the problem.
>
> Oh, golly, if you know how *much* data is suppose to
> be in the file even I could tell you whether your file
> contains bytes or integers, all the way from Colorado!
>
> And I wouldn't have to read the file to know. Just
> compare the product of rows and columns to the size
> of the file (obtained with FSTAT). If there is little
> or no difference, you have bytes. If there is a big
> difference, you have integers. :-)
>
> Cheers,
>
> David

Happy new year

I thought I have told Julio this too some days ago. I did the mistake to
explain it for float and long determinations.
By the way do you have on your great site an explanaition a table or
something else which shows the range, precision of each datatype and the
the byte size in memory. It hink this would help here too.

cheers
Reimar


--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
[Message index]
 
Read Message
Read Message
Previous Topic: Re: passing objects between GUI callbacks
Next Topic: Re: creating a variable from unknow name

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

Current Time: Sat Oct 11 07:40:26 PDT 2025

Total time taken to generate the page: 0.79870 seconds