Changeset 3948 in Sophya for trunk/Cosmo/RadioBeam/pknoise.cc


Ignore:
Timestamp:
Feb 16, 2011, 3:20:54 PM (15 years ago)
Author:
ansari
Message:

modifications de config cylindres pour papier, Reza 16/02/2011

File:
1 edited

Legend:

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

    r3947 r3948  
    4343       << "    -noise NoiseLevel (default=1.) \n"
    4444       << "    -renmax MaxValue (default : Do NOT renormalize 2D response value \n"   
    45        << "    -scut SCutValue (default=100.) \n"
    4645       << "    -ngen NGen (default=0) number of noise fourier amp generations \n"
    4746       << "       NGen=0 -> Call ComputeNoisePk(), else generate Fourier Amplitudes (random) \n"
    4847       << "    -z redshift (default=0.7) \n"
     48       << "    -scut SCutValue (default= -100.) \n"
     49       << "       if SCutValue<0. ==> SCut=MinNoisePower*(-SCutValue) \n"
    4950       << "    -prt PrtLev,PrtModulo (default=0,10) " << endl;
    5051  return;
     
    7677  double rmax=1.;
    7778  int NMAX = 0;
    78   double SCut=0.;
     79  double SCut=-100.;
     80  bool fgautoscut=true;
     81  double FacSCut=-SCut;
    7982  double z_Redshift=0.7 ;  // 21 cm at z=0.7 -> 0.357 m 
    8083  int prtlev=0;
     
    9295    else if (strcmp(arg[ka],"-scut")==0) {
    9396      SCut=atof(arg[ka+1]);    ka+=2;
     97      if (SCut<0.) { FacSCut=-SCut;  fgautoscut=true; }
    9498    }
    9599    else if (strcmp(arg[ka],"-ngen")==0) {
     
    154158    else cout << " pknoise[1]: Four2DResponse ( Diameter=" << DIAMETRE << " Lambda= " << lambda
    155159              << " DoL=" << DIAMETRE/lambda << " ) " << endl;
    156 
     160    Histo2D h2drep = arep_p->GetResponse();
     161    double repmax= h2drep.VMax();
     162    if (fgautoscut) {
     163      SCut = FacSCut/repmax;
     164      cout << " pknoise[1.b]: Four2DResponse.RepMax=" << repmax << " --> SCut=" << FacSCut << "/repmax="
     165           << SCut << endl;
     166    }
     167    else cout << " pknoise[1.b]: Four2DResponse.RepMax=" << repmax << " , SCut=" << SCut << endl;
    157168   
    158169    cout << " pknoise[2]: Instanciating object type Four3DPk  " << endl;
     
    167178      pkn.SetPrtLevel(prtlev,prtmod);
    168179      HProf hpn = pkn.Compute();
     180      cout << " pknoise[3.b]: writing hpn noise profile to " << outfile << endl;
    169181      po << hpn;
    170182    }
     
    173185      DataTable dtnoise;
    174186      HProf hpn = m3d.ComputeNoisePk(*(arep_p),fracmodok,dtnoise,SCut);
    175       po << hpn;
    176       string outfile2 = "x"+outfile;
    177       POutPersist po2(outfile2);
    178187      HProf h1dnoise=arep_p->GetProjNoiseLevel();
    179188      HProf h1drep=arep_p->GetProjResponse();
    180       po2 << PPFNameTag("dtnoise") << dtnoise;
    181       po2 << PPFNameTag("hpnoise") << hpn;
    182       po2 << PPFNameTag("fracmodok") << fracmodok;
    183       po2 << PPFNameTag("h1dnoise") << h1dnoise;
    184       po2 << PPFNameTag("h1drep") << h1drep;
     189      cout << " pknoise[3.b]: writing dtnoise,hpn,h2rep... with tags to " << outfile << endl;
     190      po << PPFNameTag("dtnoise") << dtnoise;
     191      po << PPFNameTag("hpnoise") << hpn;
     192      po << PPFNameTag("fracmodok") << fracmodok;
     193      po << PPFNameTag("h1dnoise") << h1dnoise;
     194      po << PPFNameTag("h1drep") << h1drep;
     195      po << PPFNameTag("h2drep") << h2drep;
    185196    }
    186197    rc = 0;
Note: See TracChangeset for help on using the changeset viewer.