Re: IDL 6.3 read_binary ?? [message #59085] |
Wed, 05 March 2008 10:13  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
Jean H wrote:
> kerninger@gmx.de wrote:
>> I checke all of your ideas but still the same problem.
>> I only compiled this procedure alone and I get the same error message.
>> thanks for your contribution so far.
>>
>> kerninger
>>
>
> so, there is one thing we haven't check: the content of "fname".... It
> should fire a runtime error, not a syntax, but let's see...
>
> especially, are the path separator the good ones for your machine? you
> said you have tried the same code under IDL5.6... is it on the same
> operating system?
>
> Jean
There's another tack we could take: it looks to me like IDL is having
trouble finding the
READ_BINARY function, though heaven knows why.
*IF* this is the case then I suspect that by adding in the line:
forward_function read_binary
before your "array=..." line will at best make the problem go away and
at worst get rid of the compilation error and replace it with a "%
Attempt to call undefined procedure/function:" message.
Then all you'll have to do is find out _why_ IDL isn't finding the
function ;-)
Are you defining a variable called read_binary somewhere?
Do you have a string that ends in:
.../rsi/idl_6.3/lib
somewhere in the output of:
print,transpose(strsplit(!path,':',/extract)) ; ?
- I'm assuming a *nix OS due to the forward slashes you reported here:
% Syntax error.
At: /home/.../clump_pp.pro, Line 276
% 1 Compilation error(s) in module GET_DATA.
This is getting interesting...
|
|
|
|
|
|
|
|
|
|
Re: IDL 6.3 read_binary ?? [message #59099 is a reply to message #59098] |
Wed, 05 March 2008 06:22   |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Mar 5, 2:13 pm, kernin...@gmx.de wrote:
> 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
Ok, back to the really simple questions!
Do you really have a line break in the middle of a line here, or is it
just the way google groups is splitting things up?
Try:
array=read_binary(fname, $
data_dims=[mx,my,mz],data_type=4,endian='little')
|
|
|
Re: IDL 6.3 read_binary ?? [message #59100 is a reply to message #59099] |
Wed, 05 March 2008 06:13   |
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
|
|
|
Re: IDL 6.3 read_binary ?? [message #59101 is a reply to message #59100] |
Wed, 05 March 2008 05:50   |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
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
|
|
|
|
Re: IDL 6.3 read_binary ?? [message #59104 is a reply to message #59102] |
Wed, 05 March 2008 02:29   |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Mar 5, 10:22 am, kernin...@gmx.de wrote:
> Hello,
>
> I have a problem with the read_binary function in IDL version 6.3.
> When I call the following line it gives me a syntax error during
> compilation.
>
> array=read_binary(fname,
> data_dims=[mx,my,mz],data_type=4,endian='little)
>
> When I do the same in IDL version 5.6 there it works.
> Does anybody know a solution?
>
> Best regards,
>
> kerninger
Try closing your string:
...endian='little')
|
|
|
Re: IDL 6.3 read_binary ?? [message #59214 is a reply to message #59085] |
Thu, 06 March 2008 10:33  |
kerninger
Messages: 6 Registered: March 2008
|
Junior Member |
|
|
I just want to say that the problem is really due to the system I try
to use this code. An other system of the same Computing Center is able
to compile and run the code.
So, thank you very much for your contribution.
Now we can close this discussion ;)
kerninger
|
|
|