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

Home » Public Forums » archive » Re: IDL 6.3 read_binary ??
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: IDL 6.3 read_binary ?? [message #59100 is a reply to message #59099] Wed, 05 March 2008 06:13 Go to previous messageGo to previous message
kerninger is currently offline  kerninger
Messages: 6
Registered: March 2008
Junior Member
On Mar 5, 2:50 pm, Spon <christoph.b...@gmail.com> wrote:
> On Mar 5, 1:24 pm, kernin...@gmx.de wrote:
>
>> On Mar 5, 11:29 am, Spon <christoph.b...@gmail.com> wrote:
>
>>> Try closing your string:
>>> ...endian='little')
>
>> The string is closed in the code. It was a typo only here in this
>> posting. Sorry for that.
>> But thank you for this remark;)
>
> Hi,
>
> sorry, I guess my comment came across as a lot less friendly than I'd
> intended. Hadn't had my coffee yet... sorry :-)
>
> Anyway, your code, as it stands, works fine for me (v7.0) so long as:
> 1) fname is a string variable that points to a file that actually
> exists (and I have read access to, I guess),
> 2) mx & my & mz are defined scalars,
> 3) mx * my * mz * bytes-per-pixel (as defined by data_type) isn't >
> the file length,
> and
> 4) I have a version of IDL that has swap_endian_inplace somewhere in
> its library (I think you'd have to have a fairly old version for this
> not to be the case, certainly I wouldn't expect any problems with v6.3
> unless your !PATH is completely messed up for some reason.)
>
> What error message are you getting? As you've changed versions I would
> suspect that your FNAME variable may be defined as a relative path to
> your old IDL directory or something. What happens if you define fname
> using dialog_pickfile first? I'm stabbing in the dark here without
> knowing what the error thrown is, though.
>
> Regards,
> Chris


Hi Chris,

it didn't seem unfriendly to me.
Here is the error message:
-----------------------------------


array=read_binary(fname,
data_dims=[mx,my,mz],data_type=4,endian='little')
^
% Syntax error.
At: /home/.../clump_pp.pro, Line 276
% 1 Compilation error(s) in module GET_DATA.
----------------------------------------


get_data looks like this in the same file:

---------------------------------------------
pro get_data, fname, array
common shared_variables
array=fltarr(mx,my,mz)
array=read_binary(fname,
data_dims=[mx,my,mz],data_type=4,endian='little')

end
-------------------------------------------


mx,my,mz are shared variables in the common block.
Regards,

kerninger
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Handling large arrays in IDL
Next Topic: Re: Histogram and bin sizes

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

Current Time: Sat Nov 29 21:50:51 PST 2025

Total time taken to generate the page: 0.39979 seconds