Changeset 3973 in Sophya for trunk/Cosmo/RadioBeam/calcpk2.cc


Ignore:
Timestamp:
Apr 18, 2011, 5:30:44 PM (14 years ago)
Author:
ansari
Message:

Corrections diverses: choix lobe gaussien/triangle et specif DishDiameter au lieu de DoL ds applobe/calcpk2, possibilite application lobe freq.independante ds applobe, Reza 18/04/2011

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/RadioBeam/calcpk2.cc

    r3830 r3973  
    77    R. Ansari , C. Magneville - Juin 2010
    88
    9 Usage: calcpk2 InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPkFile
     9Usage: calcpk2 [-t -g] InMapLSS convFacLSS InMapSync convFacSync InMapRadioSource convFacRsc OutPkFile
    1010               [PixNoiseLevel] [Diameter/Four2DRespTableFile] [TargetBeamArcmin] [NSigSrcThr]
    1111---------------------------------------------------------------  */
     
    4444{
    4545  if ( (narg<6)||((narg>1)&&(strcmp(arg[1],"-h")==0)) ) {
    46     cout << " Usage: calcpk2 InMapLSS convFacLSS InMapFgnd convFacFgnd OutPkFile \n"
    47          << "        [PixNoiseLevel] [D_Dish/Four2DRespTableFile CorBeamDoL] \n"
     46    cout << " Usage: [-t -g] calcpk2 InMapLSS convFacLSS InMapFgnd convFacFgnd OutPkFile \n"
     47         << "        [PixNoiseLevel] [D_Dish/Four2DRespTableFile CorBeamDiam] \n"
    4848         << "        [NSigSrcThr] [P2/P1] [RecMapFile] " << endl;
    4949    if ((narg>1)&&(strcmp(arg[1],"-h")==0)) {
    50       cout << "- InMapLSS: Input 3D LSS cube (PPF file name) \n "
     50      cout << "-t -g : Triangular / gaussian beam shape (def=gaussian) \n"
     51           << "- InMapLSS: Input 3D LSS cube (PPF file name) \n "
    5152           << "- convFacLSS: LSS cube conversion factor to mK (milliKelvin) \n"
    5253           << "- InMapFgnd: Input 3D foreground cube (PPF file name) \n"
     
    5455           << "- PixNoiseLevel: White noise level per pixel (mK) (default=0.) \n"
    5556           << "- D_Dish/Four2DRespTableFile: Dish diameter or 2D (u,v) plane response (PPF file name) \n"
    56            << "- CorBeamDoL: Beam correction target Diameter/Lambda \n"
     57           << "- CorBeamDiam: Beam correction target dish diameter \n"
    5758           << "    These two parameters are used to correct for beam effect for a \n"
    5859           << "    target beam (independent of frequency) defined by D/Lambda \n"
    59            << "    DoL = 100 --> beam ~ 35 arcmin (D=30m @ z~0.5) \n"
     60           << "    DoL = 100 --> beam ~ 35 arcmin (D=30m @ z~0.5 Lambda~30cm) \n"
    6061           << "    default : no beam correction applied \n "
    6162           << " - NSigSrcThr: Point source cleaning, Nb_Sigmas on stacked 2D temperature \n"
    62            << "    default : no point source cleaning, use NSigSrcThr ~ 3..5 \n"
     63           << "    default (0.) : no point source cleaning, use NSigSrcThr ~ 3..5 \n"
    6364           << " - P2/P1: 2nd/first degree polynomial fit on ln(Temp) = f(ln(freq)) \n "
    6465           << "    foreground subtraction. default is P2 \n"
     
    7475  int rc = 0;
    7576  try {
     77    bool fggaussian=true;  // true -> gaussian beam
     78    // decodage argument optionnel
     79    bool fgoptarg=true;
     80    while (fgoptarg) {
     81      string fbo = arg[1];
     82      if (fbo=="-t")  { fggaussian=false; arg++; narg--; }
     83      else if (fbo=="-g")  { fggaussian=true; arg++; narg--; }
     84      else fgoptarg=false;
     85    }
     86    if (narg < 6) {
     87      cout << " calcpk2/error arguments , applobe -h for help " << endl;
     88      return 2;
     89    }
     90
    7691    string inppflss = arg[1];
    7792    r_4 rfaclss = atof(arg[2]);
     
    102117      }
    103118    }
    104     double tbeamDoL=0.;
     119    double tbeamDiam=0.;
    105120    if (narg>8) {
    106       tbeamDoL=atof(arg[8]);
    107       if (tbeamDoL<1.)  fgcorrbeam=false;
     121      tbeamDiam=atof(arg[8]);
     122      if (tbeamDiam<1.)  fgcorrbeam=false;
    108123    }
    109124    bool fgclnsrc=true;
     
    170185      cout << "calcpk2[3.a]: initializing Four2DRespTable from file" << resptblname << endl;
    171186      resptbl.readFromPPF(resptblname);
     187      resptbl.renormalize(1.);
    172188      arep_p=&resptbl;
    173189    }
     
    175191              << " DoL=" << DIAMETRE/lambda << " ) " << endl;
    176192
    177     double DoL = tbeamDoL;
     193    double DoL = tbeamDiam/lambda;
    178194    double tbeamarcmin = RadianToDegree(1.22/DoL)*60.;
    179     int typcb = 2;
     195    int typcb = (fggaussian)?1:2;
    180196    //    if (fgresptbl) typcb=22;
    181197    Four2DResponse tbeam(typcb, DoL, DoL );
     
    183199    ForegroundCleaner  cleaner(*arep_p, tbeam, skycube);
    184200    if (fgcorrbeam) {
    185       cout << "calcpk2[3.b] : calling cleaner.BeamCorrections() for target beam D/Lambda=" << DoL
    186            << " -> arcmin " << tbeamarcmin << " TypDishResp=" << typcb << endl;
     201      cout << "calcpk2[3.b] : calling cleaner.BeamCorrections() for target beam Diameter=" << tbeamDiam
     202           << " D/Lambda=" << DoL  << " -> arcmin " << tbeamarcmin << " TypDishResp=" << typcb << endl;
    187203      cleaner.BeamCorrections();
    188204    }
     
    218234    pkc.SetCellSize(dkxmpc, dkympc, dkzmpc);
    219235   
    220     HProf hp = pkc.ComputePk(0.,256);
     236    HProf hp = pkc.ComputePk(0.,HPk_NBin);
    221237
    222238    tm.Split(" Done ComputePk ");   
Note: See TracChangeset for help on using the changeset viewer.