IDL批量处理---MOD04_L2

PRO MOD04L2_preprocessing    ;scale和 offset这两个存在的时候会在转换过程自动应用他们,所以处理的过程中出现找不到就是没有
  COMPILE_OPT idl2
  ENVI,/restore_base_save_files
  ENVI_BATCH_INIT

  inpath = 'F:\shiyan\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='F:\shiyan\MOD04_L2result\';输出目录,注意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 = 1   ;插值方式:双线性插值
    nan_fill = FLOAT('NaN');背景值使用NaN或者-1
    
    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

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值