On Mar 5, 2:50 pm, Spon <christoph.b...@[EMAIL PROTECTED]
> wrote:
> On Mar 5, 1:24 pm, kernin...@[EMAIL PROTECTED]
wrote:
>
> > On Mar 5, 11:29 am, Spon <christoph.b...@[EMAIL PROTECTED]
> 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


|