comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » ENVI_GLT_DOIT and ENVI_GEOREF_FROM_GLT_DOIT
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
ENVI_GLT_DOIT and ENVI_GEOREF_FROM_GLT_DOIT [message #84359] Thu, 30 May 2013 08:27
Oana Coman is currently offline  Oana Coman
Messages: 27
Registered: December 2011
Junior Member
Hi guys,
I'm trying to use an envi batch file to automate georeferencing from GLT to try and put the pixels in an image in the right place according to their lat/lon position information. When I do the process by hand in ENVI it works fine, but once I try and run it through IDL none of it works.

My first problem is that when I go to view the completed GLT, it does not have any header information or map information, so when I go to open the file and give it a file ID, it asks for header info (which I don't have), and if I don't give it a header info then it will have an invalid file ID. When I create a GLT file in regular ENVI, it doesn't give it any header or map info...so I'm not sure how to get around this issue. I think the invalid file ID is what's causing the second problem: The ENVI_GEOREF_FROM_GLT_DOIT doesn't even run. IDL seems to just skip past this procedure.

Does anyone have an idea how to get around this missing header information?

This is my code:
;make projections for ENVI_GLT_DOIT
inProj = ENVI_PROJ_CREATE(/GEOGRAPHIC) ;geographic lat/lon
param=[3396190.0, 0.000000, 0.000000, 0.0, 0.0]
outProj = ENVI_PROJ_CREATE(NAME='Mars Equirectangular Default', PARAMS=param, TYPE=17) ;mars equirectangular

ENVI_OPEN_FILE, TRR, R_FID=cTRR, NO_REALIZE=1 ;I/F image
ENVI_FILE_QUERY, cTRR, dims=TRRdims
ENVI_OPEN_FILE, DRR, R_FID=cDDR, NO_REALIZE=1 ;lat/lon image
ENVI_FILE_QUERY, cDDR, dims=DDRdims

;run super GLT
outGLT = 'testGLT_15mpp'
ENVI_DOIT, 'ENVI_GLT_DOIT', DIMS=DDRdims, I_PROJ=inProj, O_Proj=outProj, OUT_NAME=outGLT, $
PIXEL_SIZE=15, R_FID=GLT15, ROTATION=0.0, /SUPER, $
X_FID=cDDR, X_POS=1, Y_FID=cDDR, Y_POS=0

;georeference TRR using super GLT
ENVI_OPEN_FILE, outGLT, R_FID=OUT, NO_REALIZE=1
print, 'open GLT files' ;this is where idl wants me to enter header information.
ENVI_FILE_QUERY, OUT, ns=ns, nl=nl, nb=nb, dims=GLTdims
print, 'get GLT file dims' ;dims end up being undefined
outimage = 'GLTbatchTEST.IMG'
ENVI_DOIT, 'ENVI_GEOREF_FROM_GLT_DOIT', BACKGROUND=0.0, FID=cTRR, GLT_DIMS=GLTdims, GLT_FID=GLT15, $
OUT_NAME=outimage, R_FID = ATO_15mpp, SGL_NAME=outGLT, /SUPER
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL problem with ncdf_vardef: can' exit definition mode
Next Topic: contour/cgcontour question regarding latitude order?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:40:13 PDT 2025

Total time taken to generate the page: 0.00517 seconds