X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 Oct 2011 06:51 AM by  anon
IDL_IDLBRIDGE and ENVI_GET_SLICE
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
14 Oct 2011 06:51 AM
    Hello, I have a routine that creates multiple threads, loads data, processes it and saves it. When I try to use ENVI_GET_SLICE I get the error message: IDL_IDLBRIDGE Error: Attempt to call undefined procedure/function: 'PROCESSTHREAD'. The strange thing is that the exact same code works if I delete or comment out the line containing ENVI_GET_SLICE. Without the ENVI_GET_SLICE section this code simply copies the data from the load directory to the save directory, and it works, I get no error message and the file is indeed copied. The routine looks something like this: ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX in my workspace a file called main.pro: pro main fileName = 'exampleFile' thread = OBJ_NEW('IDL_IDLBRIDGE') command = "processThread, '"+fileName+"'" thread->execute,command end in my IDL lib directory a file called processThread.pro: pro processThread, fileName ;initialize envi ENVI, /RESTORE_BASE_SAVE_FILES ENVI_BATCH_INIT ;load file envi_open_file, fileName, r_fid=fid envi_file_query, fid, nb=numBands, dims=dims, wl=wl allBands = lindgen(numBands) numSamples = dims(2)+1 numLines = dims(4)+1 data=make_array(numSamples, numLines, numBands, /float) for i = 0, numLines-1 do data(*,i,*) = envi_get_slice(fid=fid,line=i,pos=allBands,xs=0,xe=numSamples-1) envi_file_mng, id=fid, /REMOVE ;processing would go here ;save the file outName='exampleOutName' envi_write_envi_file, data, out_name=outName, wl=wl, wavelength_units=1L, r_fid=fid envi_file_mng, id=fid, /REMOVE end ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Any ideas on what is happening?

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    14 Oct 2011 10:34 AM
    Try adding in COMPILE_OPT IDL2 in the beginning of the pro. For example: pro processThread, fileName compile_opt idl2 which should help resolve the routine.

    Deleted User



    New Member


    Posts:
    New Member


    --
    14 Oct 2011 12:00 PM
    That fixed it, thank you.
    You are not authorized to post a reply.