File: print.sh

package info (click to toggle)
saods9 7.3.2%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 22,044 kB
  • ctags: 21,414
  • sloc: cpp: 66,406; tcl: 60,491; ansic: 19,507; sh: 9,996; xml: 1,375; makefile: 892; perl: 68
file content (101 lines) | stat: -rwxr-xr-x 1,840 bytes parent folder | download
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
echo
echo "*** print.sh ***"

echo "Starting DS9..."
if [ `xpaaccess ds9` = no ]; then
    ds9&

    i=1
    while [ "$i" -le 30 ]
	do
	sleep 2
	if [ `xpaaccess ds9` = yes ]; then
	    break
	fi

	i=`expr $i + 1`
    done
fi

doit() {
    echo $1
    xpaset -p ds9 psprint palette $2
    xpaset -p ds9 psprint level $3
    xpaset -p ds9 psprint filename ps/ds9-$4-$2-$3.ps
    xpaset -p ds9 psprint
}

rm -rf ps
mkdir ps

xpaset -p ds9 scale zscale
#xpaset -p ds9 psprint command '{gv -}'
xpaset -p ds9 psprint destination file
xpaset -p ds9 grid

if [ "$1" = "single" -o  -z "$1" ]; then
echo "Testing Single"

xpaset -p ds9 fits data/img.fits
xpaset -p ds9 regions load regions/ds9.fk5.hms.reg

doit "..RGB Level 3" rgb 3 b
doit "..CMYK Level 3" cmyk 3 b
doit "..Gray Level 3" gray 3 b

doit "..RGB Level 2" rgb 2 b
doit "..CMYK Level 2" cmyk 2 b
doit "..Gray Level 2" gray 2 b

doit "..RGB Level 1" rgb 1 b
doit "..Gray Level 1" gray 1 b

echo "PASSED"
fi

if [ "$1" = "mosaic" -o  -z "$1" ]; then
echo "Testing Mosaic"

xpaset -p ds9 mosaicimage iraf mosaic/mosaicimage.fits
xpaset -p ds9 regions load regions/ds9.mosaic.fk5.hms.reg

doit "..RGB Level 3" rgb 3 m
doit "..CMYK Level 3" cmyk 3 m
doit "..Gray Level 3" gray 3 m

doit "..RGB Level 2" rgb 2 m
doit "..CMYK Level 2" cmyk 2 m
doit "..Gray Level 2" gray 2 m
 
doit "..RGB Level 1" rgb 1 m
doit "..Gray Level 1" gray 1 m

echo "PASSED"
fi

if [ "$1" = "rgb" -o  -z "$1" ]; then
echo "Testing RGB"

xpaset -p ds9 rgb
xpaset -p ds9 rgbcube rgbcube/float.fits

doit "..RGB Level 3" rgb 3 r
doit "..CMYK Level 3" cmyk 3 r
doit "..Gray Level 3" gray 3 r

doit "..RGB Level 2" rgb 2 r
doit "..CMYK Level 2" cmyk 2 r
doit "..Gray Level 2" gray 2 r

doit "..RGB Level 1" rgb 1 r
doit "..Gray Level 1" gray 1 r

echo "PASSED"
fi

echo "DONE"

if [ -z "$1" ]; then
xpaset -p ds9 quit
fi