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

Home » Public Forums » archive » Mosaic_doit ... but IDL doesn't do it. Please, help me...!!!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Mosaic_doit ... but IDL doesn't do it. Please, help me...!!! [message #76728] Tue, 28 June 2011 05:50
Harry Kim is currently offline  Harry Kim
Messages: 16
Registered: April 2010
Junior Member
I spent 3 days on this mosaic_doit function without doing other
things, but IDL doesn't do it.
All 4 files were successfully retrieved from original *.hdf files.
My problem is that... Mosaicked image is all black.

This is what I have done so far. Please give me any suggestions or
comments. Thanks.
-----------------------
pro Mosaic_example

; Path designation
input_path = 'I:\MODIS\HDF\2008\MOD13\Mosaic\MOD13A2\'
output_path = 'I:\MODIS\HDF\2008\MOD13\Mosaic\MOD13Mosaic\'

for h = 0, 0 do begin

date = 16 * h + 1
print,'Processing MODIS images of DOY', date
dir=input_path
cd,dir
files=FILE_SEARCH('MOD13A2.A2008'+strtrim(string(date,
format='(I03)'), 2)+'.h*.hdf', count=num_inputfiles)
print, ' files = ' , files

;MODIS grid file

;format='MOD13A2.A2008001.h27v04.005.2008019050117.hdf'
;START IMPORTING MODISTILES
for i=0,num_inputfiles-1 do begin
grid_file=files[i]

print, 'grid_file = ', grid_file

;output_rootname = 'Landinputs_'+strtrim((strmid(grid_file,
9,7)+'_'+strmid(grid_file,17,6)),2)+'_'
output_rootname = 'MOD13A2_'+strtrim((strmid(grid_file,
9,7)+'_'+strmid(grid_file,17,6)),2)
year=strmid(grid_file,9,4)
grid_name = 'MODIS_Grid_16DAY_1km_VI'
sd_names = ['1 km 16 days NDVI']
out_method = 0
convert_modis_data, in_file=grid_file, out_path=output_path,
out_root=output_rootname, $
/higher_product, /grid, gd_name=grid_name, sd_names=sd_names,
out_method=out_method,background=255;, fill_replace_value=255
print, 'output_rootname = ', output_rootname
endfor
cd, output_path
inputs =
file_search('MOD13A2_2008'+strtrim(string(date,format='(I03) '),
2)+'*.img', count=inputfiles)
print,'inputfiles', inputfiles
fids=lindgen(inputfiles)

for i=0, inputfiles-1 do begin
envi_open_file,inputs[i],r_fid=afile
fids[i]=afile
endfor
numfiles=n_elements(fids)

if numfiles eq 4 then begin
;*******START MOSAIC
pos=[[0],[0],[0],[0]]

out_ps = [926.6254331, 926.6254331] ; This parameters are for 1000m
tiles.
use_see_through = [[1L],[1],[1],[1]]
see_through_val = [[0L],[0],[0],[0]]
bandnames=['1 km 16 days NDVI']
out_name='Mosaic_MOD13_'+strtrim(string(date,format='(I03)') ,
2)+'.img'

print, 'output_name = ' , out_name

georef_mosaic_setup, fids=fids, out_ps=out_ps, dims=dims, xsize=xsize,
ysize=ysize, x0=x0, y0=y0, map_info=map_info
envi_doit,'mosaic_doit', fid=fids, pos=pos, dims=dims, x0=x0, y0=y0,
background=0, out_dt=2, map_info=map_info, /georef, $
xsize=xsize, ysize=ysize, pixel_size=out_ps,
see_through_val=see_through_val, use_see_through=use_see_through,
out_name=out_name, r_fid=mosaic

;******REMOVE FIDS AND DELETE INPUTS
for i=0,numfiles-1 do begin
envi_file_mng, id=fids[i],/remove; ,/delete
endfor
endif
print,"C'est fini! It's done!!"
endfor

end
[Message index]
 
Read Message
Previous Topic: contour and points
Next Topic: kernel density estimator routine

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

Current Time: Wed Oct 08 16:08:36 PDT 2025

Total time taken to generate the page: 0.00255 seconds