why the variable become -NaN? [message #63250] |
Wed, 29 October 2008 21:21 |
xiao zhang
Messages: 81 Registered: June 2008
|
Member |
|
|
HI~ every one. i got another question here. I have long program and
there is a part of it. The strange thing is , when I print at the
first place, 'target' is normal float number. but after the small
part, i print it again, it become -NaN, Why is that? any clues?
Thank you~~~
for jj= jjstr, jjend do begin
for ii= iistr, iiend do begin
disx=abs(glon-plon(ii,jj))
disy=abs(glat-plat(ii,jj))
dist=sqrt(disx*disx+disy*disy)
; must avoid missing data ("missing")
target=pdat(ii,jj)
;
if (mmselec eq 1) then begin
print,target
endif
;target still right here
if (dist LT Range and $
target NE missing) then begin
if(dist eq 0.0) then begin
wgt(ii,jj)= 1.
endif else begin
; wgt(ii,jj)= 1./(dist*dist)
wgt(ii,jj)= 1./dist
endelse
if (mmselec eq 1) then begin
print,target
endif
; it is not right any more :(
|
|
|