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

Home » Public Forums » archive » Re: Confusing Error Message
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: Confusing Error Message [message #71080] Thu, 27 May 2010 15:03
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Gray writes:

> It wasn't actually a pass by reference/value problem - it turns out I
> was (inadvertently) trying to pass the MIN keyword as an array.

Ah, OK. :-)

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: Confusing Error Message [message #71081 is a reply to message #71080] Thu, 27 May 2010 14:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Does anyone have any ideas what an error message like this might
> be hinting at?
>
> % Array subscript for TRIMVECTOR must have same size
> as source expression.

I guess it might help to see the code that causes the error.
It is the next to last line in this code, wher the arrows point:

index = Where(Finite(vector) EQ 1, count)
IF count NE 0 THEN BEGIN
trimVector = Float(vector)
>>> trimVector[index] = vectorMin > vector[index] < vectorMax
ENDIF

VectorMin and VectorMax are scalars, the result of a MIN
and MAX function call in another part of the program.

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: Confusing Error Message [message #71082 is a reply to message #71081] Thu, 27 May 2010 14:55 Go to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On May 27, 5:31 pm, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> Does anyone have any ideas what an error message like this might
> be hinting at?
>
>    % Array subscript for VECTOR must have same size
>      as source expression.
>
> Thanks,
>
> 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.")

Hey David,

It wasn't actually a pass by reference/value problem - it turns out I
was (inadvertently) trying to pass the MIN keyword as an array.
Re: Confusing Error Message [message #71083 is a reply to message #71082] Thu, 27 May 2010 14:54 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
Just from that description, I would say that you were doing something
like

vector[3:5]=indgen(4)

That is, using a subscript range on the left side, and trying to
assign to it something that does not have the same length.

But given who is asking, I suspect it is not something that trivial.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Confusing Error Message
Next Topic: PS file is huge!

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

Current Time: Thu Oct 09 07:27:56 PDT 2025

Total time taken to generate the page: 0.47810 seconds