Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

IDL command line and workbench

There are two primary ways of using IDL: the command line (CLI*) and the Workbench (WB). The CLI allows direct access to the IDL interpreter. The WB is a separate program that sits on top of IDL and provides a slew of organizing, editing and debugging tools for working with IDL.

两种使用 IDL 的主流方法:命令行 CLI 和 GUI。命令行可以直接访问 IDL 编译器,GUI 是架构在 IDL 之上提供一系列组织,编辑调试工具。

CLI 和 GUI 的优缺点如下:

CLI Pros:

  1. Lightweight. 轻量级
  2. Fast. The CLI provides direct access to the IDL interpreter. 速度快

CLI Cons:

  1. Limited shell-like support; e.g., no color syntaxing, command completion or keybinding definition. (However, see rIDL.)
  2. An external editor is needed to develop and debug code. (For many, this may not be a negative.)

WB Pros:

  1. Integrated editor with command completion, color syntaxing, code formatting and code templates.
  2. Projects for organizing files and controlling IDL’s path.
  3. A consistent interface across platforms supported by IDL (Windows, Mac OS X, Linux).

WB Cons:

  1. The WB is built on Eclipse, which is a big, complex Java application. As the size and complexity of an application grows, the likelihood of bugs grows, as well.
  2. the Outline view for jumping between programs in a file, and
  3. the Open Resource dialog for opening files.

参考文献

IDL 批处理

Batch processing with IDL

1
$ nohup nice $IDL_DIR/bin/idl < in.pro > out.txt 2> err.txt &

in.pro

1
2
3
4
5
6
print, 'Job started'
n = 100
task1, n
;task2
;task3
print, 'Job complete'

task1.pro

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pro task1, n
compile_opt idl2

if n eq !null then n = 100

x = findgen(n)
p = plot(x, /buffer, title='Plot #000')
p.save, 'plot000.png', resolution=96

for i=1, n-1 do begin
si = string(i, format='(i3.3)')
p.title = 'Plot #' + si
p.setdata, x + i
p.save, 'plot' + si + '.png', resolution=96
endfor

p.close
end

参考文献论坛参考

mixed batch without window

1
$ idl <in.pro >out.txt 2>err.txt

in.pro

1
2
3
print, 'job started'
example_envi_batch_status_window
print, 'job complete'

example_envi_batch_status_window.pro

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
pro example_envi_batch_status_window

compile_opt IDL2

; First restore all the base save files.
envi, /restore_base_save_files

; Initialize ENVI and send all errors
; and warnings to the file batch.txt
envi_batch_init, log_file='batch.txt'

; Open the input file
envi_open_file, 'bhtmref.img', r_fid=fid

if (fid eq -1) then begin
envi_batch_exit
return
endif

; Get the dimensions and # bands
; for the input file.
envi_file_query, fid, dims=dims, nb=nb

; Set the pos to calculate
; statistics for all data (spectrally)
; in the file.
pos = lindgen(nb)

; Calculate the basic statistics and
; print the mean.

envi_batch_status_window, /off
envi_doit, 'envi_stats_doit', fid=fid, pos=pos, $
dims=dims, comp_flag=1, mean=mean

print, 'Mean', mean

; Turn off the status window and do the same

envi_batch_status_window, /off

; Calculate the basic statistics and
; print the mean.
envi_doit, 'envi_stats_doit', fid=fid, pos=pos, $

dims=dims, comp_flag=1, mean=mean

print, 'Mean', mean

;

; Exit ENVI

;

envi_batch_exit

end

参考文献Executive Commands

A list of other resource

  1. 剑桥大学 Vasily BelokurovIDL教程
  2. Developer of rIDL & IDLdocMichael Galloy
  3. Coyote’s guide to IDL

IDL安装

Linux 系统 IDL88/ENVI56安装

安装ENVI/SARSCAPE

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
├── envi56
│ ├── envi56-linux.tar.gz
│ ├── ENVILicense_20210815.sav
│ └── install.sh
├── l_opencl_p_18.1.0.015
│ ├── install_GUI.sh
│ ├── install.sh
│ ├── license.txt
│ ├── pset
│ ├── PUBLIC_KEY.PUB
│ ├── rpm
│ └── silent.cfg
└── sar56
├── install.sh
├── SARscape
├── SARscape_5.6.tgz
├── SARscapeLicense_20210815.sav
└── SARscape_linux_v560.tgz

安装 envi56

1
2
3
4
cd envi56
sudo ./install.sh

# 一路 y 默认安装完毕

[option] libtinfo.so error when launching ENVI 5.6/IDL 8.8 on Linux

1
2
3
sudo apt install libtinfo5

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/local/harris/idl88/bin/bin.linux.x86_64/libtinfo.so.5

reference harris

安装 sarscape

sarscape 安装需要 opencl,这个比较麻烦后面单独说

1
sudo ./install.sh /usr/local /usr/local/harris/envi56

安装 opencl

OPENCL 分 INTEL 和 AMD 处理器,根据 sarscape 官网说明,需要分别安装,这里先说 INTEL 处理器的安装过程:

INTEL

因特尔的opencl sdk CPU和GPU是分开的,需要先安装基于CPU的SDK,再安装基于GPU的 sdk

  1. 安装一个clinfo的软件可以看到服务器上目前支持的OpenCL设备
