射电天文软件安装之SCHED

1. Install the supporting libs

sudo apt-get update
# zlib1g, #b字母后是数字1
sudo apt-get install libpng-dev zlib1g-dev gfortran libx11-dev 

2. Download and unzip the source file

#直接安装到 /bin -- 不推荐
cd /usr/local/bin
sudo mkdir sched_11.4
cd sched_11.4
sudo tar zxvf ~/Download/sched_11.4.tar.gz
cd src
# recommanded 
cd ~/software
mkdir sched
cd sched
tar zxvf ~/Download/sched_11.4.tar.gz
cd src

可以从ftp://ftp.aoc.nrao.edu/pub/sched 得到最新版本的sched软件源代码, 阅读sched在线用户手册http://www.aoc.nrao.edu/software/sched/.

3. Set up the environment variables: PGPLOTDIR, PGPLOTFONT, SCHED

# 1. PGPLOTDIR 是 pgplot 的 include 文件所在目录
whereis pgplot5  # /usr/lib/pgplot5
# if cannot find pgplot5, just  install it
sudo apt-get update
sudo apt-get install pgplot5
# 2. PGPLOTFONT 是 pgplot 的字体文件
cd /usr/lib/pgplot5
ls # grexec.f grfont.dat grpckg1.inc rgb.txt
# 3. SCHED是 sched 的根目录。

after finding out the path, set their env vars in .bashrc,

cd ~
gedit .bashrc

在.bashrc 文件末尾添加以下3行,保存后退出。

export PGPLOT_DIR=/usr/lib/pgplot5

export PGPLOT_FONT=/usr/lib/pgplot5/grfont.dat

make setting effective

source ~/.bashrc

4. Compile and install sched

# 1. go to the directory
cd sched
ls -F --color
# 2. read the README file, and modify the 'makefile' file
cp Makefile.master Makefile
vi Makefile

做以下修改(去掉这些行行首的注释):

line 26:ARCH=LINUX

line 53:FC= gfortran -Wall -fimplicit-none -fno-backslash

line 75:XLD= -L/usr/lib64 -lX11

line 99:PLOT_SRCS= $(wildcard Plot/.f) $(wildcard PlotNRAO/.f) # With PGPLOT

line 118:LPGPLOT= $(PGPLOT_DIR)

line 135:LDPGPLOT= -lpgplot -lpng -lz

line 160:JPL_SRCS= $(wildcard Jpl/*.f)

line 181:SAT_SRCS= $(wildcard Satstub/*.f)

line 182:SATLD=

# complie
make 

5. Run sched

# go to sched directory
cd ~/software/sched/bin
ls -f --color
# run it
./sched

in order to run the software everywhere, we can add the sched env vars in .profile

cd
gedit .profile
> # add sched
> export SCHED=/home/zhen/software/sched
> export PATH=$PATH:$SCHED/bin

alternatively, we can create a soft link of sched in /usr/bin directory

sudo ln -s /home/zhen/software/sched/bin/sched /usr/bin/sched

6. Use case

The sched software is run based on the configuration file *.key. These files can be found under the file /sched/examples/.

# 1. create a new runing file
cd ~/Desktop
mkdir sched_play
cd sched_play
# 2. copy a .key file, take vips11.key as an example.
cp ~/software/sched/examples/vips11.key
ls
# 3.1 get the result without GUi
sched < vips11.key
# 3.2 run sched with GUI plots
sched
> schedule=vips11.key
> plot
> /

References

[1]. http://www.aoc.nrao.edu/software/sched/

Table of Contents