Hi,
It's my first time in a forum, i hope we can help each other.
Well, I'm trying to calculate the WDVI index but I can't put the slope soil into the expression of math_doit, it doesn't recononise, it said that my variable is undefined. Also, I tested using with making a function of the index, but it doesn't work. So, my question is How can i put this variable in the band math expression??.. in this case "ss". The first expr is NDVI and the second is the WDVI.
Here is a part of the scrip that i mentioned, I read the image and applied ENVI_VEG_SUPPRESS_DOIT to get the soil slope. Here, rj is a vector in bytes of the red band and ir of the NIR band. If someone knows a better form of calculate the soil slope please tell me, bacause i work with aerial photos and they are always in differentes possicions and sometime can include channels with water.
num_index=2
coeff=LINFIT(rj, ir)
YFIT = coeff[0] + coeff[1]*rj
ss=coeff[1]
fid_w1=[fid_w,fid_w]
out_fid=lonarr(num_index)
expr=['(float(b2)-float(b1))/(float(b2)+float(b1))','float(b2)-(ss)*(float(b1))']
for i=0,num_index-1 do begin
envi_doit, 'math_doit', dims=dims, exp=expr[i], pos=[0,1], fid=fid_w1, /IN_MEMORY, r_fid=r_fid
out_fid[i]=r_fid
endfor
Thanks in advance
Mariella
|