I have one problem about IDL call function. convert_modis_data is a MODIS projective transformation provided by NASA. modis_conversion_toolkit.sav is placed at E:\ENVI\ENVI50\classic\save_add. The problem is that some MODIS data is unvaild(like MOD02HKM.A2015126.0340.006.2015126133248),Procedural error cant be jumped over by ‘catch’way,The program can not be carried out next cycle
. This affect work efficiency. so does anyone can know how to solve this peoblem?thanks
PRO BATCH_MOD02_Reproject_Li_hkm,ROOT_DIR,output_location
COMPILE_OPT IDL2
ENVI, /RESTORE_BASE_SAVE_FILES
ENVI_BATCH_INIT, LOG_FILE='BATCH.LOG'
PRINT, 'START : ',SYSTIME()
ROOT_DIR ='E:\test\MOD02HKM\'
output_location ='E:\test\MOD02HKM\'
FNS = FILE_SEARCH(ROOT_DIR,'*.hdf',COUNT = COUNT)
PRINT, 'There ara totally', COUNT,' images.'
;calib_method: 0-radiance,1-relfectance,2-radiance/??
calib_method = 1
;Output method schema is:
;0 = Standard, 1 = Projected, 2 = Standard and Projected
out_method = 1
;Use bow tie correction during the projection process
output_projection = envi_proj_create(/geographic)
FOR i = 0, COUNT-1 DO BEGIN
modis_l1b_file = FNS[i]
start= STRPOS(modis_l1b_file,'\',/reverse_search)
ends=STRPOS(modis_l1b_file,'.',/reverse_search)
output_rootname = strmid(modis_l1b_file,start,ends-start)+'reproject'
convert_modis_data, in_file=modis_l1b_file, out_path=output_location, $
out_root=output_rootname, /l1b, out_method=out_method, $
num_x_pts=50, num_y_pts=50, out_proj=output_projection, calib_method=calib_method,/bowtie, $
sd_pos=[1],/no_msg, background=0.0;sd_pos???????????????,??MCTK users guide??
ENDFOR
|