X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01 Oct 2015 02:42 AM by  anon
Attempt to call undefined procedure/function: 'ENVI_OPEN_FILE'.
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:6
New Member


--
01 Oct 2015 02:42 AM
    i want to do layer stacking ,but there is problem about ENVI_OPEN_FILE. the waring is:Attempt to call undefined procedure/function: 'ENVI_OPEN_FILE'. Does anyone know how to solve this problem?thanks pro band_envi_layer_stacking_doit_test,inputfiles,outputfile compile_opt idl2 ; envi,/restore_base_save_files ; envi_batch_init,log_file='batch.txt' inputfiles=['E:\test\test\MOD02HKM.A2015001.0230.006.2015002125159reproject_reflectance_georef-PRE-RC-469.tif',$ 'E:\test\test\MOD02HKM.A2015001.0230.006.2015002125159reproject_reflectance_georef-PRE-RC-555.tif'] outputfile='E:\test\test\tm_band_12' fids=lonarr(n_elements(inputfiles)) dimses=lonarr(5,n_elements(inputfiles)) poses=lonarr(n_elements(inputfiles)) for i=0,n_elements(inputfiles)-1 do begin envi_open_file,inputfiles[i],r_fid=fids1 ;if fids1 EQ -1 THEN RETURN envi_file_query,fids1,ns=ns,nl=nl,nb=nb fids[i]=fids1 dimses[0,i]=[-1,0,ns-1,0,nl-1] proj=envi_get_projection(fid=fids,pixel_size=out_ps) poses[i]=0 endfor envi_doit,'envi_layer_stacking_doit',$ fid=fids,pos=poses,dims=dimses,$ out_dt=4,out_name=outputfile,$ interp=0,out_ps=out_ps,$ out_proj=proj,r_fid=r_fid end

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    01 Oct 2015 06:32 AM
    If you are running from IDL only, you need to use these two lines: ; envi,/restore_base_save_files ; envi_batch_init,log_file='batch.txt' Is there a reason why they are commented out of your code? Can you run your program if you launch ENVI from the IDL command prompt and then compile and run?

    Deleted User



    New Member


    Posts:6
    New Member


    --
    01 Oct 2015 11:09 PM
    hi,MariM: it is this reason that the these two lines code are commented out.thanks
    You are not authorized to post a reply.