西宏示 西宏示
关注数: 37 粉丝数: 290 发帖数: 8,254 关注贴吧数: 36
初学者请教,函数调用错误如何解决? 程序用来根据excel表里面的坐标值获取图像的像素值,执行时候最后的for循环会提示错误Attempt to call undefined procedure/function: 'EXTRATDN',请问如何解决? ////////////////////////////////////////////////////// pro ExtratDN, csv, inImage, otDN compile_opt idl2 ;;Debug Block csv='C:\Users\lcy\Desktop\Exercise\GeoInfo.csv' inImage='C:\Users\lcy\Desktop\Exercise\MOD_2011_EVI.tif' ;;Retrieve long&lat from .csv txt=Read_Csv(csv, header=header) lon=txt.field2 ;;Longtitude lat=txt.field3 ;;Latitude ;;Convert to the Projection as same as the Imput Image ;1. Retrieve the Pojection Info from Input Image ENVI_OPEN_FILE, inImage, r_fid=fid ProjInfo=ENVI_GET_PROJECTION(fid=fid) ;2. Original projection of Lon/Lat OriProj=ENVI_PROJ_CREATE(/geo) ;3. Process of Convert ENVI_CONVERT_PROJECTION_COORDINATES, $ lon, lat, OriProj, $ otX, otY, ProjInfo ;;Extract the Col & Row for the input Geoinfo ;1. Geolocation of Upper Left Point (0, 0) of the Input Image mapinfo=ENVI_GET_MAP_INFO(fid=fid) ULlon=mapinfo.mc(2) ULlat=mapinfo.mc(3) ;2. X/Y Size of the Input Image Xsize=mapinfo.PS(0) Ysize=mapinfo.PS(1) ;3. Calculate the Number of Col & Row Row=(otX-ULlon)/Xsize Coll=(otY-ULlat)/Ysize Row=fix(abs(Row)) ;;Subscript directly from 0 Coll=fix(abs(coll)) ;;Extraction of DN ;1. Number of DNs compile_opt idl2 otDN=fltarr(N_DN) ;2. Retrieve the DN one by one tiff=Read_Tiff(inImage, GeoTIFF=GeoVar) for ii=0, N_DN-1 do begin otDN(ii)=tiff(Row(ii), Coll(ii)) endfor end
首页 1 2 下一页