X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 03 Jul 2013 09:41 AM by  anon
GS Sharpen in IDL batch
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
03 Jul 2013 09:41 AM
    Hi, I want to sharpen a series of images in batch mode IDL and I use the following commands: hrv = e.OpenRaster(curfile) fid_hrv = ENVIRasterToFID(hrv) rgb = e.OpenRaster(rgbfile) fid_rgb = ENVIRasterToFID(rgb) envi_file_query, fid_hrv, dims=dims ENVI_DOIT, 'SHARPEN_DOIT', F_DIMS=dims, F_FID=fid_hrv, F_POS=lindgen(1), FID=fid_rgb, INTERP=2,METHOD=0, pos=lindgen(3), R_FID=fid_sha,/in_memory hires = ENVIFIDToRaster(fid_sha) e.ExportRaster, hires, outfile, 'TIFF' curfile, rgbfile and outfile are all correct and fid_hrv + fid_rgb show valid values. However, the script fails on the line that I have bolded with an error stating that fid_sha is incorrect (it has a value of -1). I have tried both the HSV sharpening and GS sharpening and get the same result. Any ideas what is wrong here? The input files are byte format are not georeferenced*. Both HSV and GS work correctly through the ENVI GUI, but not in this batch script. *Indeed, can't be georeferenced, envi doesn't support GEOS projection. This does not affect the GUI processing. -edited- Also, in case it's useful: Stepping through each line of code (even though I can't see them) within envi_doit shows that something returns error status -162. The system->!error_state->msg variable contains: "Attempt to subscript FID with is out of range"

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    03 Jul 2013 01:59 PM
    What if you set the F_POS to be 0 (or whatever band position in the file you want to use). I think F_POS=lindgen(1) is making an array and it needs to be a single integer value 0 or greater.

    Deleted User



    New Member


    Posts:
    New Member


    --
    04 Jul 2013 03:34 AM
    Thanks for the reply. Unfortunately I still get the same error, even with F_POS=0 Any other ideas?

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Jul 2013 01:43 PM
    The issue is with how your 'fids' are setup and called in the 'doit'. It looks like everything related to 'fid_hrv' is OK but the fid_rgb is where the problem is. Try the following: rgb = e.OpenRaster(rgbfile) fid_rgb = ENVIRasterToFID(rgb) print, fid_rgb envi_file_query, fid_rgb, dims=dims, nb=nb pos2=[2, 1, 0] infid=[fid_rgb, fid_rgb, fid_rgb] ENVI_DOIT, 'SHARPEN_DOIT', F_DIMS=dims, F_FID=fid_hrv, F_POS=pos, $ FID=infid, INTERP=0,METHOD=0, pos=pos2, $ R_FID=fid_sha,$ ; out_name=out_name, $ /in_memory
    You are not authorized to post a reply.