搜索此博客

2017年12月13日星期三

IDL调用插件中的函数(以IDL调用MCTK为例)

方法1:将扩展工具放在ENVI Classic安装路径(save_add)中,保证ENVI Classic能够正常使用此扩展工具。然后在IDL中启动ENVI Classic之后,便可以调用,如Fig. 1要求。
Fig. 1

方法2:在IDL代码中 restore, xxxxx.sav ,然后就可以调用这个sav文件中的接口了。

IDL调用MCTK实例:

;+
; Author: Baikal
;-
; Time: Nov 29,2017
;
Pro test_batch_modis_conversion_MOD02
  compile_opt idl2

  ;restore,'D:\Program Files\Exelis\ENVI53\classic\save_add\mctk.sav'
  ENVI,/restore_base_save_files
  ENVI_Batch_Init

  mod02_file = 'G:\2016.06.MOD\MOD02\1Source Data\201606\MYD02HKM.A2016153.1920.006.2016154155642.hdf'
  output_location = 'G:\2016.06.MOD\MOD02\2Layer Stacking\'
  output_rootname = '2016154155642'

  ;Output method schema is:
  ;0 = Standard, 1 = Projected, 2 = Standard and Projected
  out_method = 1

  ;Calibration method schema is:
  ;0 = Radiance / Emissivity, 1 = Reflectance / Emissivity, 2 = Radiance / Brightness Temp
  ;Set Projection
  output_projection =  ENVI_proj_create(/geographic)

  ;Calibration method schema is:
  ;0 = Radiance/Emissivity,1 = Reflectance/Emissivity,2 = Radiance/Brightness Temperature
  Calib_Method = 1

  ;Choosing linear interpolation
  interpolation_method = 0

  ;Note:Do not put the bridge creation/destruction code inside a loop
  bridges = mctk_create_bridges()
  convert_modis_data, in_file = mod02_file, $
    out_path = output_location, out_root = output_rootname, $
    out_method = out_method, $
    out_proj = output_projection, $
    Calib_Method = Calib_Method, $
    SD_POS = [0,1], $
    interp_method = interpolation_method, $
    bridges = bridges, $
    /progress
  mctk_destroy_bridges, bridges

end


参考链接:
我在ArcGIS知乎上的提问:http://zhihu.esrichina.com.cn/question/19143

2 条评论:

  1. 用了作者的代码,加自己的名字。。不太好吧

    回复删除
    回复
    1. 哦,只是说这一段代码是自己写的,并不是盗用Devin White的意思啊。

      删除

LibSVM Chinese Brief Infroduction

Reference: [1]  https://blog.csdn.net/v_july_v/article/details/7624837 [2]  https://wenku.baidu.com/view/c402e983336c1eb91b375d37.html?fr...

  • Word (2)