Changeset 20034 for trunk/Mars


Ignore:
Timestamp:
01/09/21 14:42:28 (4 years ago)
Author:
tbretz
Message:
Using the power of bash to do the splitting.
Location:
trunk/Mars/hawc/processing
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/hawc/processing/extract-aux-data.sh

    r20033 r20034  
    9090
    9191  # Split night into year, month, day
    92   YEAR=`echo ${NIGHT}  | cut -c1-4`
    93   MONTH=`echo ${NIGHT} | cut -c5-6`
    94   DAY=`echo ${NIGHT}   | cut -c7-8`
    95 
    9692  # Base path for the night
    97   FNAME=${AUX}/${YEAR}/${MONTH}/${DAY}/${NIGHT}
     93  FNAME="${AUX}"/${NIGHT:0:4}/${NIGHT:4:2}/${NIGHT:6:2}/${NIGHT}
    9894
    9995  echo ""
  • trunk/Mars/hawc/processing/extract-raw-headers.sh

    r20033 r20034  
    6363do
    6464
    65    # Extract year, month and day from directory name
    66    YEAR=`echo  ${SUBDIR} | cut -f6 -d\/`
    67    MONTH=`echo ${SUBDIR} | cut -f7 -d\/`
    68    DAY=`echo   ${SUBDIR} | cut -f8 -d\/`
    69 
    7065   # Loop over all files in this subdirectory
    71    for ROOT in ${SUBDIR}/${YEAR}${MONTH}${DAY}*.fits.fz
     66   for ROOT in ${SUBDIR}/${NIGHT}*.fits.fz
    7267   do
    7368      FILE=`echo ${ROOT} | cut -f2 -d_`
    74       echo ${YEAR} ${MONTH} ${DAY} ${FILE} ${ROOT}
     69      echo ${NIGHT} ${FILE} ${ROOT}
    7570
    7671      # Extact the header from the fits file with fitsdump, the following chain
  • trunk/Mars/hawc/processing/run-callisto.sh

    r20033 r20034  
    4646  DRSRUNID=${LINE[3]}
    4747
    48   # Split both into year, month, day
    49   DATYEAR=`echo ${DATNIGHT}  | cut -c1-4`
    50   DATMONTH=`echo ${DATNIGHT} | cut -c5-6`
    51   DATDAY=`echo ${DATNIGHT}   | cut -c7-8`
    52 
    53   DRSYEAR=`echo ${DRSNIGHT}  | cut -c1-4`
    54   DRSMONTH=`echo ${DRSNIGHT} | cut -c5-6`
    55   DRSDAY=`echo ${DRSNIGHT}   | cut -c7-8`
    56 
    5748  # Formatting of the file paths and names
    58   DATPATH="${DATYEAR}/${DATMONTH}/${DATDAY}"
    59   DRSPATH="${DRSYEAR}/${DRSMONTH}/${DRSDAY}"
     49  DATPATH=${DATNIGHT:0:4}/${DATNIGHT:4:2}/${DATNIGHT:6:2}
     50  DRSPATH=${DRSNIGHT:0:4}/${DRSNIGHT:4:2}/${DRSNIGHT:6:2}
    6051
    6152  PREFIX=`printf ${DATNIGHT}_%03d ${DATRUNID}`
  • trunk/Mars/hawc/processing/run-root2sql.sh

    r20033 r20034  
    4444  RUNID=${LINE[1]}
    4545
    46   # Split into year, month, day
    47   YEAR=`echo ${NIGHT}  | cut -c1-4`
    48   MONTH=`echo ${NIGHT} | cut -c5-6`
    49   DAY=`echo ${NIGHT}   | cut -c7-8`
    50 
    5146  # Format file and path names
    52   DIR="${BASEIN}/${YEAR}/${MONTH}/${DAY}"
     47  DIR="${BASEIN}"/${NIGHT:0:4}/${NIGHT:4:2}/${NIGHT:6:2}
    5348
    5449  PREFIX=`printf ${NIGHT}_%03d ${RUNID}`
  • trunk/Mars/hawc/processing/run-star.sh

    r20033 r20034  
    4444  RUNID=${LINE[1]}
    4545
    46   # Split into year, month, day
    47   YEAR=`echo ${NIGHT}  | cut -c1-4`
    48   MONTH=`echo ${NIGHT} | cut -c5-6`
    49   DAY=`echo ${NIGHT}   | cut -c7-8`
    50 
    5146  # Formatting of the file paths and names
    52   DATPATH="${YEAR}/${MONTH}/${DAY}"
     47  DATPATH=${NIGHT:0:4}/${NIGHT:4:2}/${NIGHT:6:2}
    5348
    5449  PREFIX=`printf ${NIGHT}_%03d ${RUNID}`
     
    9085     rm -f ${OUT}/.${PREFIX}.running
    9186
    92      # If processing was successfull write coresponding flag     
     87     # If processing was successfull write coresponding flag
    9388     if [ "${RC}" == "0" ]
    9489     then
Note: See TracChangeset for help on using the changeset viewer.