/[CCFs]/bin/mlovccf
ViewVC logotype

Diff of /bin/mlovccf

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by ccflib, Mon Sep 7 13:39:15 2015 UTC revision 1.10 by ccflib, Mon Mar 21 15:36:25 2016 UTC
# Line 7  Line 7 
7  # typically the current date. This list will change with time as far as new  # typically the current date. This list will change with time as far as new
8  # CCFs are issued to deal with new calibration data and/or replace obsolete ones.  # CCFs are issued to deal with new calibration data and/or replace obsolete ones.
9  #  #
10  # To identify the set of CCFs required to process a given ODF is the ijob of task cifbuild.  # To identify the set of CCFs required to process a given ODF is the job of task cifbuild.
11  # To make such identification, cifbuild needs only the start time of the observation.  # To make such identification, cifbuild needs only the start time of the observation.
12  # Therefore, if we provide a list of all observed ODFs at a given date together with their  # Therefore, if we provide a list of all observed ODFs at a given date together with their
13  # respective start time, we could compute all the CCFs required to process them.  # respective start time, we could compute all the CCFs required to process them.
# Line 16  Line 16 
16  #  #
17  # We need as input the list of all observed ODFs at a given date.  # We need as input the list of all observed ODFs at a given date.
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 (ftp://nxsa.esac.esa.int/pub/cfs_obslog/xsaobslog.txt).  # xsaobslog.txt (http://nxsa.esac.esa.int/ftp_public/cfs_obslog/xsaobslog.txt).
20  #  #
21  # $Id: mlovccf,v 1.7 2015/08/27 16:47:16 ccflib Exp $  # $Id: mlovccf,v 1.9 2016/03/18 09:18:29 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
25  #$ -S /bin/bash  #$ -S /bin/bash
26    
27    
28    VALID_CCF="$HOME/valid_ccf"
29    
30  host=`hostname | cut -d. -f1`  host=`hostname | cut -d. -f1`
31    
32  now=`date +'%Y%m%d_%H%M'`  now=`date +'%Y%m%d_%H%M'`
33  now_table=`date +'%Y-%m-%dT%H:%M:%S'`  now_table=`date +'%Y-%m-%dT%H:%M:%S'`
34    
35    
36    # Function getxsaobslog
37    # We need to get the list of all observed ODFs at the current date.
38    # This is obtained from http://nxsa.esac.esa.int/ftp_public/cds_obslog/xsaobslog.txt.
39    
40    getxsaobslog ()
41    {
42    
43    XSAOBSURL="http://nxsa.esac.esa.int/ftp_public/cds_obslog/xsaobslog.txt"
44    
45    # Remove any xsaobslog.txt previously downloaded.
46    
47    [ -f "${VALID_CCF}/xsaobslog.txt" ] && rm -rf ${VALID_CCF}/xsaobslog.txt
48    
49    # Get the list latest list of ODFs available from nXSA server.
50    
51    wget -q ${XSAOBSURL}
52    
53    # Rename xsaobslog.txt to xsaobslog_${now}.txt just to have a reference
54    # of which list of ODFs was used to compute the list of valid CCFs.
55    
56    mv ${VALID_CCF}/xsaobslog.txt ${VALID_CCF}/xsaobslog_${now}.txt
57    
58    }
59    
60    
61  # Function find_latest_mif to get the latest XMM_CALINDEX from given directory  # Function find_latest_mif to get the latest XMM_CALINDEX from given directory
62    
63  find_latest_mif()  find_latest_mif()
# Line 51  MIF=${CCFPATH}/XMM_CALINDEX_${maxissue}. Line 79  MIF=${CCFPATH}/XMM_CALINDEX_${maxissue}.
79    
80  }  }
81    
82  # Function get_ccf_list to list on stdout the table of CCFs in a given CIF  # Function get_ccf_list to list on stdout the table of CCFs in a given CIF.
 #  
83  # Requires that Heasoft is initialised. Otherwise exits with error.  # Requires that Heasoft is initialised. Otherwise exits with error.
84    
85  get_ccf_list()  get_ccf_list()
# Line 73  fdump ${cif_to_process} prhead=no showco Line 100  fdump ${cif_to_process} prhead=no showco
100                          rows=-  STDOUT                            rows=-  STDOUT  
101  }  }
102    
103    # Get the list of all ODFs
104    
105  # We need to get the list of all observed ODFs at the current date.  xsaobslogsize="0"
 # This is obtained from ftp://nxsa.esac.esa.int/pub/cds_obslog/xsaobslog.txt.  
   
 VALID_CCF="$HOME/valid_ccf"  
106    
107  cd ${VALID_CCF}  getxsaobslog
108    
109  # Remove any xsaobslog.txt previously downloaded.  xsaobslogsize=`stat --format=%s ${VALID_CCF}/xsaobslog_${now}.txt`
110    
111  [ -f "xsaobslog.txt" ] && rm -rf xsaobslog.txt  if [ "$xsaobslogsize"  = "0" ] ; then
112            echo "Error: Failure to download the XSA Obs. Log file - Abort"  
113  # Get the list latest list of ODFs available from nXSA server.          exit
114    fi
 wget -q ftp://nxsa.esac.esa.int/pub/cds_obslog/xsaobslog.txt  
   
 # Rename xsaobslog.txt to xsaobslog_${now}.txt just to have a reference  
 # of which list of ODFs was used to compute the list of valid CCFs.  
   
 mv xsaobslog.txt xsaobslog_${now}.txt  
115    
116  # Sets SAS_CCFPATH and initialises HEADAS and SAS depending on host  # Sets SAS_CCFPATH and initialises HEADAS and SAS depending on host
117    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.27