使用IDL对MODIS L1B数据进行几何校正。


1 下载mctk.sav文件

mctk工具非常便利地将原始HDF文件数据集分条目在列表中显示,打开hdf文件后,选择相应的数据集和投影方式,即可生成具有坐标投影信息的MODIS数据文件。点击mctk.sav工具下载mctk.sav文件。


2 配置mctk.sav文件

将mctk.sav拷贝至…\Exelis\ENVI51\extensions文件夹下面,运行ENVI5.1,点击主界面的Extensions文件夹,如果显示mctk则配置成功。

在这里插入图片描述


3 使用IDL进行校正

IDL代码如下:

Level 1B example
forward_function envi_proj_create
forward_function mctk_create_bridges
pro test_batch_modis_conversion_level_1b
  compile_opt IDL2
  
  t1=systime(1) ;获取程序开始运行的系统时间
  print, 'begin...'
  
  modis_l1b_file = 'E:\MOD03\MOD021KM.A2017244.0735.006.2017244214951.hdf'
  
  output_location = 'E:\MOD03-out\'

  output_rootname = 'level_1b'
  
  ;Calibration method schema is:
  ;0 = Radiance / Emissivity, 1 = Reflectance / Emissivity, 2 = Radiance / Brightness Temp
  calib_method = 1

  ;Output method schema is:
  ;0 = Standard, 1 = Projected, 2 = Standard and Projected
  out_method = 1
  
  output_projection = envi_proj_create(/geographic)
  ;output_projection = envi_proj_create(/geographic, datum='WGS-84')
  
  ;do not put the bridge creation/destruction code inside a loop
  bridges = mctk_create_bridges()

  ;Choosing linear interpolation
  interpolation_method = 0

  convert_modis_data, in_file = modis_l1b_file, out_path = output_location, $
    out_root = output_rootname, out_method = out_method, $
    interp_method = interpolation_method, $
    out_proj = output_projection, calib_method = calib_method, $
    sd_pos = [0, 1, 2, 3], /no_msg, background = 0.0, r_fid_array = r_fid_array, $
    r_fname_array = r_fname_array, bridges = bridges, msg = msg  
      
  mctk_destroy_bridges, bridges
  
  t2=systime(1)
  print,'耗时(min):',(t2-t1)/60.0

end

最后结果如下,左图为校正前的影像,右图为校正后的影像。

在这里插入图片描述
欢迎大家批评指正。

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