X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Aug 2014 05:10 PM by  anon
Using ENVI_GEOREF_FROM_GLT with a SuperGLT
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Aug 2014 05:10 PM
    I'm trying to use the IDL 8.3 CLI interface on Linux to have ENVI create a GLT and GeoRef image to export to a GeoTIFF. I'm primarily using the functions ENVI_GLT_DOIT and ENVI_GEOREF_FROM_GLT_DOIT. I was able to get this working using the following code: e = ENVI(/HEADLESS) geo_raster = e.OpenRaster("/path/to/locationFile.dat") data_raster = e.OpenRaster("/path/to/dataFile.dat") geo_fid = ENVIRasterToFID(geo_raster) data_fid = ENVIRasterToFID(data_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 ENVI_DOIT, 'ENVI_GEOREF_FROM_GLT_DOIT', FID=data_fid , GLT_FID=glt_fid, /IN_MEMORY, POS=[0,1,2], R_FID=georef_fid georef_raster = ENVIFIDToRaster(georef_fid) e.ExportRaster, georef_raster, '/path/to/output/geo.tiff', 'TIFF' This code above works well and results in a GeoTIFF. However, I'd like to convert this code to use ENVI's SuperGLT algorithms, so I changed the code to this: e = ENVI(/HEADLESS) geo_raster = e.OpenRaster("/path/to/locationFile.dat") data_raster = e.OpenRaster("/path/to/dataFile.dat") geo_fid = ENVIRasterToFID(geo_raster) data_fid = ENVIRasterToFID(data_raster) ENVI_DOIT, 'ENVI_GLT_DOIT', DIMS=dims, /SUPER, OUT_NAME='/tmp/gltScratch.dat', 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 ENVI_DOIT, 'ENVI_GEOREF_FROM_GLT_DOIT', FID=data_fid , GLT_FID=glt_fid, /SUPER, SGL_NAME='/tmp/gltScratch.dat', OUT_NAME='/tmp/georefScratch.dat', POS=[0,1,2]") georef_raster = e.OpenRaster("/tmp/georefScratch.dat") e.ExportRaster, georef_raster, '/path/to/output/geo.tiff', 'TIFF' Unfortunately, I'm having trouble with the 'ENVI_GEOREF_FROM_GLT_DOIT' step. Basically, it doesn't give any error messages, nor does it write the output file to /tmp/georefScratch.dat (so of course the following line, for the georef_raster, fails since it can't find that file to open). I've tried a few things to change the inputs and outputs to this step but haven't been able to get the function to output anything; it's basically poking at a black box with no feedback. Can anyone give me some advice on how to properly use the ENVI_GEOREF_FROM_GLT_DOIT with a SuperGLT? Thanks. -Nick

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    17 Aug 2014 08:05 AM
    When using the Super GLT, you will return an .sgl file but it is not a regular file with a .dat + .hdr. There will be no GLT FID for the super GLT file. So when calling the GEOREF_FROM_GLT_DOIT, you only need the /SUPER and the sgl_name='sgl_file'. For example: ;ENVI_GLT_DOIT ENVI_DOIT, 'ENVI_GLT_DOIT', rotation=0, DIMS=dims,I_PROJ= i_proj, O_PROJ=o_proj, /super, $ out_name = 'hdf_glt_super', X_FID=x_fid, X_POS=x_pos[0], Y_FID=y_fid, Y_POS=y_pos[0] ;ENVI_GEOREF_FROM_GLT_DOIT ENVI_DOIT, 'ENVI_GEOREF_FROM_GLT_DOIT', BACKGROUND=0, FID=refl_fid, pos=pos, /super, $ sgl_name = hdf_glt_super', out_name='C:\Testing\Code\GLT\hdf_SuperGeoref.img', in_memory=0, r_fid=out_fid
    You are not authorized to post a reply.