; this code is used to find the contour of footprint that encircles a ; specific percent of total footprint area FUNCTION findcontour,ft,gridsize,ratio,source_area=area ; find the max ft, firstly ; ft-- arary, footpint, ttotal(ft)*grid*grid=1 ; gridszie- as the name ; ratio -- percent of the ft area, e.g., 0.9, 0.95 ; area -- the area the contour encircles ; normalized ft=ft/(gridsize*gridsize*total(1d*ft)) peak=1.0d*max(ft) n=1000. dp=abs(peak)/n value=-999. FOR i=0,n-1 DO BEGIN value=peak-dp*i r=where(ft ge value,count) IF count LE 0 THEN BEGIN value=-999. r=0.0 GOTO,ccc ENDIF rrr=1.0d*gridsize*gridsize*total(1.0d*ft(r)) area=gridsize*gridsize*float(len(r)) IF rrr GE ratio THEN begin value=value-dp GOTO, ccc endif ENDFOR ccc: return,value END