X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Jul 2011 10:19 AM by  anon
WL variable undefined
 0 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
13 Jul 2011 10:19 AM
    I'm writing an ENVI+IDL program to automate image reprojection. At the call of ENVI_CONVERT_FILE_MAP_PROJECTION, the corresponding ENVI dialog opens, as if it were working, but then I get the following error: "reg_warp_doit: An error has occurred during processing Error: "Variable is undefined: WL." The result may be invalid." I don't know where the WL variable *should* be defined, or where it's used. I don't see it in documentation for ENVI_CONVERT_FILE_MAP_PROJECTION, and I can't find documentation for the reg_warp_doit function anywhere; presumably the top-level ENVI function calls it? The relevant loop of code follows. I'm an ENVI newb so I apologize for any and all spaghetti. Also, is there an easy way to preserve code formatting in this forum? Thanks for all your help! for scene=0,(NUMSCENES[site]-1) do begin ;start loop per scene modisfolder = modisdirbase[site] + modispaths[scene] l5folder = l5dirbase[site] + l5paths[scene] l5image = file_search(l5folder, '*_B10.TIF', count=LnumFiles ) modisimage = file_search(modisfolder, 'MOD02QKM*.TIF', count=MnumFiles) ;if output folder doesn't exist, create it: outputpath = modisfolder + '\Landsat-UTM' file_mkdir, outputpath if MnumFiles eq 1 and LnumFiles eq 1 then begin ENVI_OPEN_DATA_FILE,modisimage,r_fid=modisfid ENVI_OPEN_DATA_FILE,l5image,r_fid=l5fid ;openr,2,l5image print,"modis: ",string(modisfid) print,"l5: ",string(l5fid) print,'recropping ' + modisimage + ' to fit ' + l5image success = success + 1 ;files found, so recrop/reproject modis to l5, and separate bands into individual files ;first, update output filenames qkm_output_filenames = strarr(2) qkm_output_base = strmid(modisimage,0,strlen(modisimage)-4) for band=0,1 do qkm_output_filenames[band] = qkm_output_base + qkmbands[band] + '.tif' print,'start print output.' help,qkm_output_filenames print,qkm_output_filenames print,'done print output.' ;recropping/reprojecting print,'getting format now.' format = ENVI_GET_PROJECTION(fid=l5fid) help,format print,'calling projection function.' ENVI_CONVERT_FILE_MAP_PROJECTION,fid=modisfid,dims=dims,O_PROJ=format,$ OUT_BNAME=qkm_output_filenames,OUT_NAME="Z:\Images\Modis\Test_Folder\testoutput.tif" print,'called projection function.' ENVI_FILE_MNG,id=modisfid,/remove ENVI_FILE_MNG,id=l5fid,/remove endif else begin print, 'error at ' + modisfolder + ": MnumFiles = " print, MnumFiles failure = failure + 1 endelse endfor
    You are not authorized to post a reply.