#!/bin/csh

source $EPICS_EXTENSIONS/bin/$EPICS_HOST_ARCH/idluserdir_setup

#source /usr/local/rsi/idl_6.0/bin/idl_setup
#if ( $1 == "readascii") then
#source /usr/local/rsi/idl_6.2/bin/idl_setup
#endif

set ARCH=$EPICS_HOST_ARCH
if $ARCH == "" then
    ARCH=$HOST_ARCH
endif
set LOC=$EPICS_EXTENSIONS 
if ${?EPICS_EXTENSIONS_PVT} == 1 then
	set LOC=$EPICS_EXTENSIONS_PVT
endif

if ($1 == "mca") then
   source $LOC/bin/$ARCH/ezcaidl_setup
   setenv XRF_PEAK_LIBRARY $LOC/idllib/xrf_peak_library.txt
   setenv MCA_HELP_COMMAND 'netscape -remote "openURL(cars.uchicago.edu/software/mca.html)"'
   echo run $LOC/bin/$ARCH/$1.sav
   idl -32 -vm=$LOC/bin/$ARCH/$1.sav
   exit
endif

if ($1 == "scanSee" || $1 == "catcher" || $1 == "sscan") then
   source $LOC/bin/$ARCH/ezcaidl_setup
   echo run $LOC/bin/$ARCH/$1.sav
   idl -32 -vm=$LOC/bin/$ARCH/$1.sav
   exit
endif


if $1 == "" then
   idl -32 -vm
else
   echo run $LOC/bin/$ARCH/$1.sav
   idl -vm=$LOC/bin/$ARCH/$1.sav
endif
