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

Home » Public Forums » archive » BYTES to LONG
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: BYTES to LONG [message #22412 is a reply to message #22341] Thu, 09 November 2000 00:00 Go to previous messageGo to previous message
Kelly Dean is currently offline  Kelly Dean
Messages: 92
Registered: March 1997
Member
I'll try your suggest. However, so far, floats produced by TOTAL hasn't been
a problem yet with the handful of sample files I have worked on.

Your right, there is a ENDIAN issue. Especially on the Windows 2000 machine I
am currently working on. I solved this by using IDL's OPENR keyword -
SWAP_ENDIAN.

Thanks for the tip,

Kelly

Craig Markwardt wrote:

> Kelly Dean <krdean@lamar.colostate.edu> writes:
>
>> Thanks Paul,
>>
>> Your suggestion solved my problem.
>>
>> long_x = TOTAL( ISHFT( LONG(x), [24,16,8,0] ) )
>
> Hi Kelly--
>
> While this may seem to work, I agree with JD that this is a bit
> dangerous since it converts to floating point. The expression
>
> long_x = long(x, 0, 1)
>
> should produce the same, and correct, result, without invoking any
> floating point conversions. However you may have to worry about
> so-called "endian" issues, that is byte ordering differences between
> machines. A routine in the IDL Astronomy Library like IEEE_TO_HOST
> should be able to help you there.
>
> 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
Previous Topic: Connected component analysis
Next Topic: Window Background

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

Current Time: Thu Oct 16 11:13:24 PDT 2025

Total time taken to generate the page: 0.12009 seconds