Re: ENVI_GLT_DOIT and ENVI_GEOREF_FROM_GLT_DOIT [message #84354] |
Thu, 30 May 2013 14:43  |
Oana Coman
Messages: 27 Registered: December 2011
|
Junior Member |
|
|
On Thursday, May 30, 2013 10:29:31 AM UTC-5, Kat wrote:
> On Thursday, May 30, 2013 10:27:51 AM UTC-5, Kat wrote:
>
>> 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
>
>
>
> correction, ENVI_OPEN_FILE, outGLT, R_FID=OUT, NO_REALIZE=1 should read ENVI_OPEN_FILE, outGLT, R_FID=GLT15, NO_REALIZE=1. Either way, the FID is -1
I've been trying to figure out the issue and realized if I take out the /SUPER keyword, everything works as it should. As soon as I put the /SUPER keyword back in, the ENVI_GLT_DOIT procedure will not give me an R_FID (therefore I can't run the georeferencing procedure). If I run GLT_DOIT without the /SUPER keyword, but add the /SUPER keyword to ENVI_GEOREF_FROM_GLT_DOIT, ENVI_GEOREF.... will not run at all.
I need to make a super GLT. A regular one does not give me good enough resolution.
If anyone can solve the mystery of the /SUPER keyword, it will make my day :)
Thanks!
|
|
|
Re: ENVI_GLT_DOIT and ENVI_GEOREF_FROM_GLT_DOIT [message #84358 is a reply to message #84354] |
Thu, 30 May 2013 08:29   |
Oana Coman
Messages: 27 Registered: December 2011
|
Junior Member |
|
|
On Thursday, May 30, 2013 10:27:51 AM UTC-5, Kat wrote:
> 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
correction, ENVI_OPEN_FILE, outGLT, R_FID=OUT, NO_REALIZE=1 should read ENVI_OPEN_FILE, outGLT, R_FID=GLT15, NO_REALIZE=1. Either way, the FID is -1
|
|
|
|