X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 Aug 2016 06:06 PM by  anon
ENVI CLI Bug Ignores Different Raster Input
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
23 Aug 2016 06:06 PM
    I'm trying to script some ENVI behavior using the IDL/ENVI command line tools on IDL Version 8.5.1 (linux x86_64 m64). However, I'm running into some problems that I think are bugs. I'm using the ENVI GLT and GeoRef tools like such from the IDL/ENVI Command line with the following code extracted from my scripts: e = ENVI(/HEADLESS) geo_raster = e.OpenRaster("/path/to/2016-01-26.210054.HonorRancho.Line1-Run1-Segment01-110000-geo.dat") geo_fid = ENVIRasterToFID(geo_raster) ENVI_DOIT, 'ENVI_GLT_DOIT', DIMS=dims, /IN_MEMORY, I_PROJ=ENVI_PROJ_CREATE(/geographic), O_PROJ=ENVI_PROJ_CREATE(/geographic, datum='WGS-84', units=envi_translate_projection_units('Meters')), R_FID=glt_fid, ROTATION=0, X_FID=geo_fid, X_POS=1, Y_FID=geo_fid,Y_POS=0 data_raster_file_1 = e.OpenRaster("/path/to/L3_CMF2_Layers_Source_Data/2016-01-26.210054.HonorRancho.Line1-Run1-Segment01.L3-CMF2-L1Background.dat") data_fid_file_1 = ENVIRasterToFID(data_raster_file_1) ENVI_DOIT, 'ENVI_GEOREF_FROM_GLT_DOIT', FID=data_fid_file_1 , GLT_FID=glt_fid, /IN_MEMORY, POS=[0,1,2], R_FID=georef_fid_file_1 georef_raster_file_1 = ENVIFIDToRaster(georef_fid_file_1) e.ExportRaster, georef_raster_file_1, '/path/to/L3_CMF2_Layers_Source_Data/2016-01-26.210054.HonorRancho.Line1-Run1-Segment01.L3-CMF2-L1Background.geo.tiff', 'TIFF' data_raster_file_2 = e.OpenRaster("/path/to/L3_CMF2_Layers_Source_Data/2016-01-26.210054.HonorRancho.Line1-Run1-Segment01.L3-CMF2-NH3NoBack.dat") data_fid_file_2 = ENVIRasterToFID(data_raster_file_2) ENVI_DOIT, 'ENVI_GEOREF_FROM_GLT_DOIT', FID=data_fid_file_2 , GLT_FID=glt_fid, /IN_MEMORY, POS=[0,1,2], R_FID=georef_fid_file_2 georef_raster_file_2 = ENVIFIDToRaster(georef_fid_file_2) e.ExportRaster, georef_raster_file_2, '/path/to/L3_CMF2_Layers_Source_Data/2016-01-26.210054.HonorRancho.Line1-Run1-Segment01.L3-CMF2-NH3NoBack.geo.tiff', 'TIFF' What happens here is that the exported TIFF files (and the georef_raster_file_1 & 2) come out identical even though their source data is completely different (the first file just gets copied to the raster for the second). If I quit IDL between processing file_1 and file_2 (and load the GLT in place after relaunching) everything works correctly so it's not an issue with my code. So, questions: Is there some way I can remove a raster and file id from ENVI's memory space via the CLI? (I can't seem to find any documentation of such a command.) Perhaps this could be a way to work around the bug Do I need to do anythign else to report this bug?

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    25 Aug 2016 01:56 PM
    One good way to check your parameters passed to the routines is to put in some PRINT statements. Can you add a PRINT statement of the FID prior to passing it through the DOIT. It seems very unlikely that if you are passing a FID with a different value that it could return the same file. I did not see it in your code, so I was wondering where you were getting the values for DIMS and POS before you call the GLT_DOIT. You would need to use ENVI_FILE_QUERY to get these values. Can you do a print to confirm the values that are passed are the correct values for the file? If you need to, you can use ENVI_FILE_MNG to remove a FID from memory between calls.

    Deleted User



    New Member


    Posts:
    New Member


    --
    25 Aug 2016 04:07 PM
    Thanks for your help. ENVI_FILE_MNG was just the tool I needed to remove old file IDs and debug. I was able to get things working after that.
    You are not authorized to post a reply.