Changeset 556


Ignore:
Timestamp:
Oct 7, 2011, 1:42:23 PM (13 years ago)
Author:
campagne
Message:

generalise the process to download the files for final analysis (jec)

Location:
BAORadio/AmasNancay/trunk
Files:
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • BAORadio/AmasNancay/trunk/analyse.cc

    r547 r556  
    989989    sa_size_t nr,nc; //values read
    990990   
     991    //JEC 20/9/11 use mean calibration coeff upon all cycles START
    991992    string calibFileName = inputPath_+ "/"
    992993      + sourceName_ + "/" + dateOfRun_ + StringToLower(sourceName_)
     
    10081009    }
    10091010
    1010 //JEC 20/9/11 use mean calibration coeff upon all cycles END
     1011    //JEC 20/9/11 use mean calibration coeff upon all cycles END
    10111012
    10121013    //
     
    10301031  } //end loop mode for BAO calib
    10311032
    1032   if(debuglev_>1){ //save mean spectra BAO calibrated on file
    1033     cout << "save calibrated BAO spectra" << endl;
    1034     string fileName;
    1035     //TO BE FIXED    fileName = "./" + sourceName_ + "/" + dateOfRun_ + "_" + StringToLower(sourceName_) + "_" + "dataBAOCalib" + ".ppf";
    1036     fileName = "./dataBAOCalib_" + dateOfRun_ + "_" + StringToLower(sourceName_) + ".ppf";
    1037 
    1038     POutPersist fos(fileName);
    1039     iSpectreEnd = spectreCollect.end();
    1040     id=0;
    1041     for (iSpectre = spectreCollect.begin();iSpectre != iSpectreEnd ; ++iSpectre, ++id) {
    1042 
    1043       tag = "specBAOCalib";
    1044       //JEC 20/9/11 modif tag to take into account Mode and Cycle number START
    1045 //       stringstream sid;
    1046 //       sid << id;
    1047 //       tag += sid.str();
    1048       tag += (iSpectre->first).first;
    1049       stringstream sid;
    1050       sid << (iSpectre->first).second;
    1051       tag += sid.str();
    1052       if(debuglev_>9) {
    1053         cout << "save tag<" << tag << ">" << endl;
    1054       }
    1055       //JEC 20/9/11 modif tag to take into account Mode and Cycle number END
    1056 
    1057       fos << PPFNameTag(tag) << iSpectre->second;
    1058     }
    1059   }//end of save fits
    1060 
     1033  cout << "save calibrated BAO spectra" << endl;
     1034  string fileName;
     1035  //TO BE FIXED    fileName = "./" + sourceName_ + "/" + dateOfRun_ + "_" + StringToLower(sourceName_) + "_" + "dataBAOCalib" + ".ppf";
     1036  fileName = "./dataBAOCalib_" + dateOfRun_ + "_" + StringToLower(sourceName_) + ".ppf";
     1037 
     1038  POutPersist fos(fileName);
     1039  iSpectreEnd = spectreCollect.end();
     1040  id=0;
     1041  for (iSpectre = spectreCollect.begin();iSpectre != iSpectreEnd ; ++iSpectre, ++id) {
     1042   
     1043    tag = "specBAOCalib";
     1044    //JEC 20/9/11 modif tag to take into account Mode and Cycle number START
     1045    //       stringstream sid;
     1046    //       sid << id;
     1047    //       tag += sid.str();
     1048    tag += (iSpectre->first).first;
     1049    stringstream sid;
     1050    sid << (iSpectre->first).second;
     1051    tag += sid.str();
     1052    if(debuglev_>9) {
     1053      cout << "save tag<" << tag << ">" << endl;
     1054    }
     1055    //JEC 20/9/11 modif tag to take into account Mode and Cycle number END
     1056   
     1057    fos << PPFNameTag(tag) << iSpectre->second;
     1058  }
    10611059 
    10621060  for (iMode = modeList.begin(); iMode != modeList.end(); ++iMode) {
  • BAORadio/AmasNancay/trunk/etude_onoff.pic

    r547 r556  
    1111#Plots ON-OFF with all calibrations
    1212#####################################
    13 openppf ${toppath}/${source}/${date}${srclower}/diffOnOff_${date}_${srclower}.ppf
     13openppf ${toppath}/${source}/diffOnOff_${date}_${srclower}.ppf
    1414
    1515
     
    3434settitle "ON-OFF  ${source}/${date} Ch 0 (blue) Ch 1 (red) Mean (black)  All cycles"
    3535setaxelabels "Freq. (MHz)" "I (Jy)"
     36
     37#####################################
     38#Examine fluctuations sigma for the combination of all cycles
     39#####################################
     40cp sallcyclev0 specv0
     41cp sallcyclev1 specv1
     42c++compile reducing       
     43c++link reducing.so doreduc
     44call doreduc
     45
     46newwin 1 1
     47graphicatt "xylimits=1250,1500,-0.01,0.01"
     48 del redMeanv0                                                                     
     49 del redMeanv1                                                                     
     50 objaoper reducedMeanDiffOnOff row 0 redMeanv0                                     
     51 objaoper reducedMeanDiffOnOff row 1 redMeanv1                                     
     52 plot2d redMeanv0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7 nsta notit"       
     53 plot2d redMeanv1 (n/32)*250+1250 val n>0 "same red marker=fcircle,7 nsta notit"
     54settitle "Red Mean ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles"
     55setaxelabels "Freq. (MHz)" "I (Jy)"
     56
     57newwin 1 1
     58graphicatt "xylimits=1250,1500,0,0.001"
     59 del redSigmav0                                                                     
     60 del redSigmav1                                                                     
     61 objaoper reducedSigmaDiffOnOff row 0 redSigmav0                                     
     62 objaoper reducedSigmaDiffOnOff row 1 redSigmav1                                     
     63 plot2d redSigmav0 (n/32)*250+1250 val n>0 "blue marker=fcircle,7 nsta notit"       
     64 plot2d redSigmav1 (n/32)*250+1250 val n>0 "same red marker=fcircle,7 nsta notit"
     65settitle "ON-OFF  ${source} Ch 0 (blue) Ch 1 (red) ${tmpvec.sum} cycles"
     66setaxelabels "Freq. (MHz)" "I (Jy)"
     67
    3668
    3769#####################################
     
    70102# Plots RAW no calibration at all
    71103#####################################
    72 openppf ${toppath}/${source}/${date}${srclower}/dataRaw_${date}_${srclower}.ppf
     104openppf ${toppath}/${source}/dataRaw_${date}_${srclower}.ppf
    73105newwin 2 2
    74106graphicatt "xylimits=1250,1500,0.95,1.05"
     
    141173# Plots BAO calibration included
    142174#####################################
    143 openppf ${toppath}/${source}/${date}${srclower}/dataBAOCalib_${date}_${srclower}.ppf
     175openppf ${toppath}/${source}/dataBAOCalib_${date}_${srclower}.ppf
    144176newwin 2 2
    145177#graphicatt "xylimits=1250,1500,0.95,1.05"
     
    214246# Plots BAO+RT calibration included
    215247#####################################
    216 openppf ${toppath}/${source}/${date}${srclower}/dataBAORTCalib_${date}_${srclower}.ppf
     248openppf ${toppath}/${source}/dataBAORTCalib_${date}_${srclower}.ppf
    217249newwin 2 2
    218250#graphicatt "xylimits=1250,1500,0.95,1.05"
  • BAORadio/AmasNancay/trunk/mergeRawOnOff.pic

    r554 r556  
    6767c++link reducing.so doreduc
    6868
    69 
     69cp specONOFFv0 specv0
     70cp specONOFFv1 specv1
    7071call doreduc
    7172
  • BAORadio/AmasNancay/trunk/plotDiffOnOff.pic

    r553 r556  
    5151setaxelabels "Freq. (MHz)" "Sigma[(ON-OFF)[r,c]/Gain[r]] Rebin(${nFreqBin})" $defatt
    5252
     53######
    5354else
     55######
    5456
    5557openppf medianDiffOnOffRaw_${source}-${ncycles}Cycles.ppf
     
    9395
    9496##Normalized General Median
    95 del s0 s1
    96 objaoper medianNorm row 0 s0
    97 objaoper medianNorm row 1 s1
     97del ngms0 ngms1
     98objaoper medianNorm row 0 ngms0
     99objaoper medianNorm row 1 ngms1
    98100graphicatt "xylimits=1250,1500,-2,2"
    99101newwin 1 1
    100 plot2d s0 (n/8192)*250+1250 val n>0 "cpts blue nsta notit"
    101 plot2d s1 (n/8192)*250+1250 val n>0 "same cpts red nsta notit"
     102plot2d ngms0 (n/8192)*250+1250 val n>0 "cpts blue nsta notit"
     103plot2d ngms1 (n/8192)*250+1250 val n>0 "same cpts red nsta notit"
    102104settitle "$source (${ncycles} cycles) Ch 0 (blue) Ch 1 (red)" ' ' $defatt
    103105setaxelabels "Freq. (MHz)" "Norm Median[(ON-OFF)[r,c]/Gain[r]]"  $defatt
    104106
     107del prod
     108c++exec TVector<r_4>prod(ngms0.NElts(),BaseArray::RowVector); prod=ngms0&&ngms1;KeepObj(prod);
     109newwin 1 1
     110plot2d prod (n/8192)*250+1250 val n>0 "cpts blue nsta notit"
     111settitle "$source (${ncycles} cycles)" ' ' $defatt
     112setaxelabels "Freq. (MHz)" "Product Norm Median[(ON-OFF)[r,c]/Gain[r]]"  $defatt
    105113 
    106114
  • BAORadio/AmasNancay/trunk/proc_rawonoff.sh

    r555 r556  
    8686    $ECHO "FATAL: You have forgotten to select the type option (-type)"
    8787    exit 1
    88 fi
    89 
     88else
     89    offtype=`$ECHO ${typeofproc} | $GREP -i OFF | $WC -l`
     90    ontype=`$ECHO ${typeofproc} | $GREP -i ON | $WC -l`
     91    if [ "<${offtype}>" = "<1>" -a  "<${ontype}>" = "<0>" ]; then
     92        datatype="OFF"
     93    elif [ "<${offtype}>" = "<0>" -a  "<${ontype}>" = "<1>" ]; then
     94        datatype="ON"
     95    else
     96        $ECHO "FATAL: not supported: -type ${typeofproc}"
     97        exit 1
     98    fi
     99fi
    90100
    91101
     
    210220#JEC 29/9/11 avoid finished stuff
    211221#$RM -f ${tmppublicpath}/select.finished
    212 ${scriptpath}/select.sh ${scaFileSummarized} ${dirFiberfile} ${typeofproc} | $GREP "^#[0-9]" | $SED "s/^#//" > $headerFileSelected
     222${scriptpath}/select.sh ${scaFileSummarized} ${dirFiberfile} ${datatype} | $GREP "^#[0-9]" | $SED "s/^#//" > $headerFileSelected
    213223#while [ ! -f "${tmppublicpath}/select.finished" ]; do
    214224#    $ECHO "INFO (${scriptName}): waiting for ${tmppublicpath}/select.finished"
     
    308318      $ECHO "process signal files for OFF phases (MEAN)"
    309319      ingain="-gain gain_${dateSelected}_${srclower}.fits"
    310       freqfilter="-freqfilter 16"
    311       nwinmean="5"
    312       tspwin="5120"
     320      nwinmean="25000"
     321      tspwin="1"
    313322      dirName="Off"
    314323      cyclebasename="meancycle"
     
    322331      $ECHO "process signal files for OFF phases (MEAN)"
    323332      ingain="-gain gain_${dateSelected}_${srclower}.fits"
    324       freqfilter="-freqfilter 16"
    325       nwinmean="5"
    326       tspwin="5120"
     333      nwinmean="25000"
     334      tspwin="1"
    327335      dirName="On"
    328336      cyclebasename="meancycle"
     
    558566
    559567#Note: here act=gain means only that specmfib will use median-like algorithms (not only for gains...)
    560     $prg -act gain $forceSingle $freqfilter  -prt $prtlevel -out ${outDir} -nmean $nwinmean $ingain $tmproc -tspwin ${tspwin},0,0 -in $infiles ${fibfile}
     568    $prg -act ${action} $forceSingle $freqfilter  -prt $prtlevel -out ${outDir} -nmean $nwinmean $ingain $tmproc -tspwin ${tspwin},0,0 -in $infiles ${fibfile}
    561569
    562570    $ECHO    ${outDir}
  • BAORadio/AmasNancay/trunk/reducing.cc

    r547 r556  
    100100string ___nomobj;
    101101
    102 ___nomobj = "specONOFFv0";
    103 TVector< r_4 > * ___specONOFFv0 = dynamic_cast< TVector< r_4 >  * >(omg.GetObj(___nomobj));
    104 if(___specONOFFv0==NULL) throw NullPtrError("CxxExecutor::PutObject: Non existing object specONOFFv0... please update file");
    105 TVector< r_4 > & specONOFFv0 = (*___specONOFFv0);
     102___nomobj = "specv0";
     103TVector< r_4 > * ___specv0 = dynamic_cast< TVector< r_4 >  * >(omg.GetObj(___nomobj));
     104if(___specv0==NULL) throw NullPtrError("CxxExecutor::PutObject: Non existing object specv0... please update file");
     105TVector< r_4 > & specv0 = (*___specv0);
    106106
    107 ___nomobj = "specONOFFv1";
    108 TVector< r_4 > * ___specONOFFv1 = dynamic_cast< TVector< r_4 >  * >(omg.GetObj(___nomobj));
    109 if(___specONOFFv1==NULL) throw NullPtrError("CxxExecutor::PutObject: Non existing object specONOFFv1... please update file");
    110 TVector< r_4 > & specONOFFv1 = (*___specONOFFv1);
     107___nomobj = "specv1";
     108TVector< r_4 > * ___specv1 = dynamic_cast< TVector< r_4 >  * >(omg.GetObj(___nomobj));
     109if(___specv1==NULL) throw NullPtrError("CxxExecutor::PutObject: Non existing object specv1... please update file");
     110TVector< r_4 > & specv1 = (*___specv1);
    111111
    112112
     
    119119 sa_size_t NUMBER_OF_FREQ = 8192;
    120120 TMatrix<r_4> specMtxInPut(NUMBER_OF_CHANNELS,NUMBER_OF_FREQ);
    121  specMtxInPut.Row(0)=specONOFFv0;
    122  specMtxInPut.Row(1)=specONOFFv1;
     121 specMtxInPut.Row(0)=specv0;
     122 specMtxInPut.Row(1)=specv1;
    123123
    124124 //JEC 22/9/11 Mean & Sigma in 32-bins size START
  • BAORadio/AmasNancay/trunk/submit2bqs-rawonoffmaker.sh

    r555 r556  
    2828#action: gain|mspec (gain: gain-like doucble median filtering
    2929#                   mspec: mean+sigma wo filetring)
    30 action="gain"
     30action="-act gain"
    3131sourceRadio=
    3232dateSelected=
Note: See TracChangeset for help on using the changeset viewer.