Strange behaviour ? of Subscript range values of the form low:high [message #76550] |
Wed, 15 June 2011 23:28  |
LNpellen
Messages: 37 Registered: November 2009
|
Member |
|
|
I want to paste a small matrix into a large matrix and I have done
this several times before, but suddenly I've met the wall...
The two matrises
DOSETEMP FLOAT = Array[493, 300]
DOSETEMPFULL FLOAT = Array[512, 512]
and I want to do this:
doseTempFull[xstart:xslutt,ystart:yslutt]=doseTemp
print, xstart,xslutt,ystart,yslutt
Gives me
19 511 100 399
This works ok:
doseTempFull[19:511,100:399]=1
or
doseTempFull[19:511,100:399]=doseTemp
but the real code do not work:
doseTempFull[xstart:xslutt,ystart:yslutt]=doseTemp
This gives me the typical error:
% XMANAGER: Caught unexpected error from client application. Message
follows...
% Subscript range values of the form low:high must be >= 0, < size,
with low <= high: DOSETEMPFULL.
What is going on here? Writing the values works, but the variables
with the same values don't....
Please give me the obvious explanation that I cannot see.
Best regards
Ellen
|
|
|
Re: Strange behaviour ? of Subscript range values of the form low:high [message #76612 is a reply to message #76550] |
Tue, 21 June 2011 10:53   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
LNpellen writes:
> So the "doseTempFull[x1:x2,y1:y2]=doseTemp" works in command line, but
> not in the code..... I understand nothing.
I would like to see not a PRINT of these four
variables, but a HELP. I still think these are
not scalars, but vectors.
Help, x1, x2, y1, y2
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
Re: Strange behaviour ? of Subscript range values of the form low:high [message #76625 is a reply to message #76550] |
Tue, 21 June 2011 04:22   |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
On Jun 21, 3:33 am, LNpellen <lnpel...@gmail.com> wrote:
> The story goes on - and the problem occurs again and this time even
> stranger (to me).
>
> I stop my code just before the error occurs and do some printouts:
>
> IDL> help, doseTemp
> DOSETEMP FLOAT = Array[502, 494]
> IDL> help, doseTempFull
> DOSETEMPFULL FLOAT = Array[512, 512]
> IDL> print, x1,x2,y1,y2
> 5 506 3 496
> IDL> doseTempFull[5:506,3:496]=doseTemp
> IDL> doseTempFull[x1:x2,y1:y2]=doseTemp
>
> Everything works fine to this point. The latter line above is the next
> line in the code and it appears to run with no errors so lets continue
> the code:
>
> IDL> .cont
> % XMANAGER: Caught unexpected error from client application. Message
> follows...
> % Subscript range values of the form low:high must be >= 0, < size,
> with low <= high: DOSETEMPFULL.
> % Execution halted at: GENERATEDOSEDISPLAY 106 P:\RTPlanViewer
> \RTPlanViewer\generateDoseDisplay.pro
> % RTPLANVIEWER_EVENT 291 P:\RTPlanViewer
> \RTPlanViewer\RTPlanViewer_event.pro
> % XMANAGER_EVLOOP_STANDARD 478 C:\Programfiler
> \ITT\IDL71\lib\xmanager.pro
> % XMANAGER 708 C:\Programfiler\ITT
> \IDL71\lib\xmanager.pro
> % RTPLANVIEWER 109 P:\RTPlanViewer
> \RTPlanViewer\RTPlanviewer.pro
> % $MAIN$
>
> So the "doseTempFull[x1:x2,y1:y2]=doseTemp" works in command line, but
> not in the code..... I understand nothing.
>
> Ellen
Ellen,
Try pulling this section of code out of your application and into a
stand-alone procedure. I have no idea why this would happen, but
maybe XMANAGER is to blame? If true, the bug is with XMANAGER and the
GUI side of IDL, if not, the bug is much more sinister. Just my two
cents.
-Brian
|
|
|
Re: Strange behaviour ? of Subscript range values of the form low:high [message #76705 is a reply to message #76612] |
Tue, 21 June 2011 22:36  |
LNpellen
Messages: 37 Registered: November 2009
|
Member |
|
|
Thank you for helping me finding the right focus here. I had focus on
the fact that the variables were integers, not float or string and
then I forgot to check wether it was scalars not vectors. I had been
using the WHERE function to find the y values.... And also I had the
code two similar places with this type of code and it turned out that
I kept debugging the first after this was fixed and overlooked that
the line number where the error actually occured had changed....
Arg ...
Thank you so much for pointing me back on the road!
On 21 Jun, 19:53, David Fanning <n...@dfanning.com> wrote:
> LNpellen writes:
>> So the "doseTempFull[x1:x2,y1:y2]=doseTemp" works in command line, but
>> not in the code..... I understand nothing.
>
> I would like to see not a PRINT of these four
> variables, but a HELP. I still think these are
> not scalars, but vectors.
>
> Help, x1, x2, y1, y2
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|