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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL 6.3 read_binary ?? [message #59085] Wed, 05 March 2008 10:13 Go to next message
Spon is currently offline  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 #59086 is a reply to message #59085] Wed, 05 March 2008 09:30 Go to previous messageGo to next message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
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
Re: IDL 6.3 read_binary ?? [message #59088 is a reply to message #59086] Wed, 05 March 2008 09:40 Go to previous messageGo to next message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Mar 5, 11:00 am, kernin...@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

I'm running 6.3 on solaris and it compiles fine for me. The only
thing that I can think of for a compile error would be some weird
character in the text, like an international character? Have you
tried re-typing the line?
Re: IDL 6.3 read_binary ?? [message #59089 is a reply to message #59086] Wed, 05 March 2008 09:00 Go to previous messageGo to next message
kerninger is currently offline  kerninger
Messages: 6
Registered: March 2008
Junior Member
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
Re: IDL 6.3 read_binary ?? [message #59090 is a reply to message #59089] Wed, 05 March 2008 07:47 Go to previous messageGo to next message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
Spon wrote:
> The error may be in the procedure immediately above your get_data
> procedure, like a missing endif/endfor or something.

I once had that problem: an extra dot (.) at the end of a
variable name caused a totally incomprehensible syntax error
in the same procedure, many lines later. It did take quite
some detective work to figure that one out.


chl
Re: IDL 6.3 read_binary ?? [message #59092 is a reply to message #59090] Wed, 05 March 2008 07:05 Go to previous messageGo to next message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Mar 5, 2:37 pm, kernin...@gmx.de wrote:
> Now, I think this problem doesn't come from the different IDL versions
> but from
> the systems I am using the code. The newer version 6.3 is running on a
> system, where
> (I think) it isn't allowed to read in large data sets, but I'm not
> sure. I will know this in a few days.

I still don't think you should be getting compilation errors though.
The error may be in the procedure immediately above your get_data
procedure, like a missing endif/endfor or something. What line is 276
in your file? If it's the first line of get_data then I'm betting the
problem is actually in the previous procedure. I can compile your code
snippet without problems on my machine and can't see any reason why
yours shouldn't do the same.

Anyway, good luck!
Chris
Re: IDL 6.3 read_binary ?? [message #59095 is a reply to message #59092] Wed, 05 March 2008 06:53 Go to previous messageGo to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
kernin...@gmx.de wrote:
>>
>> 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?
>
> This is the way google groups shows the code. There is no linebreak.
> Now, I think this problem doesn't come from the different IDL versions
> but from
> the systems I am using the code. The newer version 6.3 is running on a
> system, where
> (I think) it isn't allowed to read in large data sets, but I'm not
> sure.
That should not have any effect on the "compilation" of routines,
but generate some kind of runtime error.
( You may try compiling only the offending line on your system instead
of the whole program).

Ciao,
Paolo

I will know this in a few days.
> Thank you for help!
>
> Regards,
>
> kerninger
Re: IDL 6.3 read_binary ?? [message #59098 is a reply to message #59095] Wed, 05 March 2008 06:37 Go to previous messageGo to next message
kerninger is currently offline  kerninger
Messages: 6
Registered: March 2008
Junior Member
>
> 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?

This is the way google groups shows the code. There is no linebreak.
Now, I think this problem doesn't come from the different IDL versions
but from
the systems I am using the code. The newer version 6.3 is running on a
system, where
(I think) it isn't allowed to read in large data sets, but I'm not
sure. I will know this in a few days.
Thank you for help!

Regards,

kerninger
Re: IDL 6.3 read_binary ?? [message #59099 is a reply to message #59098] Wed, 05 March 2008 06:22 Go to previous messageGo to next message
Spon is currently offline  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 Go to previous messageGo to next 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
Re: IDL 6.3 read_binary ?? [message #59101 is a reply to message #59100] Wed, 05 March 2008 05:50 Go to previous messageGo to next message
Spon is currently offline  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 #59102 is a reply to message #59101] Wed, 05 March 2008 05:24 Go to previous messageGo to next message
kerninger is currently offline  kerninger
Messages: 6
Registered: March 2008
Junior Member
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;)
Re: IDL 6.3 read_binary ?? [message #59104 is a reply to message #59102] Wed, 05 March 2008 02:29 Go to previous messageGo to next message
Spon is currently offline  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 Go to previous message
kerninger is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 16:04:07 PDT 2025

Total time taken to generate the page: 0.00876 seconds