X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11 Jan 2017 01:27 PM by  anon
RTV_DOIT /IN_MEMORY problems
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:29
New Member


--
11 Jan 2017 01:27 PM
    Hi all, I'm trying to set up a standalone GUI (eventually optionally commandline) tool to automate the creation of contour lines on data. Last summer I was guided on this forum to use RTV_DOIT. When I set up the proper inputs to the RTV_DOIT ENVI DOIT command, I get the following error from /IN_MEMORY at "envi_doit, 'rtv_doit', dims=dims, fid=fid, /in_memory, l_name=levlavel, out_name=outNames, pos=bandDo, values=levels": "Attempt to subscript IN_MEMORY with loop is out of range" The result may be invalid. If I take out the /IN_MEMORY option, then the error I get it: "Error: Variable is undefined: IN_MEMORY." The result may be invalid" After both messages, no contour file is given as output. My goal is to have a vector output that can be overlayed on the raster the RTV_DOIT analyzes. Any ideas/tips?

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    12 Jan 2017 08:31 AM
    The help for RTV_DOIT discuss how the in_memory array should be set up (yes, an array which is a little unusual!): IN_MEMORY Set this keyword to an array of ones and zeros indicating the storage location for each of the output vectors. IN_MEMORY is a long-integer array of ones and zeros with the same number of elements as VALUES and OUT_NAME. So in some example code that I have using ENVI's sample dataset, I set it up like this: envi_open_file, 'C:\Program Files\Exelis\ENVI50\classic\data\bhdemsub.img', r_fid=fid envi_file_query, fid, dims=dims pos = [0] values = [1250, 1300, 1350, 1400, 1450, 1500] out_names = 'testimg_' + $ strcompress(string(values),/remove_all) + '.evf' l_name = ['1219', '1288', '1357', '1426', '1494', '1563'] in_memory = lonarr(n_elements(values)) envi_doit, 'rtv_doit', fid=fid, pos=pos, dims=dims, $ values=values, l_name=l_name, in_memory=in_memory, $ out_names=out_names

    Deleted User



    New Member


    Posts:29
    New Member


    --
    16 Jan 2017 05:13 PM
    Hi Mari, Adding in the "in_memory = lonarr(n_elements(values))" line helped greatly and allowed the program to run after a bit more debugging on my end. My ultimate goal with this is to create contour maps - when I use the RTV_ENVI doit on heightmap rasters, I get an error "The following raster values were not contained in the input band so no vector values was created:" with a varying list of contour levels. The resulting vectors that only encircle a few pixels in random places throughout the image - is there a better way to get contours on an ENVI raster, or am I doing this right?
    You are not authorized to post a reply.