Index: trunk/MagicSoft/Mars/datacenter/scripts/runstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 8690)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 8723)
@@ -19,4 +19,5 @@
 #
 #   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
+#   Author(s): Stefan Ruegamer 08/2007 <mailto:snruegam@astro.uni-wuerzburg.de>
 #
 #   Copyright: MAGIC Software Development, 2000-2007
@@ -28,7 +29,7 @@
 # 
 # As star takes some time, only one sequence is processed at once. 
-# First the script gets a sequence number from the database, for which 
+# First the script gets a sequence number from the database for which 
 # star has to be done (function gettodo). After setting the status in the 
-# database (set fStartTime to know, that the sequence is already being 
+# database (set fStartTime; to know that the sequence is already being 
 # processed), the image parameters are calculated for the sequence. 
 # Afterwards the status in the database is updated according to the return 
@@ -36,6 +37,6 @@
 # The important INFOs, WARNings and ERRORs are written not only to the 
 # scriptlog but also to the processlog. 
-# 
-# The star.rc file is taken from the Mars directory.
+#
+# The star.rc files are taken from the datacenter/setup/star directory
 #
 
@@ -77,6 +78,19 @@
 
 
-echo "./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile  2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
-./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile  2>> $scriptlog> /dev/null
+# define star.rc files
+starrcnew=$setuppath/$program/star.rc
+starrcmux=$setuppath/$program/star_mux.rc
+# link star.rc file
+echo "linking the star.rc file to $outpath" >> $scriptlog 2>&1
+if [ $sequence -gt 200000 ]
+then
+   ln -vsf $starrcmux $outpath/star.rc >> $scriptlog 2>&1
+else
+   ln -vsf $starrcnew $outpath/star.rc >> $scriptlog 2>&1
+fi
+starrcseq=$outpath/star.rc
+
+echo "./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile --config=$starrcseq 2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
+./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile --config=$starrcseq 2>> $scriptlog> /dev/null
 check1=$?
 
