; SLICER data browser V. 2.1, 8/29/98 pro inflecpt,bdin,infldist,instr_xsz,instr_ysz,dathdr ; determine in which digitizer bin the maximum canopy return occurs ; (i.e., the canopy LAI inflection height for simple, single-story canopies) ; and convert to distance from canopy start ; determine maximum on version of waveform smoothed by running average filter of width 9/dig2wf_average (1 meter) and ; only consider canopy returns higher than 1 meter above the start of the ground return to ; avoid initial ground returns incorrectly included above the defined start of ground return wset,4 erase instruc='Computing maximum canopy return position ' xyouts,instr_xsz*0.01,instr_ysz*0.6,instruc,/device,color=4 instruc='(i.e., the canopy LAI inflection height for simple, single-story canopies) ' xyouts,instr_xsz*0.01,instr_ysz*0.1,instruc,/device,color=4 numelem=n_elements(bdin) numwvelem=dathdr.wvfm_bins grndstart_bin=round(bdin.grndstart/(0.1112*dathdr.dig2wf_average))+dathdr.tiu_bin infl_bin=grndstart_bin smooth_wv=fltarr(numwvelem,1) filt_width=fix(9/dathdr.dig2wf_average) for i=0L,numelem-1 do begin temp_wv=bdin(i).waveform smooth_wv(0:grndstart_bin(i))=smooth(float(temp_wv(0:grndstart_bin(i))),filt_width) smooth_wv(0:dathdr.tiu_bin-1)=0.0 smooth_wv(grndstart_bin(i)-filt_width:numwvelem-1)=0.0 infl_bin(i)=min(where(smooth_wv eq max(smooth_wv))) if infl_bin(i) lt dathdr.tiu_bin then infl_bin(i)=dathdr.tiu_bin endfor infldist=bdin.grndstart infldist=(infl_bin-dathdr.tiu_bin)*(0.1112*dathdr.dig2wf_average) end