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
|