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

Home » Public Forums » archive » Re: XSTRETCH and Library Lessons
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: XSTRETCH and Library Lessons [message #48470 is a reply to message #48469] Sat, 22 April 2006 09:05 Go to previous messageGo to previous message
news.verizon.net is currently offline  news.verizon.net
Messages: 47
Registered: August 2003
Member
Coincidentally, I've been wrestling with a library name conflict but in
this case it is a conflict with myself.

The IDL Astronomy Library ( http://idlastro.gsfc.nasa.gov/ ) includes
several procedures for FITS I/O, where FITS is the big-endian data
format widely used in astronomy. The procedures currently check
whether the user is on a little-endian machine, and if so, will perform
the necessary byteswapping when reading or writing to a FITS file.
However, by using the /SWAP_IF_LITTLE_ENDIAN keyword to OPENR(W) this
can all be done transparently, and this "on the fly" byteswapping can
improve the speed by a factor of two for large arrays on my Linux box.

However, for several of the FITS I/O routines there is a separate
procedure for opening the FITS file (e.g. fits_open.pro, fxposit.pro)
and another for reading/writing (e.g. fits_read.pro, mrdfits.pro) and
so both procedures need to be updated. Essentialy the byteswapping
has moved from the I/O routine to the Open routine. So if the user
downloads the new fits_open.pro but still has an old version of
fits_read.pro layng around, then byteswapping will occur twice. Of if
the user downloads the new mrdfits.pro but still has an old copy of
fxposit.pro laying around, then no byteswapping will occur.

I had hoped that FSTAT() might return information about whether unit
has been opened with endian swapping but this doesn't seem to be the
case. I was also tempted to add a new keyword to the "Open"
procedures on the theory that the error message

"Keyword SWAP_ENDIAN not allowed in call to: FITS_OPEN"

gives a better clue to the origin of the problem, than just finding
that the FITS I/O routines are returning wrong endian garbarge with no
error message. In the end, I decided that the best solution was
to give multiple warnings in the documentation and elsewhere (thus
this message), though I'd be interested if anyone has other
suggestions. --Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: ION script drop-down
Next Topic: New Image Processing Routines

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

Current Time: Sat Oct 11 09:02:12 PDT 2025

Total time taken to generate the page: 0.96007 seconds