File: pyds9-test

package info (click to toggle)
python-pyds9 1.8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 4,224 kB
  • sloc: ansic: 17,257; sh: 3,668; python: 701; makefile: 491; tcl: 219
file content (34 lines) | stat: -rwxr-xr-x 502 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
#!/bin/sh

#
# Just start a ds9 instance, load a file, try to access this file, and then
# quit.
#
cp test.fits "${ADTTMP}"
cd "${ADTTMP}"

xvfb-run --server-args="-screen 0 1024x768x24" python3 <<EOF
import time
import pyds9
d = pyds9.DS9('test')
time.sleep(1)
print(pyds9.ds9_targets())
d.set('file test.fits')
hdul = d.get_pyfits()
hdul.info()
hdul.writeto('test1.fits')
d.set('quit')
EOF

res=$?


ls -l

if [ $res = 0 ] ; then
    echo "All OK"
    exit 0
else
    echo "Failure"
    exit $res
fi