Changeset 20030 for trunk/Mars


Ignore:
Timestamp:
01/07/21 09:17:46 (4 years ago)
Author:
tbretz
Message:
Do not do any splitting of the aux data in the script files, instead add the commas in the root macros (simplification)
Location:
trunk/Mars/hawc/processing
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/hawc/processing/currents.C

    r20027 r20030  
    117117    {
    118118        if (diff<5./24/3600)
    119         {
    120             cout << "result";
    121             cout << " NULL";
    122             cout << " NULL";
    123             cout << " NULL";
    124             cout << " NULL";
    125             cout << " NULL";
    126             cout << " NULL";
    127             cout << " NULL";
    128             cout << " NULL";
    129             cout << " NULL";
    130             cout << " NULL";
    131             cout << " NULL";
    132             cout << " NULL";
    133             cout << " NULL";
    134             cout << endl;
    135119            return;
    136         }
    137120
    138         cout << "result";
    139         cout << " " << Umed;
    140         cout << " " << Uavg;
    141         cout << " " << Udev;
    142         cout << " " << Urms;
     121        cout << "result ";
     122        cout << Umed << ", ";
     123        cout << Uavg << ", ";
     124        cout << Udev << ", ";
     125        cout << Urms << ", ";
    143126
    144         cout << " " << Imed;
    145         cout << " " << Iavg;
    146         cout << " " << Idev;
    147         cout << " " << Irms;
     127        cout << Imed << ", ";
     128        cout << Iavg << ", ";
     129        cout << Idev << ", ";
     130        cout << Irms << ", ";
    148131
    149         cout << " " << Tmed;
    150         cout << " " << Tavg;
    151         cout << " " << Tdev;
    152         cout << " " << Trms;
     132        cout << Tmed << ", ";
     133        cout << Tavg << ", ";
     134        cout << Tdev << ", ";
     135        cout << Trms << ", ";
    153136
    154         cout << " " << psu;
     137        cout << psu;
    155138        cout << endl;
    156139        return;
     
    177160
    178161    cout << "result";
    179     cout << " " << AvgUmed;
    180     cout << " " << AvgUavg;
    181     cout << " " << AvgUdev;
    182     cout << " " << AvgUrms;
     162    cout << AvgUmed << ", ";
     163    cout << AvgUavg << ", ";
     164    cout << AvgUdev << ", ";
     165    cout << AvgUrms << ", ";
    183166
    184     cout << " " << AvgImed;
    185     cout << " " << AvgIavg;
    186     cout << " " << AvgIdev;
    187     cout << " " << AvgIrms;
     167    cout << AvgImed << ", ";
     168    cout << AvgIavg << ", ";
     169    cout << AvgIdev << ", ";
     170    cout << AvgIrms << ", ";
    188171
    189     cout << " " << AvgTmed;
    190     cout << " " << AvgTavg;
    191     cout << " " << AvgTdev;
    192     cout << " " << AvgTrms;
     172    cout << AvgTmed << ", ";
     173    cout << AvgTavg << ", ";
     174    cout << AvgTdev << ", ";
     175    cout << AvgTrms << ", ";
    193176
    194     cout << " " << AvgPsu;
     177    cout << AvgPsu;
    195178
    196179    cout << endl;
  • trunk/Mars/hawc/processing/drstemp.C

    r20027 r20030  
    7474            return;
    7575
    76         cout << "result " << lastavgmin << " " << lastavgmax << " " << lastrmsmin << " " << lastrmsmax << endl;
     76        cout << "result " << lastavgmin << ", " << lastavgmax << ", " << lastrmsmin << ", " << lastrmsmax << endl;
    7777        return;
    7878    }
     
    8383    rmsmax /= cnt;
    8484
    85     cout << "result " << avgmin << " " << avgmax << " " << rmsmin << " " << rmsmax << endl;
     85    cout << "result " << avgmin << ", " << avgmax << ", " << rmsmin << ", " << rmsmax << endl;
    8686}
    8787
     
    145145            return;
    146146
    147         cout << "result " << lastavg << " " << lastavg << " " << lastrms << " " << lastrms << endl;
     147        cout << "result " << lastavg << ", " << lastavg << ", " << lastrms << ", " << lastrms << endl;
    148148        return;
    149149    }
     
    152152    rms /= cnt;
    153153
    154     cout << "result " << avg << " " << avg << " " << rms << " " << rms << " " << endl;
     154    cout << "result " << avg << ", " << avg << ", " << rms << ", " << rms << ", " << endl;
    155155}
    156156
  • trunk/Mars/hawc/processing/extract-aux-data.sh

    r20026 r20030  
    9595
    9696  # Return corresponding data for DRS temperatures from FAD_CONTROL_TEMPEREATURE
    97   RESULT=`root -b -q -l '${MACROS}/drstemp.C("'${FNAME}'.FAD_CONTROL_TEMPERATURE.fits",'${BEG}','${END}')' | grep result`
    98   if [ -n "${RESULT}" ]
     97  DRSTEMP=`root -b -q -l '${MACROS}/drstemp.C("'${FNAME}'.FAD_CONTROL_TEMPERATURE.fits",'${BEG}','${END}')' | grep result | cut -f2- -d" "`
     98  if [ ! -n "${DRSTEMP}" ]
    9999  then
    100      TEMP_AVG=`echo ${RESULT} | cut -f2 -d' '`
    101      TEMP_RMS=`echo ${RESULT} | cut -f4 -d' '`
    102   else
    103      TEMP_AVG="NULL"
    104      TEMP_RMS="NULL"
     100        DRSTEMP="NULL, NULL"
    105101  fi
    106   echo ${RESULT}
     102  echo ${DRSTEMP}
    107103
    108104  # Return corresponding data for currents from BIAS_CONTROL_DYNAMIC_DATA
    109   RESULT=`root -b -q -l '${MACROS}/currents.C("'${FNAME}'.BIAS_CONTROL_DYNAMIC_DATA.fits",'${BEG}','${END}')' | grep result`
    110   if [ -n "${RESULT}" ]
     105  BIAS_DATA=`root -b -q -l '${MACROS}/currents.C("'${FNAME}'.BIAS_CONTROL_DYNAMIC_DATA.fits",'${BEG}','${END}')' | grep result | cut -f2- -d" "`
     106  if [ ! -n "${BIAS_DATA}" ]
    111107  then 
    112      BIAS_UMED=`echo ${RESULT} | cut -f2  -d' '`
    113      BIAS_UAVG=`echo ${RESULT} | cut -f3  -d' '`
    114      BIAS_UDEV=`echo ${RESULT} | cut -f4  -d' '`
    115      BIAS_URMS=`echo ${RESULT} | cut -f5  -d' '`
    116      BIAS_IMED=`echo ${RESULT} | cut -f6  -d' '`
    117      BIAS_IAVG=`echo ${RESULT} | cut -f7  -d' '`
    118      BIAS_IDEV=`echo ${RESULT} | cut -f8  -d' '`
    119      BIAS_IRMS=`echo ${RESULT} | cut -f9  -d' '`
    120      BIAS_TMED=`echo ${RESULT} | cut -f10 -d' '`
    121      BIAS_TAVG=`echo ${RESULT} | cut -f11 -d' '`
    122      BIAS_TDEV=`echo ${RESULT} | cut -f12 -d' '`
    123      BIAS_TRMS=`echo ${RESULT} | cut -f13 -d' '`
    124      BIAS_PSU=`echo  ${RESULT} | cut -f14 -d' '`
    125   else
    126      BIAS_UMED="NULL"
    127      BIAS_UAVG="NULL"
    128      BIAS_UDEV="NULL"
    129      BIAS_URMS="NULL"
    130      BIAS_IMED="NULL"
    131      BIAS_IAVG="NULL"
    132      BIAS_IDEV="NULL"
    133      BIAS_IRMS="NULL"
    134      BIAS_TMED="NULL"
    135      BIAS_TAVG="NULL"
    136      BIAS_TDEV="NULL"
    137      BIAS_TRMS="NULL"
    138      BIAS_PSU="NULL"
     108        BIAS_DATA="NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL"
    139109  fi
    140   echo ${RESULT}
     110  echo ${BIAS_DATA}
    141111
    142112  # Return corresponding data for trigger information from FTM_CONTROL_DATA
    143   RESULT=`root -b -q -l '${MACROS}/trigger.C("'${FNAME}'.FTM_CONTROL_DATA.fits",'${BEG}','${END}')' | grep result`
    144   if [ -n "${RESULT}" ]
     113  FTM_DATA=`root -b -q -l '${MACROS}/trigger.C("'${FNAME}'.FTM_CONTROL_DATA.fits",'${BEG}','${END}')' | grep result | cut -f2- -d" "`
     114  if [ ! -n "${RESULT}" ]
    145115  then
    146      TOT_TIME=`echo ${RESULT} | cut -f2 -d' '`
    147      TOT_DEAD=`echo ${RESULT} | cut -f3 -d' '`
    148      EFF=`echo      ${RESULT} | cut -f4 -d' '`
    149      TM_AVG=`echo   ${RESULT} | cut -f5 -d' '`
    150   else
    151      TOT_TIME="NULL"
    152      TOT_DEAD="NULL"
    153      EFF="NULL"
    154      TM_AVG="NULL"
     116        FTM_DATA="NULL, NULL, NULL, NULL"
    155117  fi
    156   echo ${RESULT}
     118  echo ${FTM_DATA}
    157119
    158120  # Return corresponding data for threshold seeting from FTU_CONTROL_DATA
    159   RESULT=`root -b -q -l '${MACROS}/threshold.C("'${FNAME}'.FTU_CONTROL_DATA.fits",'${BEG}','${END}')' | grep result`
    160   if [ -n "${RESULT}" ]
     121  FTU_DATA=`root -b -q -l '${MACROS}/threshold.C("'${FNAME}'.FTU_CONTROL_DATA.fits",'${BEG}','${END}')' | grep result | cut -f2- -d" "`
     122  if [ ! -n "${FTU_DATA}" ]
    161123  then
    162      DAC_CH_MIN=`echo  ${RESULT} | cut -f2  -d' '`
    163      DAC_CH_MED=`echo  ${RESULT} | cut -f3  -d' '`
    164      DAC_CH_MAX=`echo  ${RESULT} | cut -f4  -d' '`
    165      DAC_SUM_MIN=`echo ${RESULT} | cut -f5  -d' '`
    166      DAC_SUM_MAX=`echo ${RESULT} | cut -f6  -d' '`
    167      RATE_CH1=`echo    ${RESULT} | cut -f7  -d' '`
    168      RATE_CH2=`echo    ${RESULT} | cut -f8  -d' '`
    169      RATE_CH3=`echo    ${RESULT} | cut -f9  -d' '`
    170      RATE_CH4=`echo    ${RESULT} | cut -f10 -d' '`
    171      RATE_CH5=`echo    ${RESULT} | cut -f11 -d' '`
    172      RATE_CH6=`echo    ${RESULT} | cut -f12 -d' '`
    173      RATE_CH7=`echo    ${RESULT} | cut -f13 -d' '`
    174      RATE_CH8=`echo    ${RESULT} | cut -f14 -d' '`
    175      RATE_SUM1=`echo   ${RESULT} | cut -f15 -d' '`
    176      RATE_SUM2=`echo   ${RESULT} | cut -f16 -d' '`
    177   else
    178      DAC_CH_MIN="NULL"
    179      DAC_CH_MED="NULL"
    180      DAC_CH_MAX="NULL"
    181      DAC_SUM_MIN="NULL"
    182      DAC_SUM_MAX="NULL"
    183      RATE_CH1="NULL"
    184      RATE_CH2="NULL"
    185      RATE_CH3="NULL"
    186      RATE_CH4="NULL"
    187      RATE_CH5="NULL"
    188      RATE_CH6="NULL"
    189      RATE_CH7="NULL"
    190      RATE_CH8="NULL"
    191      RATE_SUM1="NULL"
    192      RATE_SUM2="NULL"
     124        FTU_DATA="NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL"
    193125  fi
    194   echo ${RESULT}
     126  echo ${FTU_DATA}
    195127
    196128  cd -
     
    200132  echo "ROW(" >> insert-data.sql
    201133  echo " "${NIGHT}, ${RUNID}, >> insert-data.sql
    202   echo " "${TEMP_AVG}, ${TEMP_RMS}, >> insert-data.sql
    203   echo " "\
    204      ${BIAS_UMED}, ${BIAS_UAVG}, ${BIAS_UDEV}, ${BIAS_URMS}, \
    205      ${BIAS_IMED}, ${BIAS_IAVG}, ${BIAS_IDEV}, ${BIAS_IRMS}, \
    206      ${BIAS_TMED}, ${BIAS_TAVG}, ${BIAS_TDEV}, ${BIAS_TRMS}, \
    207      ${BIAS_PSU},  >> insert-data.sql
    208   echo " "${TOT_TIME}, ${TOT_DEAD}, ${EFF}, ${TM_AVG},  >> insert-data.sql
    209   echo " "\
    210      ${DAC_CH_MIN}, ${DAC_CH_MED}, ${DAC_CH_MAX}, ${DAC_SUM_MIN}, ${DAC_SUM_MAX}, \
    211      ${RATE_CH1}, ${RATE_CH2}, ${RATE_CH3}, ${RATE_CH4}, ${RATE_CH5}, ${RATE_CH6}, ${RATE_CH7}, ${RATE_CH8}, \
    212      ${RATE_SUM1}, ${RATE_SUM2} >> insert-data.sql
     134  echo " "${DRS_TEMP},        >> insert-data.sql
     135  echo " "${BIAS_DATA},       >> insert-data.sql
     136  echo " "${FTU_DATA},        >> insert-data.sql
     137  echo " "${FTM_DATA}         >> insert-data.sql
    213138  echo ")," >> insert-data.sql
    214139
  • trunk/Mars/hawc/processing/threshold.C

    r20027 r20030  
    9595    {
    9696        if (diff<5./24/3600)
    97         {
    98             cout << "result NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL" << endl;
    9997            return;
    100         }
    10198
    102         cout << "result " << dac_ch_min << " " << dac_ch_med << " " << dac_ch_max << " " << dac_sum_min << " " << dac_sum_max;
    103         cout << " NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL" << endl;
     99        cout << "result " << dac_ch_min << ", " << dac_ch_med << ", " << dac_ch_max << ", " << dac_sum_min << ", " << dac_sum_max;
     100        cout << ", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL" << endl;
    104101        return;
    105102    }
     
    108105
    109106
    110     cout << "result " << min_dac_ch <<" " << avg_dac_ch << " " << max_dac_ch << " " << min_dac_sum << " " << max_dac_sum;
     107    cout << "result " << min_dac_ch << ", " << avg_dac_ch << ", " << max_dac_ch << ", " << min_dac_sum << ", " << max_dac_sum;
    111108    for (int i=0;i<8; i++)
    112         cout << " " << rate_ch[i] / sum_dt;
    113     cout << " " << rate_sum[0] / sum_dt;
    114     cout << " " << rate_sum[1] / sum_dt;
     109        cout << ", " << rate_ch[i] / sum_dt;
     110    cout << ", " << rate_sum[0] / sum_dt;
     111    cout << ", " << rate_sum[1] / sum_dt;
    115112    cout << endl;
    116113}
  • trunk/Mars/hawc/processing/trigger.C

    r20027 r20030  
    7373    {
    7474        if (diff<5./24/3600)
    75         {
    76             cout << "result NULL NULL NULL NULL" << endl;
    7775            return;
    78         }
    7976
    80         cout << "result NULL NULL NULL " << temp_last << endl;
     77        cout << "result NULL, NULL, NULL, " << temp_last << endl;
    8178        return;
    8279    }
     
    8582    avg_temp /= count;
    8683
    87     cout << "result " << tot_run*10e-9 << " " << tot_dead*10e-9 << " " << 1.-tot_dead/tot_run << " " << avg_temp << endl;
     84    cout << "result " << tot_run*10e-9 << ", " << tot_dead*10e-9 << ", " << 1.-tot_dead/tot_run << ", " << avg_temp << endl;
    8885}
Note: See TracChangeset for help on using the changeset viewer.