idl源码
Ⅰ ENVI 和IDL
,写的确实太乱,很多错误。建议:按照规范程序入门,比如ENVI标准程序格式来操作,入门会容易一点儿。
按照别人的博客写法,有的时候为了某种效果而不规范,建议学习基础后再参考博客。
比如ENVI在math_doit(波段运算调用接口函数)的帮助中,有example,稍微修改下就可以了。
附修改结果,因无数据文件夹,故未详细调试,编译无错误,运行应该没问题。
1. pro vgt_ndvi_extract
2.
3. ;
4. ; First restore all the base save files.
5. ;
6. envi, /restore_base_save_files
7. ;
8. ; Initialize ENVI and send all errors
9. ; and warnings to the file batch.txt
10. ;
11. envi_batch_init, log_file='batch.txt'
12. ;
13. ; Open the input file
14. ;
15. ndvi_dir='G:\Data\xinjiang'
16. filenames=file_search(ndvi_dir,'*.img',count=numfiles)
17. ;
18. ; Set the keywords. We will perform the
19. ; band math on all samples in the file.
20. ;
21. for i=0,numfiles-1 do begin
22. nfilename=filenames
23. envi_open_file,nfilename,r_fid=fid
24. envi_file_query, fid, dims=dims
25. t_fid = [fid]
26. pos = [0]
27. exp = 'b1*0.004-0.1'
28. out_name = ndvi_dir +'\' +file_baseName(nfilename)+'_bandmath.img'
29. ; newfile=ndvi_dir +'\' +strmid(nfilename)
30. ; Perform the band math processing
31. ;
32. envi_doit, 'math_doit', $
33. fid=t_fid, pos=pos, dims=dims, $
34. exp=exp, out_name=out_name
35. envi_file_mng, id=fid, /remove
36. endfor
37.
38.
39. ; Exit ENVI
40. ;
41. envi_batch_exit
42.
43. end
复制代码
参考http://bbs.esrichina-bj.cn ENVI/IDL技术版
Ⅱ idl 读取hdf 字段,比如我要读取他的波段信息,如波段数、波段名字等
看看这个源码,/idldir/examples/doc/sdf/hdf_info.pro,可以读取hdf所有字段的。
Ⅲ idl打开sav文件出现错误怎么办
SAV文件是IDL特有的文件类型,自IDL6.0版本起,可以将IDL的程序、函数、对象或数据保存在SAV文件中,通过SAV文件可以方便的分享程序功能或者数据。
跟通常我们看到的exe或dll文件类似,sav只能用,无法打开看到源码。
Ⅳ 用IDL语言写出hist_equal函数的运算原理,拜托了!!!!
你在idl命令行输入 .compile hist_equal IDL提供了源码
Ⅳ 有前辈对比过IDL和Python的速度吗,哪个会快点
您好,很高兴为您解答:
IDL的语法类似fortran,数据处理上相对较弱,许多算法就是用IDL源码现编译的(IDL目录下就有这些源码),没经过优化,速度上赶不上其他语言,计算精度上跟大名鼎鼎的MATLAB都不知道差了多少截
不过NB就在画图上,很容易生成高质量的PostScript矢量图,毕竟人是拿图像吃饭的……它的衍生产品ENVI是用来做GIS(地理信息系统)的。
如果我的回答没能帮助您,请继续追问。