#!/bin/csh -f
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# This file is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution. 
#*************************************************************************
source $EPICS_EXTENSIONS/bin/$EPICS_HOST_ARCH/idluserdir_setup
source $PVT_LOC/ezcaidl_setup

	set exe = "-rt=$PVT_LOC/sscan.sav"
	if -e sscan.sav then
	set exe = "-rt=sscan.sav"
	endif

# source /usr/local/rsi/idl_6.0/bin/idl_setup
echo $exe
if ( "$1" == "" ) then
	idl -32 $exe
exit
endif

set xdr = "DC"
while ( "$1" !=  "" )
if ( "$1" == "-A" | "$1" == "-a" | "$1" == "-Auto" ) then
        set xdr = 'DC,/autoscan'
        shift
endif

echo ".run ez_fit.pro" >! go_viewer
echo ".run sscan.pro" >>! go_viewer
echo ".run DC.pro" >>! go_viewer
echo ".run user_scan.pro" >>! go_viewer
echo "$xdr" >>! go_viewer
cat go_viewer
idl -32 go_viewer
rm go_viewer
