Re: problems with VELOVECT [message #26358] |
Tue, 21 August 2001 09:34 |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Lasse Clausen wrote:
...
> if n_elements(missing) le 0 then missing = 1.0e30
>
> isn't IDL type-sensitive?
No.
> if n_elements(missing) gt 0 then begin
> good = where(mag lt missing)
> if keyword_set(dots) then bad = where(mag ge missing, nbad)
> endif else begin
> good = lindgen(n_elements(mag))
> endelse
>
> Strange! this if-block is totally unessesary, i believe how can
> 'missing' not be greater than 0? if it's not set (or set to a negative
It is 'n_elements(missing)' that is being compared with 0, not 'missing'
itself.
|
|
|
Re: problems with VELOVECT [message #26359 is a reply to message #26358] |
Tue, 21 August 2001 09:02  |
Lasse Clausen
Messages: 22 Registered: August 2001
|
Junior Member |
|
|
Guess who!?
well, it turned out to be a stupid programming error on my side (who
hadn't expected that?) - please, forgive me for wasting your time.
anyway, I still hav the question about the if-block. I would be very
gratefull if anybody explained its sense to me.
thanks
Lasse Clausen
|
|
|
Re: problems with VELOVECT [message #26362 is a reply to message #26359] |
Tue, 21 August 2001 08:31  |
Lasse Clausen
Messages: 22 Registered: August 2001
|
Junior Member |
|
|
Again me.
i've looked at the source code of VELOVECT.PRO and there are some things
I find suprising.
1)
PRO VELOVECT,U,V,X,Y, Missing = Missing, Length = length, Dots = dots,
$
Color=color, _EXTRA = extra
that's the 'header'. 'Missing' is written with capital M.
further down it says
if n_elements(missing) le 0 then missing = 1.0e30
isn't IDL type-sensitive?
2) then it says
if n_elements(missing) gt 0 then begin
good = where(mag lt missing)
if keyword_set(dots) then bad = where(mag ge missing, nbad)
endif else begin
good = lindgen(n_elements(mag))
endelse
Strange! this if-block is totally unessesary, i believe how can
'missing' not be greater than 0? if it's not set (or set to a negative
number) in the procedure call, its value is set to 1.0e30 (which is
obviously greater than 0). and if it's set, it's set to a positive
number. so how can it *not* be greater than 0?
any remarks?
Lasse Clausen
|
|
|
Re: problems with VELOVECT [message #26363 is a reply to message #26362] |
Tue, 21 August 2001 08:26  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Hi,
Did you try pulling out the NANs? Maybe something like the following.
Index1 = Where( Finite(float(vv_plot)) EQ 1)
Index2 = Where( Finite(float(vw_plot[Index1])) EQ 1)
VELOVECT, VV_PLOT[Index1[Index2]], VW_PLOT[Index1[Index2]], length = 2
Ben
Lasse Clausen wrote:
>
> Greetings.
>
> I get the following error message
>
> % Compiled module: VELOVECT.
> % Attempt to subscript U with GOOD is out of range.
> % Error occurred at: VELOVECT 123
> /opt/rsi/idl_5/lib/velovect.pro
> % VVF 68 vvf.pro
> % AUSLESEN 121 auslesen.pro
> % $MAIN$ 37 soudan.pro
> % Execution halted at: VVF 68 vvf.pro
>
> when using this call
>
> WINDOW,/FREE,XSIZE=1100,YSIZE=900
> !MTITLE = 'velocity vector field - vel'
> !XTITLE = 'time / UTC'
> !YTITLE = 'height (km)'
> VELOVECT,VV_PLOT,VW_PLOT,LENGTH=2
>
> Can it be that this problem has to do with the fact that I'm having
> !VALUES.F_NAN values in the arrays VV_PLOT and VW_PLOT?
>
> Thanks
> Lasse Clausen
--
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575
btupper@bigelow.org
|
|
|
Re: problems with VELOVECT [message #26364 is a reply to message #26363] |
Tue, 21 August 2001 08:04  |
Lasse Clausen
Messages: 22 Registered: August 2001
|
Junior Member |
|
|
> Can it be that this problem has to do with the fact that I'm having
> !VALUES.F_NAN values in the arrays VV_PLOT and VW_PLOT?
>
Nope! I changed the code so that instead of setting the value 99.9 to
!VALUES.F_NAN using the keyword MISSING=99.9. Still I get the same error
message.
Thanks in advance
Lasse Clausen
|
|
|