IDL-MTCK

MCTK批处理MODIS 09A1产品
MCTK批处理MODIS L2 swath产品
MODIS批量处理,知乎
MODIS批量处理,CSDN
请添加图片描述

;头
pro modis_mctk_try

 compile_opt idl2
  e = envi()
  envi, /restore_base_save_files
  envi_batch_init, log_file='batch.txt'

;选择需要批处理文件所在的文件夹
  fn= dialog_pickfile(title="open the mod04 data",/directory) ;打开数据目录
  outpath = 'D:\data\data1\' ;输出路径
  files=file_search(fn,"*.hdf",count=nums)
  bridges = mctk_create_bridges()
  
;方法1
 inpath = 'D:\data\data1\'
  files = file_search(inpath,"*.hdf",count=nums)
  outpath = 'D:\data\data1\' ;输出路径
  PRINT, '开始处理数据 : ', SYSTIME()

;方法2
  inpath = Dialog_pickfile(/directory, title='Select MOD files inputpath')
  cd, inpath
  filenames = file_search('*.hdf')
  n = N_elements(filenames)
  print, n
  ;选择处理后文件另存的文件夹位置
  outpath = Dialog_pickfile(/directory, title='Select MOD_Geo files outpath')
  PRINT, '开始处理数据 : ', SYSTIME()

完整

pro modis_mctk
  compile_opt idl2
  e=envi(/headless)
  
  fn= dialog_pickfile(title="open the mod04 data",/directory) ;打开数据目录
  output_location = 'D:\data\data1\' ;输出路径
  files=file_search(fn,"*.hdf",count=nums)
  bridges = mctk_create_bridges()
  
  for i=0,nums-1 do begin ;每一个影像进行处理
    modis_swath_file=files[i]
    basename=file_basename(files[i]) ;获取输入影像文件名
    output_rootname=strmid(basename,0,32) ;获取指定范围名字
    swath_name = 'mod04';这个值自己根据自己数据设置,用hdfviewer打开后,会显示
    sd_names = ['AOD_550_Dark_Target_Deep_Blue_Combined'] ;;这是数据集名称,是一个字符串数组
    ;  以下参数需要自己去看文档,一般保持不变 。官方地址:https://github.com/dawhite/MCTK
    out_method = 1
    output_projection = envi_proj_create(/geographic)
    interpolation_method = 0
    print,output_rootname
    
    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, $
      interp_method=interpolation_method, /no_msg, $
      r_fid_array=r_fid_array, r_fname_array=r_fname_array, $
      bridges=bridges, msg=msg
  endfor
  mctk_destroy_bridges, bridges
end
  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值