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

Home » Public Forums » archive » Assoc and byteorder keywords
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
Assoc and byteorder keywords [message #36240] Thu, 28 August 2003 04:45
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
I have several large binary data sets (image cubes) that I access from
multiple platforms, using IDL. Typically, I do something like:

Openr,lun,/GET_LUN,'images.bin'
Images=assoc(lun,fltarr(nx,ny))

I might then want to do something like this:

Norm=(images[5]-images[4])/(images[3]>threshold)

Unfortunately, from some platforms, the images are not in the correct byte
order. Because byteorder is a procedure and not a function, I am forced into
locutions such as:

im5=images[5]
Byteorder,im5, /SWAP_IF_BIG_ENDIAN

im4=images[4]
Byteorder,im4, /SWAP_IF_BIG_ENDIAN

im3=images[3]
Byteorder,im3, /SWAP_IF_BIG_ENDIAN

Nomr=(im5-im4)/(im3>threshold)

This seems to be negating the syntactical efficiency of the ASSOC function.
I could wrap all of this into a function, of course, but it seems to me that
an easier way would be for ASSOC to have the capability of doing the
byte-swapping on the fly, by having the same keywords as BYTEORDER. So, for
example, I would like to see:


Images=ASSOC(lun,fltarr(nx,ny),/SWAP_IF_BIG_ENDIAN)

If RSI could just then call byteorder internally to the ASSOC function
before delivering the data to the user, it would result in much cleaner code
at my end. Does anyone see a way to do something like this already, or see
any problems with this suggestion?

Dick French
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to determine network yes or no
Next Topic: gaussfit returning errors

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

Current Time: Thu Oct 09 21:06:20 PDT 2025

Total time taken to generate the page: 0.55796 seconds