18 |
# This is obtained from the report of all observations that the XSA makes to CDS, |
# This is obtained from the report of all observations that the XSA makes to CDS, |
19 |
# xsaobslog.txt (http://nxsa.esac.esa.int/ftp_public/cfs_obslog/xsaobslog.txt). |
# xsaobslog.txt (http://nxsa.esac.esa.int/ftp_public/cfs_obslog/xsaobslog.txt). |
20 |
# |
# |
21 |
# $Id: mlovccf,v 1.16 2016/09/19 12:36:15 ccflib Exp $ |
# $Id: mlovccf,v 1.17 2016/11/29 13:44:41 ccflib Exp $ |
22 |
|
|
23 |
# Next two lines allow to submit this script to the grid |
# Next two lines allow to submit this script to the grid |
24 |
# request Bourne shell as shell for job |
# request Bourne shell as shell for job |
185 |
exit |
exit |
186 |
fi |
fi |
187 |
|
|
|
# 2. Sets HEADAS depending on host or aborts in case of unexpected host |
|
188 |
# |
# |
189 |
|
# 2. Initialises HEADAS and SAS |
190 |
|
# |
191 |
|
|
192 |
|
# Defines HEADAS depending on host |
193 |
|
|
194 |
case "$host" in |
case "$host" in |
195 |
sasbld01|sasbld02) |
sasbld01|sasbld02) |
201 |
*) echo "Error: Unsupported host $host" ; exit 1 ;; |
*) echo "Error: Unsupported host $host" ; exit 1 ;; |
202 |
esac |
esac |
203 |
|
|
|
# W a r n i n g |
|
|
# |
|
|
# The SAS initialisation produced by setsas.sh sets SAS_CCFPATH to /ccf/pub. |
|
|
# Hence, if we set SAS_CCFPATH before running setsas.sh, we will always |
|
|
# use /ccf/pub as repository for CCF. This is right as long as /ccf/pub is in |
|
|
# strict sync with /home/ccflib/ccf_ftp/constituents. But if this is not true, |
|
|
# the resulting valid CCFs might be wrong. |
|
|
# |
|
|
|
|
|
headas_output=`. $HEADAS/headas-init.sh` |
|
204 |
|
|
205 |
if [ "$?" != "0" ] ; then |
headas_output="${VALID_CCF}/headas_output" |
206 |
echo "mlovccf: HEADAS initialisation failed with error" >> ${mailfile} |
source $HEADAS/headas-init.sh > ${headas_output} 2>&1 |
207 |
echo " ${headas_output}" >> ${mailfile} |
headas_ok=`cat ${headas_output}` |
208 |
|
|
209 |
|
if [ -n "${headas_ok}" ] ; then |
210 |
|
echo "mlovccf: HEADAS initialisation failed with error" >> ${mailfile} |
211 |
|
cat ${headas_output} >> ${mailfile} |
212 |
mailnotify "mlovccf: HEADAS initilisation failed" ${mailfile} |
mailnotify "mlovccf: HEADAS initilisation failed" ${mailfile} |
213 |
rm ${mailfile} |
rm ${headas_output} ${mailfile} |
214 |
exit 1 |
exit 1 |
215 |
fi |
fi |
216 |
|
|
220 |
echo -n "HEADAS version: " |
echo -n "HEADAS version: " |
221 |
fversion |
fversion |
222 |
|
|
223 |
confsas_output=`/sas/bin/confsas` |
# |
224 |
if [ -n "${confsas_output}" ] ; then |
# W a r n i n g o n S A S i n i t i a l i s a t i o n |
225 |
echo "mlovccf: SAS initialization failed with error" >> ${mailfile} |
# |
226 |
echo " ${confsas_output}" >> ${mailfile} |
# The SAS initialisation produced by setsas.sh sets SAS_CCFPATH to /ccf/pub. |
227 |
mailnotify "mlovccf: SAS initialisation failed" ${mailfile} |
# Hence, if we set SAS_CCFPATH before running setsas.sh, we will always |
228 |
rm ${mailfile} |
# use /ccf/pub as repository for CCF. This is right as long as /ccf/pub is in |
229 |
exit 1 |
# strict sync with /home/ccflib/ccf_ftp/constituents. But if this is not true, |
230 |
|
# the resulting valid CCFs might be wrong. Therefore, we set it here explicitly. |
231 |
|
# |
232 |
|
|
233 |
|
confsas_output="${VALID_CCF}/confsas_output" |
234 |
|
/sas/bin/confsas > ${confsas_output} 2>&1 |
235 |
|
confsas_ok=`cat ${confsas_output}` |
236 |
|
|
237 |
|
if [ -n "${confsas_ok}" ] ; then |
238 |
|
echo "mlovccf: SAS initialization failed with error" >> ${mailfile} |
239 |
|
cat ${confsas_output} >> ${mailfile} |
240 |
|
mailnotify "mlovccf: SAS initialisation failed" ${mailfile} |
241 |
|
rm ${confsas_output} ${mailfile} |
242 |
|
exit 1 |
243 |
fi |
fi |
244 |
|
|
245 |
source $HOME/setsas.sh 1> /dev/null |
source $HOME/setsas.sh 1> /dev/null |
246 |
|
|
247 |
|
# Re-sets SAS_CCFPATH |
248 |
|
|
249 |
export SAS_CCFPATH="/home/ccflib/ftp-area/constituents" |
export SAS_CCFPATH="/home/ccflib/ftp-area/constituents" |
250 |
|
|
251 |
echo "SAS Version: " |
echo "SAS Version: " |
252 |
sasversion -V 1 |
sasversion -V 1 |
253 |
export SAS_VERBOSITY=0 |
export SAS_VERBOSITY=0 |
254 |
|
|
255 |
|
|
256 |
# 3. XMM_CALINDEX file from SAS_CCFPATH |
# 3. XMM_CALINDEX file from SAS_CCFPATH |
257 |
|
|
258 |
MIF=`ls -1 ${SAS_CCFPATH}/XMM_CALINDEX_*.CCF` |
MIF=`ls -1 ${SAS_CCFPATH}/XMM_CALINDEX_*.CCF` |