[fitsbits] Re: conversion fits -> gif

Uwe Lammers ulammers at rssd.esa.int
Thu Nov 21 06:57:12 EST 2002


HL wrote:
> Yes ds9 does it very nicely (with proper color scaling), but unfortunately
> not in batch mode.
> This is also true for  xv.
> 
> "> The latest ds9-2.2 allows to save (FITS) images as jpeg, tiff, png, or
> ppm
> 
>>(File->Save as->Image...) to disk (this needs gs>=6.5 in the PATH). From
>>there one can go to gif with e.g. xv.
>
ds9 can be nicely scripted via the XPA mechanism (see
http://hea-www.harvard.edu/RD/xpa/ for details). So you could do something
along the following lines:

#/bin/sh
[ $# -ne 2 ] && echo "Usage: $0 fitsfile giffile" && exit 1
ds9 -iconify $1 &
sleep 2 # wait for ds9 to come up
echo "print destination file"|xpaset ds9
echo "print filename $1.ps"|xpaset ds9
echo "print"|xpaset ds9
echo "exit" |xpaset ds9
gs -sDEVICE=gif -sOutputFile=$2 -dBATCH $1.ps </dev/null && rm -f $1.ps

Because ds9 awlays needs an X11 display (the -iconfiy option above just
causes it to come up iconified) this is still no true 'batch' mode but
if you have an X11 session going anyway this is useful already.

Uwe




More information about the fitsbits mailing list