#!/bin/csh -f
# an example of script to produce MFS continuum image
# from calibrated SMA data.
# invert, clean, restor and cgdisp
# jhz 2005-02-02 
goto continue
continue:
#make dirty map
\rm -r sgra-star.map sgra-star.beam sgra-star.icmp
invert vis=sgra.selfcal map=sgra-star.map \
	beam=sgra-star.beam \
	imsize=512,512 cell=.2 sup=0 options=mfs,sdb,systemp \
	line=channel,6,1,4 
#clean map
mfclean map=sgra-star.map beam=sgra-star.beam \
	out=sgra-star.icmp gain=0.1 \
	cutoff=0 niters=1500 region='boxes(200,200,312,312)'
\rm -r sgra-star.icln
#restore the image with a gaussian beam
restor model=sgra-star.icmp beam=sgra-star.beam map=sgra-star.map \
	out=sgra-star.icln 
#display the image
cgdisp in=sgra-star.icln type=pixel region=quarter xybin=2 device=/xs \
	nxy=1 labtyp=hms,dms options=full,beambr,wedge,fiddle,trlab \
	range=0,0,lin,2 csize=1,1,0.8
#do statistics in an area off the source
imstat in=sgra-star.icln region='boxes(10,10,30,30)' \
	axes=ra,dec 
#do statistics in an area on the source
imstat in=sgra-star.icln region=quarter \
        axes=ra,dec
#make a contore map
cgdisp in=sgra-star.icln type=c region=arcsec,'boxes(-15,-15,15,15)' \
	xybin=1 device=/xs nxy=1 labtyp=arcsec,arcsec \
        range=0,0,lin,2 \
	options=full,beambr,wedge,trlab csize=1,1,0.8 \
	slev=a,0.01 levs1=-5,3,4,6,9,13,18,24,31,41,51,71,91.100,150,300 

cgdisp in=sgra-star.icln type=c region=arcsec,'boxes(-15,-15,15,15)' \
        xybin=1 device=sgra.ps/vps nxy=1 labtyp=hms,dms \
        range=0,0,lin,2 \
        options=beambr csize=1,1,0.8 \
        slev=a,0.01 levs1=-5,3,4,6,9,13,18,24,31,41,51,71,91.100,150,300 
exit