X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 30 Jun 2014 08:31 AM by  anon
Undefined variable error with ENVI_RESIZE_Doit routine
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
30 Jun 2014 08:31 AM
    Hi all, I am getting an error when using the ENVI Resize_Doit routine, and my first question is, is it compatible with my current version of IDL? I am using IDL version 8.0.1 (with ENVI 4.8). If it is possible to use this routine with my version of IDL, I am trying to figure out why I get the following error "Variable is undefined: WL" Some background into what I am doing. I am loading 3 ascii files then creating an image file using the ENVI_WRITE_ENVI_FILE routine (code below) ENVI_WRITE_ENVI_FILE, rnd_data, BNAMES = ['Red', 'MIR', 'TIR'], FILE_TYPE = 0, INTERLEAVE = 0, NB = 3, NS = ns, NL = nl, OUT_DT = 4, OUT_NAME = ofname, R_FID = rfid Then, I want to resize this image from 7000x7000 to 40x40 using the following code ENVI_FILE_QUERY, rfid, DIMS=dims ENVI_DOIT, 'Resize_Doit', FID = rfid, DIMS = dims, INTERP = 3, RFACT = [0.005714, 0.005714], OUT_BNAME = ['RED' , 'MIR', 'TIR'], OUT_NAME = ofrname and this is where I get the error. I have tried the same concept but using CONGRID, and this produces no error, so I believe that it comes from my implementation of the resize routine. The reason I am not continuing with congrid is because I need to be able to apply the pixel aggregation interpolation method, which according to the help page is not available for the congrid function. This brings up a second question. I have specified the INTERP =3 in the resize, but when viewing the progress window, the interpolation method states: "1st degree polynomial w/ nearest neighbor". Is this correct, as I am trying to get the pixel aggregation method? Would someone be able to help me with interpreting this error please? Many thanks in advance SM

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    02 Jul 2014 06:29 AM
    The error message is a red herring about the 'WL' not being defined. You can get this error when there is something wrong or missing in the code. I believe the issue is with the RFACT since you say you want to downsample to 40x40: From the ENVI help: RFACT Use this keyword to specify a two-element array holding the rebin factors for x and y. The values of RFACT reflect the IDL convention for resizing data. A value of 1 does not change the size of the data. Values less than 1 cause the size to increase; values greater than 1 cause the size to decrease. This is opposite of what you enter into the GUI when using the Resize Data tool.

    Deleted User



    New Member


    Posts:
    New Member


    --
    04 Jul 2014 06:48 AM
    Hello Mari, Thanks for replying and pointing this out to me, I had assumed the RFACT to reflect the gui. Unfortunately, I changed the values that I was using but still get the same error "Variable:WL is undefined". This error if for values both greater than or less than 1. Would you have a solution for why this error is occurring? Many thanks SM

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    14 Jul 2014 08:10 AM
    I am not sure what might be causing it then. You may need to contact technical support directly to help resolve the error.
    You are not authorized to post a reply.