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

Home » Public Forums » archive » Re: From a novice in IDL
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: From a novice in IDL [message #31843] Wed, 21 August 2002 19:44
pjbaruah is currently offline  pjbaruah
Messages: 2
Registered: August 2002
Junior Member
Robert Stockwell <rgs1967@hotmail.com> wrote in message news:<3D639567.4090104@hotmail.com>...
> change
> "for i=1,356 do begin"
> to
> "for i=1L,356 do begin"
>
> i.e. change your variable "i" to a long.
>
> Cheers,
> bob

Dear Bob,

Thanx so much for your kind and prompt reply to my message.. The
program now works... Thanx a lot !!!

PJ
Re: From a novice in IDL [message #31857 is a reply to message #31843] Wed, 21 August 2002 06:28 Go to previous message
Robert Stockwell is currently offline  Robert Stockwell
Messages: 74
Registered: October 2001
Member
Pranab J. Baruah wrote:
> Hi,
>
> I am new to IDl and new to to this great group. Would be obliged if
> anybody can help me with my programming problem.
>
> My program tries to do some simple data manipulation. There are say 3
> binary data files [FILE1, FILE2, FILE3] and I have to put them into
> one big file where, the big file[FILE_NEW] contains 3 columns[for
> three binary files] and the rows of these files come under the columns
> of FILE_NEW [after transposed].
>
> Now, when I try to run the program, as shown below, it get stuck with
> the listed errors below when i=46, i.e. when (i*720-1)=33119 in FILE1
> of first line within the loop. ### The program worked and gave
> expected results when the data dimension was less, say for binary
> files of [115][100] ###
>
> Just can't guess why it is so. Please help !!
> -----------------The Program :start------------------
> pro data_stacker_big1
>
> FILE1 = read_binary('feb_2001_geo5.bsq', DATA_DIMS=[720,356])
> FILE2 = read_binary('mar_2001_geo5.bsq', DATA_DIMS=[720,356])
> FILE3 = read_binary('apr_2001_geo5.bsq', DATA_DIMS=[720,356])
>
> ;Below 256320 = 720*356
> FILE_NEW=bytarr(3,256320)
>
> for i=1,356 do begin
>
> FILE_NEW[0,((i-1)*720):(i*720-1)]=FILE1[((i-1)*720):(i*720-1 )]
> FILE_NEW[1,((i-1)*720):(i*720-1)]=FILE2[((i-1)*720):(i*720-1 )]
> FILE_NEW[2,((i-1)*720):(i*720-1)]=FILE3[((i-1)*720):(i*720-1 )]
>
> endfor
>
> openw, lun, 'output.dat', /get_lun
> printf, lun, FILE_NEW
> free_lun, lun
>
> end
> -----------------The Program :end------------------
>
> -----------------Error Message while running :start------------------
> IDL> data_stacker_big1
> % Subscript range values of the form low:high must be >= 0, < size,
> with low <= high: FILE1.
> % Execution halted at: DATA_STACKER_BIG1 12 D:\IDL
> programs\data_stacker_big1.pro
> -----------------Error Message while running :end------------------
>
> Thanking you in advance,
>
> Pranab J. Baruah
> U.Tokyo

IDL> i = 46 & print,((i-1)*720),(i*720-1)
32400 -32417



change
"for i=1,356 do begin"
to
"for i=1L,356 do begin"

i.e. change your variable "i" to a long.

Cheers,
bob
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Re : Color Fonts?!?!?
Next Topic: Re: Animated GIF in IDL

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

Current Time: Wed Oct 08 16:52:20 PDT 2025

Total time taken to generate the page: 0.00654 seconds