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

Home » Public Forums » archive » Re: IDL 6.2 Array Definition Question (Program code area full)
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.2 Array Definition Question (Program code area full) [message #48403] Wed, 19 April 2006 12:10 Go to next message
mshep is currently offline  mshep
Messages: 4
Registered: April 2006
Junior Member
Hi Bob,

Thanks for the quick response and sugguestions.

For my current application it is probably the best to just write out
the arrays into a file and then read them in. However, I just wanted to
let you know that your suggestion of using the existing perl script to
write a main level IDL code with the defined arrays is also a very good
approach that I had not thought of previously.

Thanks again,
Mark
Re: IDL 6.2 Array Definition Question (Program code area full) [message #48405 is a reply to message #48403] Wed, 19 April 2006 11:28 Go to previous messageGo to next message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
"mshep" <mshep@aer.com> wrote in message
news:1145469488.757805.179980@i40g2000cwc.googlegroups.com.. .
>
> Hi Ken,
>
> Thanks for the reply.
>
> As I mentioned in a response to Reimar, the main question is why does
> IDL place a limit on the amount of array elements being passed
> explicitly?

Everything limits their input buffer, or else a user could crash the
computer
if they "accidently" gave too large of an input. It is a famous bug from
the old
days. There are just better ways to handle the situation. It is like you
are
trying to put your luggage into your glove box instead of the trunk. :)

> I could just write out the arrays in perl to a file and then read the
> file in using IDL

sounds good.
Or use your existing perl script to create a main level IDL code where
you define your arrays:

Pro call_full_test

a_arr =
[0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]
b_arr =
[0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]
c_arr =
[0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]
d_arr =
[0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]
e_arr =
[0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]
f_arr =
[0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]
g_arr =
[0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]

full_test, a_arr, b_arr, c_arr, d_arr, e_arr, f_arr , g_arr

end



Then have your script call "call_full_test"
$idl_prog_full_test = "call_full_test";
$idl_run = ".r $idl_prog_call_full_test";
$exit = "exit";
$idl_command_try_2 = "$idl_prog_call_ full_test";



Cheers,
bob
Re: IDL 6.2 Array Definition Question (Program code area full) [message #48406 is a reply to message #48405] Wed, 19 April 2006 10:58 Go to previous messageGo to next message
mshep is currently offline  mshep
Messages: 4
Registered: April 2006
Junior Member
Hi Ken,

Thanks for the reply.

As I mentioned in a response to Reimar, the main question is why does
IDL place a limit on the amount of array elements being passed
explicitly?

As for the reason why I would like to do it, please refer to the perl
example I provided in my response to Reimar.

I could just write out the arrays in perl to a file and then read the
file in using IDL, but I would like to know why I cannot just pass them
using explicit arrays.

Thanks,
Mark
Re: IDL 6.2 Array Definition Question (Program code area full) [message #48407 is a reply to message #48406] Wed, 19 April 2006 10:49 Go to previous messageGo to next message
mshep is currently offline  mshep
Messages: 4
Registered: April 2006
Junior Member
Hi Reimar,

The main question is why does IDL place a limit on the amount of array
elements being passed explicitly?

help, !version, /str

IDL> help, !version, /str
** Structure !VERSION, 8 tags, length=104, data length=100:
ARCH STRING 'x86_64'
OS STRING 'linux'
OS_FAMILY STRING 'unix'
OS_NAME STRING 'linux'
RELEASE STRING '6.2'
BUILD_DATE STRING 'Jun 20 2005'
MEMORY_BITS INT 64
FILE_OFFSET_BITS
INT 64
IDL>

As for the reason why I am passing this many elements explicitly is
that the arrays are being generated in a perl script and then passed to
an IDL program.

Below is a simple example where I am explictly passing arrays from perl
to IDL, but I run into a limitation on the amount of elements that I
can pass explicitly:

#!/usr/bin/perl -w

@a_arr =
(0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9);
@b_arr =
(0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9);
@c_arr =
(0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9);
@d_arr =
(0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9);
@e_arr =
(0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9);
@f_arr =
(0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9);
@g_arr =
(0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9);

$str_a = "@a_arr"; # put array into a string with blanks
between elements
$str_a =~ s/ /','/g; # substitute
$str_a = "['".$str_a."']"; # Add IDL brackets and end quotes
$str_b = "@b_arr"; # put array into a string with blanks
between elements
$str_b =~ s/ /','/g; # substitute
$str_b = "['".$str_b."']"; # Add IDL brackets and end quotes
$str_c = "@c_arr"; # put array into a string with blanks
between elements
$str_c =~ s/ /','/g; # substitute
$str_c = "['".$str_c."']"; # Add IDL brackets and end quotes
$str_d = "@d_arr"; # put array into a string with blanks
between elements
$str_d =~ s/ /','/g; # substitute
$str_d = "['".$str_d."']"; # Add IDL brackets and end quotes
$str_e = "@e_arr"; # put array into a string with blanks
between elements
$str_e =~ s/ /','/g; # substitute
$str_e = "['".$str_e."']"; # Add IDL brackets and end quotes
$str_f = "@f_arr"; # put array into a string with blanks
between elements
$str_f =~ s/ /','/g; # substitute
$str_f = "['".$str_f."']"; # Add IDL brackets and end quotes
$str_g = "@g_arr"; # put array into a string with blanks
between elements
$str_g =~ s/ /','/g; # substitute
$str_g = "['".$str_g."']"; # Add IDL brackets and end quotes

# Use a here document to run IDL from linux/unix command line

$idl_prog_full_test = "full_test";
$idl_run = ".r $idl_prog_full_test";
$exit = "exit";
$idl_command_try_2 = "$idl_prog_full_test, $str_a, $str_b, $str_c,
$str_d, $str_e, $str_f, $str_g";
system("idl
<<IDL_INPUT\n$idl_run\n$idl_command_try_2\n$exit\nIDL_INPUT\n ");

exit;
Re: IDL 6.2 Array Definition Question (Program code area full) [message #48408 is a reply to message #48407] Wed, 19 April 2006 09:16 Go to previous messageGo to next message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
On Wed, 19 Apr 2006, mshep wrote:
> I am generating arrays in a perl script and passing them into IDL
> so simply setting:
>
> a_arr = [0,1,2,...,9,0,1,2,3,4,5,6,7,8,9]
> and
> full_test, a_arr, ....
>
> is not an option for me.

I'm not clear why this is not an option. Why exactly does perl or
external array generation place this limitation on you?

-k.
Re: IDL 6.2 Array Definition Question (Program code area full) [message #48409 is a reply to message #48408] Wed, 19 April 2006 09:04 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Hi mark

please tell a bit more

help, !version,/str

and please explain a bit more why you are using perl for doing this.


Reimar

mshep wrote:
> Hi,
>
> I did a quick search on the news group but did not find anything
> recent.
>
> I thought the "Program code area full" when explicitly defining arrays
> was resolved back in IDL 5.3, but I ran into it again.
>
> Here is a simple example to demonstrate my issue:
>
> IDL> .r full_test.pro
> % Compiled module: FULL_TEST.
> IDL>
> IDL> full_test,
> [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9],
> $
> IDL>
> [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9],
> $
> IDL>
> [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9],
> $
> IDL>
> [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9],
> $
> IDL>
> [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9],
> $
>
>
> [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9],
> $
>
>
> ^
> % Program code area full.
> IDL>
>
> ----------------
>
> PRO full_test, a_arr, b_arr, c_arr, d_arr, e_arr, f_arr , g_arr
>
> END
>
> ----------------
>
> I am generating arrays in a perl script and passing them into IDL so
> simply setting:
>
> a_arr =
> [0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9]
>
> and
>
> full_test, a_arr, ....
>
> is not an option for me.
>
> Any insights would be greatly appreciated.
>
> Thanks,
> mark
>




--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
Re: IDL 6.2 Array Definition Question (Program code area full) [message #48485 is a reply to message #48403] Thu, 20 April 2006 14:12 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 19 Apr 2006 12:10:16 -0700, mshep wrote:

>
> Hi Bob,
>
> Thanks for the quick response and sugguestions.
>
> For my current application it is probably the best to just write out
> the arrays into a file and then read them in. However, I just wanted to
> let you know that your suggestion of using the existing perl script to
> write a main level IDL code with the defined arrays is also a very good
> approach that I had not thought of previously.

A little known fact: if you set !EDIT_INPUT=0, the input buffer becomes
unlimited (well, memory limited). This also turns off background widget
event processing, so I wouldn't recommend it for general use.

JD
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 3-d plot surface to 2-d plot
Next Topic: interpolation question

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

Current Time: Thu Oct 09 12:02:17 PDT 2025

Total time taken to generate the page: 0.48037 seconds