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

Home » Public Forums » archive » Re: Help: Byte-swapping program
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: Help: Byte-swapping program [message #3326 is a reply to message #3324] Mon, 12 December 1994 12:16 Go to previous messageGo to previous message
grunes is currently offline  grunes
Messages: 68
Registered: September 1993
Member
> Yes, but neither of those seem to be sufficient. In my case (and I
> believe in the case of the original poster), we've got VAX floating
> point numbers to be read into IEEE format on a machine who's local
> format *is* IEEE. Unless I'm missing something in my reading of the
> manual, that's not covered by IDL's conversion functions.
> I've got some code lying around somewhere that I wrote to go from
> VAX to IEEE floating point (single-precision), which I'll dig up if
> I don't see any other solution go by before I get back from my travels.

The Fortran code for routine FromVaxR4 that I posted in my original
response would do the that part of the job. Since the person was
working on a Sun--in Sun Fortran, if you do
open(1,file=name,access='direct',recl=1,form='unformatted')
and you want to look at the real*4 number at byte # n (where the first
byte is #1), you would say
read(1,rec=n)i
and say
x=FromVaxR4(i)
to convert it to local floating point. Similar open and write
statements could output to a local format file. Most other Fortrans
have some form of open to do a similar job.

However, I imagine most readers of this newsgroup prefer to use IDL
or PV-Wave. Perhaps someone with time on their hands would like
to translate my code to IDL/Wave?
(opinions expressed are mine alone)
Mitchell R Grunes (grunes@nrlvax.nrl.navy.mil)
Allied-Signal Technical Services
c/o Code 8140 Naval Research Lab
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Array variable in extended memory - IDL
Next Topic: Contour labels screwed up when using MAXVALUE

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

Current Time: Fri Oct 10 19:22:18 PDT 2025

Total time taken to generate the page: 0.88084 seconds