#! /bin/csh 

set data = SIMuBgVriIzyJHK_p.cat.org
set ext = 0.8

gawk 'NR%1==0 && $13!=21.2 {print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13}' $data > temp

sm <<EOF #

data temp read{u 1 B 2 g 3 V 4 r 5 i 6 Ic 7 z 8 y 9 J 10 H 11 K 12}

set x = 10,30,2
set y23 = x**0+22
set y24 = x**0+23
set y25 = x**0+24
set y = 10,30,2
set x22 = y**0+21
set x23 = y**0+22
set x24 = y**0+23
set x25 = y**0+24

device postfile "fig.eps"

expand $ext lweight 2 ctype default
window 3 3 1 2 limits 20 26 20 25.8 ticksize 0 0 0.5 1  box 1 2
xlabel "CFHT-u"
ylabel "HSC-i"
expand 0.1
ctype blue ptype 10 3 points u i
ctype red  ltype 1 connect x y23 connect x y24 connect x y25
ctype red  ltype 1 connect x22 y connect x23 y connect x24 y connect x25 y
ctype red  ltype 0 lweight 4 connect x y

expand $ext lweight 2 ctype default
window 3 3 2 2 limits 20 26 20 25.8 ticksize 0 0 0.5 1  box 1 2
xlabel "HSC-g"
ylabel "HSC-i"
expand 0.1
ctype blue ptype 10 3 points g i
ctype red  ltype 1 connect x y23 connect x y24 connect x y25
ctype red  ltype 1 connect x22 y connect x23 y connect x24 y connect x25 y
ctype red  ltype 0 lweight 4 connect x y

expand $ext lweight 2 ctype default
window 3 3 3 2 limits 20 26 20 25.8 ticksize 0 0 0.5 1  box 1 2
xlabel "HSC-r"
ylabel "HSC-i"
expand 0.1
ctype blue ptype 10 3 points r i
ctype red  ltype 1 connect x y23 connect x y24 connect x y25
ctype red  ltype 1 connect x22 y connect x23 y connect x24 y connect x25 y
ctype red  ltype 0 lweight 4 connect x y

expand $ext lweight 2 ctype default
window 3 3 1 1 limits 20 25.8 20 25.8 ticksize 0 0 0.5 1  box 1 2
xlabel "Subaru-Ic"
ylabel "HSC-i"
expand 0.1
ctype blue ptype 10 3 points Ic i
ctype red  ltype 1 connect x y23 connect x y24 connect x y25
ctype red  ltype 1 connect x22 y connect x23 y connect x24 y connect x25 y
ctype red  ltype 0 lweight 4 connect x y

expand $ext lweight 2 ctype default
window 3 3 2 1 limits 20 25 20 25.8 ticksize 0 0 0.5 1  box 1 2
xlabel "VIKING-J"
ylabel "HSC-i"
expand 0.1
ctype blue ptype 10 3 points J i
ctype red  ltype 1 connect x y23 connect x y24 connect x y25
ctype red  ltype 1 connect x22 y connect x23 y connect x24 y connect x25 y
ctype red  ltype 0 lweight 4 connect x y

expand $ext lweight 2 ctype default
window 3 3 3 1 limits 16 24 20 25.8 ticksize 0 0 0.5 1  box 1 2
xlabel "VIKING-Ks"
ylabel "HSC-i"
expand 0.1
ctype blue ptype 10 3 points K i
ctype red  ltype 1 connect x y23 connect x y24 connect x y25
ctype red  ltype 1 connect x22 y connect x23 y connect x24 y connect x25 y
ctype red  ltype 0 lweight 4 connect x y

expand $ext lweight 2 ctype default
window 1 3 1 1:2 limits 0 1 0 1
rel 0.3 1.02 label "colors of HSC and other filters"
EOF
