首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IDL批处理:全自动输入选择

IDL批处理:全自动输入选择
EN

Stack Overflow用户
提问于 2015-04-08 20:08:32
回答 1查看 459关注 0票数 0

我需要处理MODIS海平面2的数据,我得到了ENVI https://github.com/dawhite/EPOC/releases的一个外部插件。现在,我想要批处理数百个图像,我修改了这些图像的代码,如下所示。代码运行得很好,但我每次都必须选择输入文件。有没有人能帮我把这个程序完全自动化?我真的很感谢你的帮助!

Pro OCL2convert

代码语言:javascript
复制
dir = 'C:\MODIS\'

CD, dir

; batch processing of level 2 ocean chlorophyll data


files=file_search('*.L2_LAC_OC.x.hdf', count=numfiles)

; this command will search for all files in the directory which end with 
; the specified one

counter=0 

; this is a counter that tells IDL which file is being read-starts at 0

While (counter LT numfiles) Do begin

; this command tells IDL to start a loop and to only finish when the counter 
; is equal to the number of files with the name specified

   name=files(counter)
   openr, 1, name

   proj = envi_proj_create(/utm, zone=40, datum='WGS-84')
   ps = [1000.0d,1000.0d]
   no_bowtie = 0 ;same as not setting the keyword
   no_msg = 1 ;same as setting the keyword

   ;OUTPUT CHOICES
   ;0 -> standard product only
   ;1 -> georeferenced product only
   ;2 -> standard and georeferenced products

   output_choice = 2

   ;RETURNED VALUES
   ;r_fid -> ENVI FID for the standard product, if requested
   ;georef_fid -> ENVI FID for the georeferenced product, if requested

   convert_oc_l2_data, fname=fname, output_path=output_path, $
      proj=proj, ps=ps, output_choice=output_choice, r_fid=r_fid, $
      georef_fid=georef_fid, no_bowtie=no_bowtie, no_msg=no_msg   

   print,'done!'
   close, 1
   counter=counter+1
Endwhile

结束

EN

回答 1

Stack Overflow用户

发布于 2015-04-10 23:10:00

由于不知道convert_oc_l2_data做了什么(它似乎是您创建的程序,没有关于它的公共文档),我想说问题可能是out_path变量没有在程序的其余部分中定义。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29514188

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档