Hi all, i am experimenting problems writing a code to georeference MODIS DATA.
I copy and paste the code “example_glt_usage” from ENVI help in the IDL soft 6.2, I change the "[ ]" like mnimari said in the post cited, and I compile and run the code, then I select the images and next the runtime halt with the message error:
“envi_built_glt_doit: An error has occurred during processing”
Error: “Attempt to subscript DXS with is out of range.” The result may be invalid.
Some one experimented these error?
thanks,
Javier
[QUOTE]m.brogioni@ifac.cnr.it wrote
Hi all, I am experiencing several problems in writing a code for georeferencing satellite data (MODIS, AMSR-E and also smaller images, eg 200x200 pixels). I am using the code I found in the ENVI help (which I attached at the bottom of the post). Unfortuately, when the ENVI_GLT_DOIT command is executed I get this error:
envi_built_glt_doit: An error has occurred during processing
Error:"The array must be a scalar in this context: ." Results may be wrong
I get this error independently of the input data. I have try to debug the code but IDL doesn't show the code (as expected). Does someone knows how to fix this problem?
Thanks,
Marco
____________________________________________________
example_glt_usage, eventstrictarr
; Select an image and it's associated input geometry.
envi_select, title=
dims=dims, fid=fid, pos=pos
'Please select an image to georeference', $
if
envi_select, title=
fid=x_fid, dims=dims, pos=x_pos, /band_only, /no_dims
fid eq -1 then return'Please select the longitude band', $
if
envi_select, title=
fid=y_fid, dims=dims, pos=y_pos, /band_only, /no_dims
x_fid eq -1 then return'Please select the latitude band', $
if
y_fid eq -1 then return
; Figure out what UTM zone we're in.
query_dims = [-
lat_lon = [envi_get_data(fid=y_fid, dims=query_dims, pos=y_pos), $
1L, long(dims[2]/2), long(dims[2]/2), long(dims[4]/2), long(dims[4]/2)]
envi_get_data(fid=x_fid, dims=query_dims, pos=x_pos)]
zone =
south = (lat_lon[
fix(31.0 + lat_lon[1]/6.0)0] lt 0)
; Make the GLT.
envi_file_query, fid, sname=sname
out_name=sname+
pixel_size=[
rotation=
i_proj = envi_proj_create(/geographic)
o_proj = envi_proj_create(/utm, zone=zone)
envi_glt_doit, i_proj=i_proj, $
o_proj=o_proj, out_name=out_name, $
pixel_size=pixel_size, r_fid=glt_fid, $
rotation=rotation, x_fid=x_fid, y_fid=y_fid, $
x_pos=x_pos, y_pos=y_pos
'_glt'500.0D]0L
if
glt_fid eq -1 then return
; Georeference the image from the GLT.
out_name=sname+
envi_doit,
glt_fid=glt_fid, out_name=out_name, pos=pos, $
subset=dims, r_fid=r_fid
'_georef''envi_georef_from_glt_doit', fid=fid, $
end
[/QUOTE]
compile_opt
pro
|