X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 Apr 2006 03:57 AM by  anon
Use of ENVI_OPEN_FILE no_realize option
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
24 Apr 2006 03:57 AM
    Hi, I wrote some codes to transfer an image file to grid. I used the no_realize option in the envi_open_file. The code compiled ok but when it runs, envi gave me the error: % ENVI_OPEN_FILE: Incorrect number of arguments. My code is like follows: ; Open the input file in ENVI envi_open_file, infiles, no_realize, r_fid=fid ; Gracefully exit if the user picked a bogus file if (fid eq -1) then return ;Query the number of samples, lines, and bands in the file envi_file_query, fid, ns=ns, nl=nl, nb=nb ; Select all bands in the file for output pos = lindgen(nb) ; Export the entire spatial extent of the dataset dims = [-1,0,ns-1,0,nl-1] ; Export the GRID file, referenced by file id envi_output_to_external_format, ESRI_GRID,$ fid=fid, pos=pos, dims=dims, out_name=outfilename

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Apr 2006 09:11 AM
    I figured out my mistakes in put the argument. I should put "/" before the argument. The following code can run. But I have an error in writing ESRI grid. ; Open the input file in ENVI envi_open_file, infiles, /no_realize, /no_interactive_query,r_fid=fid ; Gracefully exit if the user picked a bogus file if (fid eq -1) then return ;Query the number of samples, lines, and bands in the file envi_file_query, fid, ns=ns, nl=nl, nb=nb ; Select all bands in the file for output pos = lindgen(nb) ; Export the entire spatial extent of the dataset dims = [-1,0,ns-1,0,nl-1] ; Export the GRID file, referenced by file id envi_output_to_external_format, /ESRI_GRID,$ fid=fid, pos=pos, dims=dims, out_name=outfilename

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 Apr 2006 03:57 AM
    Hi Zhengpeng Li, I think your code to call ENVI_OPEN_FILE should be written in this way: envi_open_file,infiles,/no_realize,r_fid=fid
    You are not authorized to post a reply.