Changeset 3947 in Sophya for trunk/Cosmo/RadioBeam/mdish.cc


Ignore:
Timestamp:
Feb 14, 2011, 12:58:29 AM (15 years ago)
Author:
ansari
Message:

Amelioration et modifs diverses lors de la redaction du papier, Reza 13/02/2011

File:
1 edited

Legend:

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

    r3934 r3947  
    6565}
    6666
     67HProf Four2DResponse::GetProjNoiseLevel(int nbin, bool fgnorm1)
     68{
     69  Histo2D h2w = GetResponse(2*nbin, 2*nbin);
     70  r_8 vmin=h2w.VMin();
     71  r_8 vmax=h2w.VMax();
     72  double seuil=vmax/10000.;
     73  if (seuil<1.e-6) seuil=1.e-6;
     74  r_8 facnorm=((fgnorm1)?vmax:1.);
     75  cout << " Four2DResponse::GetProjNoiseLevel Min,Max=" << vmin << " , " << vmax
     76       << " facnorm=" << facnorm << " seuil=" << seuil << endl; 
     77  double kmax=2.*M_PI*D();
     78  HProf hp(0,kmax,nbin);
     79  double x,y;
     80  for(sa_size_t j=0; j<h2w.NBinY(); j++) {
     81    for(sa_size_t i=0; i<h2w.NBinX(); i++) {
     82      h2w.BinCenter(i,j,x,y);
     83      double yw=h2w(i,j);
     84      if (yw<seuil) continue;
     85      hp.Add(sqrt(x*x+y*y),facnorm/yw);
     86    }
     87  }
     88  return hp;
     89}
     90
     91HProf Four2DResponse::GetProjResponse(int nbin, bool fgnorm1)
     92{
     93  Histo2D h2w = GetResponse(2*nbin, 2*nbin);
     94  r_8 vmin=h2w.VMin();
     95  r_8 vmax=h2w.VMax();
     96  r_8 facnorm=((fgnorm1)?(1./vmax):1.);
     97  cout << " Four2DResponse::GetProjResponse Min,Max=" << vmin << " , " << vmax
     98       << " facnorm=" << facnorm << endl;
     99  double kmax=2.*M_PI*D();
     100  HProf hp(0,kmax,nbin);
     101  double x,y;
     102  for(sa_size_t j=0; j<h2w.NBinY(); j++) {
     103    for(sa_size_t i=0; i<h2w.NBinX(); i++) {
     104      h2w.BinCenter(i,j,x,y);
     105      hp.Add(sqrt(x*x+y*y),h2w(i,j)*facnorm);
     106    }
     107  }
     108  return hp;
     109}
     110
    67111//---------------------------------------------------------------
    68112// -- Four2DRespTable : Reponse tabulee instrumentale ds le plan k_x,k_y (angles theta,phi)
     
    185229  SetBeamNSamples();
    186230  SetPrtLevel();
     231  fgcomputedone_=false;
    187232  mcnt_=0;
    188233}
    189234
    190 Histo2D MultiDish::GetResponse()
    191 {
    192   cout << " MultiDish::GetResponse() - NDishes=" << dishes_.size() << " nx=" << nx_ << " ny=" << ny_ << endl;
     235void MultiDish::ComputeResponse()
     236{
     237  cout << " MultiDish::ComputeResponse() - NDishes=" << dishes_.size() << " nx=" << nx_ << " ny=" << ny_ << endl;
    193238  double kmx = 1.2*DeuxPI*dmax_/lambda_;
    194239  double dkmx = kmx/(double)nx_;
     
    198243  h2w_.Define(-kmxx,kmxx,2*nx_+1,-kmxy,kmxy,2*ny_+1);
    199244  h2w_.SetZeroBin(0.,0.);
     245  kmax_=kmx;
    200246
    201247  double dold = dishes_[0].Diameter()/lambda_;
     
    210256  double dtet = thetamax_/(double)ntet_;
    211257  double dphi = phimax_/(double)nphi_;
    212   cout << " MultiDish::GetResponse() - ThetaMax=" << thetamax_ << " NTheta=" << ntet_
     258  cout << " MultiDish::ComputeResponse() - ThetaMax=" << thetamax_ << " NTheta=" << ntet_
    213259       << " PhiMax=" <<  phimax_ << " NPhi=" << nphi_ << endl;
    214260
     
    224270      sumw += CumulResp(rd, theta, -(phi+M_PI));
    225271    }
    226     if (prtlev_>0) cout << "  MultiDish::GetResponse() done ktheta=" << kt << " / MaxNTheta= " << ntet_ << endl;
    227   }
     272    if (prtlev_>0)
     273      cout << "  MultiDish::ComputeResponse() done ktheta=" << kt << " / MaxNTheta= "
     274           << ntet_ << endl;
     275  }
     276  r_8 rmin,rmax;
     277  h2w_.GetMinMax(rmin,rmax);
     278  cout << "  MultiDish::ComputeResponse() finished : Rep_min,max=" << rmin << "," << rmax << " sumW0="
     279       << sumw << " ?=" << h2w_.SumWBinZero() << endl;
     280  fgcomputedone_=true;
     281  return;
     282}
     283
     284Histo2D MultiDish::GetResponse()
     285{
     286  if (!fgcomputedone_) ComputeResponse();
     287
    228288  double kx1 = DeuxPI*(dishes_[0].DiameterX())/lambda_;
    229289  double ky1 = DeuxPI*(dishes_[0].DiameterY())/lambda_;
     
    236296    ib=jb=0;
    237297  }
     298  double sumw=h2w_.SumWBinZero();
    238299  double vmax=h2.VMax();
    239300  cout << " MultiDish::GetResponse[1] VMin=" << h2.VMin() << " VMax= " << vmax 
     
    257318  return h2;
    258319}
     320
     321HProf MultiDish::GetProjNoiseLevel(int nbin, bool fgnorm1)
     322{
     323  r_8 vmin,vmax;
     324  h2w_.GetMinMax(vmin,vmax);
     325  double seuil=vmax/10000.;
     326  if (seuil<1.e-6) seuil=1.e-6;
     327  r_8 facnorm=((fgnorm1)?vmax:1.);
     328  cout << " MultiDish::GetProjNoiseLevel Min,Max=" << vmin << " , " << vmax
     329       << " facnorm=" << facnorm << " seuil=" << seuil << endl; 
     330  HProf hp(0,kmax_,nbin);
     331  for(sa_size_t j=0; j<h2w_.NBinY(); j++) {
     332    double y=h2w_.Y(j);
     333    for(sa_size_t i=0; i<h2w_.NBinX(); i++) {
     334      double x=h2w_.X(i);
     335      double yw=h2w_(i,j);
     336      if (yw<seuil) continue;
     337      hp.Add(sqrt(x*x+y*y),facnorm/yw);
     338    }
     339  }
     340  return hp;
     341}
     342
     343HProf MultiDish::GetProjResponse(int nbin, bool fgnorm1)
     344{
     345  r_8 vmin,vmax;
     346  h2w_.GetMinMax(vmin,vmax);
     347  r_8 facnorm=((fgnorm1)?(1./vmax):1.);
     348  cout << " MultiDish::GetProjResponse Min,Max=" << vmin << " , " << vmax
     349       << " facnorm=" << facnorm << endl; 
     350  HProf hp(0,kmax_,nbin);
     351  for(sa_size_t j=0; j<h2w_.NBinY(); j++) {
     352    double y=h2w_.Y(j);
     353    for(sa_size_t i=0; i<h2w_.NBinX(); i++) {
     354      double x=h2w_.X(i);
     355      hp.Add(sqrt(x*x+y*y),h2w_(i,j)*facnorm);
     356    }
     357  }
     358  return hp;
     359}
     360
    259361
    260362Histo2D MultiDish::PosDist(int nx, int ny, double dmax)
     
    312414      double kx0 = DeuxPI*(dishes_[i].X-dishes_[j].X)/lambda_;
    313415      double ky0 = DeuxPI*(dishes_[i].Y-dishes_[j].Y)/lambda_;
     416      double pgain=dishes_[i].Gain()*dishes_[j].Gain();
    314417      rot.Do(kx0, ky0);
    315418      //    if (kx0<0) kx0=-kx0;
     
    321424          double y = jy*dy;
    322425          if ((ix>0)&&(jy>0)) {
    323             sumw += AddToHisto(kx0, ky0, x, y, rd(x,y), fgfh);
    324             if (j!=i) sumw += AddToHisto(-kx0, -ky0, x, y, rd(x,y), fgfh);
     426            sumw += AddToHisto(kx0, ky0, x, y, rd(x,y)*pgain, fgfh);
     427            if (j!=i) sumw += AddToHisto(-kx0, -ky0, x, y, rd(x,y)*pgain, fgfh);
    325428          }
    326429          else {
    327430            if ((ix==0)&&(jy==0)) {
    328               sumw += h2w_.Add(kx0, ky0, rd(0.,0.), fgfh);
    329               if (j!=i) sumw += h2w_.Add(-kx0, -ky0, rd(0.,0.), fgfh);
     431              sumw += h2w_.Add(kx0, ky0, rd(0.,0.)*pgain, fgfh);
     432              if (j!=i) sumw += h2w_.Add(-kx0, -ky0, rd(0.,0.)*pgain, fgfh);
    330433            }
    331434            else {
    332               double w = rd(x,y);
     435              double w = rd(x,y)*pgain;
    333436              if (ix==0) {
    334437                sumw += h2w_.Add(kx0, ky0+y, w, fgfh);
Note: See TracChangeset for help on using the changeset viewer.