#!/bin/csh

# General script to start PIA
# Orig: Carlos GABRIEL (ESA/VILSPA-SAI)
#
# This command file contains the environment variables needed to 
# start the PHT-IA under UNIX, looks for a user environment variables
# file to overwrite some of the default values and finally starts IDL
# with the PIA startup procedure.
#
# There is just one line to be changed by the installation:
# containing the main PIA tree (the following)
#
#setenv PIA_LOC_GEN "/software/isosa1/any/src/pia/"
setenv PIA_LOC_GEN "/net/penca/iso_iac/pia62/"

set PIA_DATAP = $PWD/
set PIA_LOC_IND = $PWD/

# This part of the file contains the unix environment variables needed to 
# start the PHT-IA under Unix-IDL
#
# It is splitted into a general configuration, which could be 
# maintained at every site for all users and a local configuration, 
# which includes filesystems needing write permission, i.e. 
# individual user owned. The latter part can be overwritten by the user.
#
#
# General configuration starts here:
setenv PIA_TOP     $PIA_LOC_GEN
setenv PIA_DIR     $PIA_TOP/src/
setenv CALC        $PIA_TOP/calc/
setenv CALG        $PIA_TOP/calg/
setenv CALU        $PIA_TOP/calu/
setenv PIA_INCL    $PIA_TOP/incl/
setenv PIA_HTML    $PIA_TOP/html
setenv PIA_HELP    $PIA_TOP/help
# General configuration ends here:
#
# Now we provide an individual default configuration,
# any modification should be done by the user through a pia_envi file
# at $PIA_LOC_IND (by default ~/pia)
setenv FITDIR         $PIA_DATAP
setenv XDRDIR         $PIA_DATAP
setenv PIA_SERDIR     $PIA_DATAP
setenv CALSAVE        $PIA_DATAP
setenv PIA_SAVEDIR    $PIA_DATAP
setenv PIA_PRINTDIR   /tmp/
setenv F_ALLPERIGEE   $CALSAVE/ALL_PERIGEE.DAT
if $?PRINTER then 
  setenv PIA_PRINTER    $PRINTER
endif
setenv w3net   netscape
# Individual configuration ends here:


if ! $?PIA_LOC_IND  set PIA_LOC_IND = '~/pia'

if (-f $PIA_LOC_IND/pia_envi) then  
 source $PIA_LOC_IND/pia_envi
endif

cd $PIA_LOC_GEN
idl pia_start.scr
