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

Home » Public Forums » archive » Importing Binary Images
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: Importing Binary Images [message #28967 is a reply to message #28873] Fri, 18 January 2002 10:53 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
rschick@neaq.org (rob schick) writes:

> I'm new to idl, and am trying to import a binary grid that was created
> on a windows machine into idl on a linux machine. It's least
> significant byte first, 1561 rows, 2041 cols.
>
> I searched the archives and found a thread that suggested used the
> following syntax:
>
> IDL> openr, 1, 'gom15dd.dat'
> IDL> ms = bytarr(1561, 2041)
> IDL> readu, 1, ms
> IDL> tv, ms

Question: If the data is formatted "least significant byte first,"
usually that means there is more than one byte per grid cell. That
implies that using a BYTARR is too small. So presumably you want to
use INTARR(1561,2041) instead? That is not clear from your note.

Second, in general, the byte ordering of the data may have to be dealt
with. This is usually easiest accomplished with one of the ENDIAN
keywords to the OPENR procedure. If you are on an Wintel machine,
then the processor is already little-endian, and so is your data
(according to you), so this should not be an issue.


> While this 'works', the image displayed is incorrect - sort of looks
> like speckled white noise. Any thoughts on what I may be doing wrong.
> For a newbie, what's the difference between using readu, and
> read_binary? The online help didn't help. Thanks.

For reading a bulk data array, READU is appropriate. READ_BINARY is
most useful when reading structures of data.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: In case someone has trouble including export.h
Next Topic: Question again :)

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

Current Time: Thu Oct 09 21:59:45 PDT 2025

Total time taken to generate the page: 1.44468 seconds