Mirko Vukovic wrote:
>
> so, this is the story,
>
> I have a call to contour burried deep in some subroutine. And sometimes
> I would like to do a
> contour,foo,path_xy=path_xy
> i.e., get the coordinates of the contours. Using _extra does not seem
> to work. If in the top routine I specify
> path_xy=var
> where var is undefined, I get an error message,
> If I define var to be an array, or something like that IDL complains
> that the expression must be a named variable.
>
> Any ideas?
>
> tia,
>
The problem must be buried somewhere in your subroutine as you say. Here
is how IDL's contour behaves depending on the parameters you give it and
whether you pass a "named variable" :
a=fltarr(10,10)
x=findgen(10)*!PI/18.
for i=0,9 do a(*,i) = 2*sin(!PI/(i+1)-x)
; #1 : (see manual) works !
print,' #1 : ------------------------------------ '
contour,a,color=1,/follow,path_info=info1,path_xy=path1
help,info1,path1,/stru
; #2 : (no path) works !
print,' #2 : ------------------------------------ '
contour,a,color=1,/follow,path_info=info2
help,info2,/stru
; #3 : (no info) works !
print,' #3 : ------------------------------------ '
contour,a,color=1,/follow,path_xy=path3
help,path3,/stru
; #4 : (no variable parameter) ERROR !
print,' #4 : ------------------------------------ '
contour,a,color=1,/follow,path_xy=1
; #5 : (no variable parameter) ERROR !
print,' #5 : ------------------------------------ '
contour,a,color=1,/follow,path_info=1
end
This program will actually stop at step 4 with the error message you
quoted.
You don't need to define infoN or pathN beforehand, but you cannot pass
a value (as in steps 4 and 5). This is also what _EXTRA does, since
there is no way that _EXTRA can know what you want to extract from it
later it only passes by value and can therefore not work.
Good luck,
Martin
------------------------------------------------------------ ------------Dr.
Martin Schultz e-mail: mgs@io.harvard.edu
Center for Earth&Planet. Sci.
Harvard University
Pierce Hall phone: (617)-496-8318
29 Oxford St fax : (617)-495-5192
Cambridge, MA-02138
------------------------------------------------------------ ------------
check out http://www-as.harvard.edu/people/staff/mgs/idl !
------------------------------------------------------------ ------------
|