MCTK批处理MODIS L2 swath产品

前言

ENVI+IDL版本:5.3
MCTK版本:V2.1.10
PS:
从2.0.0版本开始,MCTK使用完全相同的多线程、严格的swath投影引擎作为EPOC和VCTK,自动执行bowtie校正和支持所有三种标准插值方法,所以取消了以前版本keywords中的/bowtie。而且插值方法keywords不再是7.8.9而是对应着0.1.2。
(更多有关版本特点和keywords的详细介绍可参见:User’s Guide)
官方下载地址https://github.com/dawhite/MCTK/releases

IDL代码

pro MCTK_batch
  compile_opt idl2
  e = envi()
  envi, /restore_base_save_files
  envi_batch_init, log_file='batch.txt'
 
  ;选择需要批处理文件所在的文件夹
  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()
  ;导出
  bridges = mctk_create_bridges()
  FOR i = 0, n-1  DO BEGIN

    MODfilename = inpath+filenames[i]

    filename = filenames[i]
    
    print,filename
    
    out_name = STRMID(filename, 0, strlen(filename) - 4)+'_1000mLST'
    
    swath_name  = 'MOD_Swath_LST'
    sd_names   = ['LST']
    Params = [6378137.0,6356752.3,0.00000000,105.00000,0.0000000,0.00000000,25.0000000,47.000]
    name = 'Albers'
    datum = 'WGS84'
    units = envi_translate_projection_units('meters')
    output_projection = envi_proj_create(name=name,datum=datum,params=params,type=9)
    ;以上是根据我个人需要设置的输出投影:Albers
    ;Output method schema is:
    ;0 = Standard, 1 = Reprojected, 2 = Standard and reprojected
    out_method = 1
    ;INTERP_METHOD 0 — Nearest neighbor 1 — Bilinear 2 — Cubic convolution
    ;The values of 6, 7, and 8 that were used in the original API are no longer valid.
    interpolation_method = 1 
    ;background = NAN
    nan_fill = float('NaN')
    
    ;这里调用了MTCK
     convert_modis_data,in_file=MODfilename,out_path=outpath,$
     out_root=out_name,swt_name=swath_name,sd_names=sd_names,$
     out_method=out_method,out_proj=output_projection,$
     background=nan_fill,/no_msg,bridges=bridges,interp_method=interpolation_method
  ENDFOR
  mctk_destroy_bridges, bridges
  PRINT, '处理完成 : ', SYSTIME()
  envi_batch_exit
end

处理结果

在这里插入图片描述
在这里插入图片描述

  • 5
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 11
    评论
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值