1
sudo apt install clinfo

NVIDIA缺失的库安装,使得基于NVIDIA的cl设备能够正常使用

1
2
sudo apt install ocl-icd-libopencl1
sudo apt install opencl-headers

安装lsb-core,opencl sdk依赖于这个库

1
sudo apt install lsb-core
  1. CPU opencl SDK安装参考官网手册:官网链接,下载链接: OpenCL SDK (已下载 ENVI56/LINUX/opencl_p_18.1.0.015.tar.gz )

进入到l_opencl_p_18.1.0.015目录下,

1
sudo ./install_GUI.sh

测试

1
2
3
4
5
6
7
8
9
10
11
liupei@T470:~/Downloads/linuxENVI$ clinfo 
Number of platforms 2
Platform Name Intel(R) CPU Runtime for OpenCL(TM) Applications
Platform Vendor Intel(R) Corporation
Platform Version OpenCL 2.1 LINUX
Platform Profile FULL_PROFILE

Platform Name NVIDIA CUDA
Number of devices 1
Device Name GeForce 940MX
Device Vendor NVIDIA Corporation

参考文献:Huo的藏经阁, Joey’s Note

  1. GPU SDK安装

intel 的GPU opencl 是基于 Graphics Runtime,其相关安装文件在github中,Intel Graphics

目前用不是没有装,而且上一部后好像能找到 GPU platform

AMD

还没有装,好像很麻烦,因为 sarscape帮助文件所 几点几 之后就不开发了。。。

参考文献:1

激活

由于申请的试用版的,激活不是通过 license manager,而是通过 idl virtual machine

1
2
3
4
5
6
sudo /usr/local/harris/envi56/idl88/bin/bin.linux.x86_64/idl -vm

# 如果上面的打不开,经测试下面的也可以
sudo /usr/local/harris/envi56/idl88/bin/idl -vm

分别选择申请到的 ENVI license.sav 和 sarscape license.savi

linux 系统 IDL8.3/ENVI5.1 安装

安装程序

安装路径:手动输入刚刚建立的/usr/local/exelis目录

1
2
3
4
sudo mkdir /usr/local/exelis
sudo chmod 777 /usr/local/exelis/
tar zxvf idl83envi51linux.x86_64.tar.gz
sudo ./install.sh

选项都选y,除了让DICOM开机启动选择n。

破解

把两个库文件解压,如果rpm2cpio没有就先安装

1
2
3
4
sudo apt install rpm2cpio

rpm2cpio libidn11-1.34-lp152.3.6.x86_64.rpm | cpio -idmv
rpm2cpio libXp-1.0.3-2.fc29.x86_64.rpm | cpio -idmv

然后进入解压出来的目录usr/lib64,里面有4个文件libidn.so.11,libidn.so.11.6.8,libXp.so.6,libXp.so.6.2.0,全cp到程序目录中

1
sudo cp * /usr/local/exelis/idl83/bin/bin.linux.x86_64

运行ifconfig,查看网卡名,我的网卡是enp5s0,运行以下代码修改网卡mac

1
sudo ifconfig enp5s0 hw ether 08:9e:01:ba:03:4b

记得每次开机都要运行一次

运行hostname,查看自己电脑名

1
hostname

在上面license.dat中修改
SERVER hostname 089e01ba034b 1700
这一行中的hostname为自己电脑名,编辑完毕cp license.dat文件

1
sudo cp license.dat /usr/local/exelis/license/

运行程序

1
idl

破解等一键运行

startidl.sh

1
alias sidl='/usr/local/exelis/idl/startidl.sh'
1
2
3
4
5
6
7
liupei@T470:/usr/local/exelis/idl$ cat startidl.sh 
#!/usr/bin/bash
sudo ifconfig enp0s31f6 hw ether 08:9e:01:ba:03:4b
cd /usr/local/exelis/idl83/bin/
./lmgrd &
cd ~
idl
1
sudo ifconfig enp5s0 hw ether f0:2f:74:df:4f:30

可能出现的错误

提示未破解

就运行lmgrd

1
2
cd /usr/local/exelis/idl83/bin/
./lmgrd

如果提示,error: “lmgrd: not found”,

  • for ubuntu 安装lsb-core
1
sudo apt install lsb-core
  • for manjaro
1
yay -S lmgrd

参考文献:

  1. CSCD安装博客 here
  2. 官方帮助 here
  3. LINUX IDL 8.4安装

envi47安装

首先在/usr/local下建立文件夹itt, then

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sudo mkdir /usr/local/itt/
tar -xzvf envi47linux.tar.gz .
cd envi47linux
tar -xzvf envi47linux.x86.tar.gz /usr/local/itt/

cd /usr/local/itt/
sudo ./install

sudo cp ENVI7.0license.dat /usr/local/itt/license/
sudo mv ENVI7.0license.dat license.dat
sudo dpkg -i libxp6_1.0.2-1ubuntu1_i386.deb
sudo dpkg -i libxp6_1.0.2-1ubuntu1_amd64.deb

sudo apt install libxinerama1:i386 libexpat1:i386
sudo apt-get install libxpm4:i386
sudo apt-get install libxmu6:i386

评论