#! /bin/tcsh -f

if ($ctrl_fulldet == 0) then
 echo "BEGIN CLEAN_MAKE_DETECTION_DIR_3XMM.CSH"
 echo start: `date`
 source $progr_dir/clean_make_detection_dir_3XMM.csh >>& $log_dir/analysis.log
 echo end: `date`
 echo "END CLEAN_MAKE_DETECTION_DIR_3XMM.CSH"

 echo "BEGIN MAKE_IMAGE.CSH"
 echo start: `date`
 source $progr_dir/make_image.csh >>& $log_dir/analysis.log 
 echo end: `date`
 echo "END MAKE_IMAGE.CSH"

 set ExpDetectPrep = $result_dir/$dir0/detection/ExpDetectPrep
 if ( -r $ExpDetectPrep) then
  echo "ATTENTION: $ExpDetectPrep already exists" 
 else
  mkdir $ExpDetectPrep
 endif

 echo "BEGIN EXP_DETECT_PREP_MERGE_EVT_LIST_3XMM.CSH"
 echo start: `date`
 source $progr_dir/ExpDetectPrep_merge_evt_list_3XMM.csh >>& $log_dir/analysis.log
 echo end: `date`
 echo "END EXP_DETECT_PREP_MERGE_EVT_LIST_3XMM.CSH"
    
 set ctrl_fulldet = 1
endif
