예제 #1
0
 void SBAutoConvolve::SBAutoConvolveImpl::shoot(PhotonArray& photons, UniformDeviate ud) const
 {
     const int N = photons.size();
     dbg<<"AutoConvolve shoot: N = "<<N<<std::endl;
     dbg<<"Target flux = "<<getFlux()<<std::endl;
     _adaptee.shoot(photons, ud);
     PhotonArray temp(N);
     _adaptee.shoot(temp, ud);
     photons.convolve(temp, ud);
     dbg<<"AutoConvolve Realized flux = "<<photons.getTotalFlux()<<std::endl;
 }
예제 #2
0
 void SBAutoCorrelate::SBAutoCorrelateImpl::shoot(PhotonArray& photons, UniformDeviate ud) const
 {
     const int N = photons.size();
     dbg<<"AutoCorrelate shoot: N = "<<N<<std::endl;
     dbg<<"Target flux = "<<getFlux()<<std::endl;
     _adaptee.shoot(photons, ud);
     PhotonArray temp(N);
     _adaptee.shoot(temp, ud);
     // Flip sign of (x,y) in one of the results
     temp.scaleXY(-1.);
     photons.convolve(temp, ud);
     dbg<<"AutoCorrelate Realized flux = "<<photons.getTotalFlux()<<std::endl;
 }
예제 #3
0
 void SBConvolve::SBConvolveImpl::shoot(PhotonArray& photons, UniformDeviate ud) const
 {
     const int N = photons.size();
     dbg<<"Convolve shoot: N = "<<N<<std::endl;
     dbg<<"Target flux = "<<getFlux()<<std::endl;
     std::list<SBProfile>::const_iterator pptr = _plist.begin();
     if (pptr==_plist.end())
         throw SBError("Cannot shoot() for empty SBConvolve");
     pptr->shoot(photons, ud);
     // It may be necessary to shuffle when convolving because we do
     // do not have a gaurantee that the convolvee's photons are
     // uncorrelated, e.g. they might both have their negative ones
     // at the end.
     // However, this decision is now made by the convolve method.
     for (++pptr; pptr != _plist.end(); ++pptr) {
         PhotonArray temp(N);
         pptr->shoot(temp, ud);
         photons.convolve(temp, ud);
     }
     dbg<<"Convolve Realized flux = "<<photons.getTotalFlux()<<std::endl;
 }