PRO MOD04L2_preprocessing;scale和 offset这两个存在的时候会在转换过程自动应用他们,所以处理的过程中出现找不到就是没有
COMPILE_OPT idl2
ENVI,/restore_base_save_files
ENVI_BATCH_INIT
inpath = 'D:\DATA\mod04_L2\';输入路径,注意L2后面斜杠不可少
CD,inpath
filenames = FILE_SEARCH('*.hdf',COUNT=n)
PRINT,'there are totally',n,'images.'
PRINT, '开始处理数据 : ', SYSTIME()
bridges = mctk_create_bridges()
FOR i=0,n-1 DO BEGIN
modis_swath_file = inpath+filenames[i]
filename = filenames[i]
PRINT,filename
output_location='D:\mod04_L2\';输出目录,注意L2后面斜巷
output_rootname = STRMID(filename, 0, 23)
swath_name = 'mod04'
sd_names=['AOD_550_Dark_Target_Deep_Blue_Combined'];需要提取的波段名称,大小写一一对应,自己打开hdf格式文件注意看,别写错
out_method = 1
output_projection = ENVI_PROJ_CREATE(/geographic)
interpolation_method = 0
nan_fill = FLOAT('NaN');背景值使用NaN
convert_modis_data, in_file=modis_swath_file, $
out_path=output_location, out_root=output_rootname, $
swt_name=swath_name, sd_names=sd_names, $
out_method=out_method, out_proj=output_projection, $
r_fid_array=r_fid_array, r_fname_array=r_fname_array,$
interp_method=interpolation_method, background=nan_fill,$
/no_msg
PRINT,output_rootname
ENDFOR
mctk_destroy_bridges, bridges
PRINT, '处理完成 : ', SYSTIME()
ENVI_BATCH_EXIT
END