Changeset 2313 in Sophya for trunk/SophyaLib/Samba


Ignore:
Timestamp:
Jan 22, 2003, 5:23:53 PM (23 years ago)
Author:
lemeur
Message:

transf. fourier ajustee pour pixelisations autres que healpix

Location:
trunk/SophyaLib/Samba
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/sphericaltransformserver.cc

    r2291 r2313  
    247247      //    sum_m  b(m,theta)*exp(i*m*phi)   -> f(phi,theta)
    248248      // ---------------------------------------------------------------*/
    249       TVector<T> Temp = RfourierSynthesisFromB(b_m_theta,nph,phi0);
    250       for (int i=0;i< nph;i++)
    251         {
    252           map(pixNumber(i))=Temp(i);
     249
     250
     251      if (sphere_type.substr(0,4) == "RING")
     252        {
     253          TVector<T> Temp = RfourierSynthesisFromB(b_m_theta,nph,phi0);
     254          for (int i=0;i< nph;i++) map(pixNumber(i))=Temp(i);
     255        }
     256      else
     257        // pour des pixelisations quelconques (autres que HEALPix
     258        //  nph n'est pas toujours pair
     259        // ca fait des problemes pour les transformees de Fourier
     260        // car le server de TF ajuste la longueur du vecteur reel
     261        // en sortie de TF, bref, la securite veut qu'on prenne une
     262        // TF complexe
     263        {
     264          TVector<complex<T> > Temp = fourierSynthesisFromB(b_m_theta,nph,phi0);
     265          for (int i=0;i< nph;i++) map(pixNumber(i))=Temp(i).real();
    253266        }
    254267    }
     
    377390  // somme_m' : de 0 a nph-1
    378391  // On echange les sommations :
    379   // DT/T(j) = somme_k (exp(i*m'*phi(j)) somme_m' b(k*nph + m')*exp(i*(k*nph*phi(j))
     392  // DT/T(j) = somme_m' (exp(i*m'*phi(j)) somme_k b(k*nph + m')*exp(i*(k*nph*phi(j))
    380393  // mais phi(j) est un multiple entier de 2*pi/nph, la seconde exponentielle
    381394  // vaut 1.
    382   // Il reste a calculer les transformees de Fourier de somme_m' b(k*nph + m')
     395  // Il reste a calculer les transformees de Fourier de somme_k b(k*nph + m')
    383396  // si phi0 n'est pas nul, il y a juste un decalage a faire.
    384397  //**********************************************************************
     
    407420
    408421  //     applies the shift in position <-> phase factor in Fourier space
     422  // cout << " TF : nph= " << nph << " vec. entree " << data.Size() << endl;
    409423  for (int mprime=0; mprime <= nph/2; mprime++)
    410424    {
     
    715729     
    716730    }
     731  bool healpix = true;
    717732  if (sphere_type.substr(0,4) == "RING")
    718733    {
     
    724739    // en vue de l'application du critere Healpix : nlmax<=3*nsmax-1
    725740    // c'est approximatif ; a raffiner.
     741    healpix = false;
    726742    if (sphere_type.substr(0,6) == "TETAFI")
    727743      {
     
    749765      throw SzMismatchError("SphericalTransformServer: arrays Alme and Almb have not the same size ?  ");
    750766    }
    751     mapFromWX(nlmax, nmmax, mapq, mapu, alme, almb);
     767    mapFromWX(nlmax, nmmax, mapq, mapu, alme, almb, healpix);
    752768    // mapFromPM(nlmax, nmmax, mapq, mapu, alme, almb);
    753769}
     
    10591075                                         SphericalMap<T>& mapu,
    10601076                                         const Alm<T>& alme,
    1061                                          const Alm<T>& almb) const
     1077                                         const Alm<T>& almb, bool healpix) const
    10621078
    10631079synthesis of Stokes parameters following formulae :
     
    10861102                                         SphericalMap<T>& mapu,
    10871103                                         const Alm<T>& alme,
    1088                                          const Alm<T>& almb) const
    1089 {
     1104                                         const Alm<T>& almb, bool healpix) const
     1105{
     1106  int i;
     1107
    10901108  Bm<complex<T> > b_m_theta_q(nmmax);
    10911109  Bm<complex<T> > b_m_theta_u(nmmax);
     
    11371155          b_m_theta_u(-m) = conj(b_m_theta_u(m));
    11381156        }
    1139 
    1140       //    TVector<complex<T> > Tempq = fourierSynthesisFromB(b_m_theta_q,nph,phi0); 
    1141       //     TVector<complex<T> > Tempu = fourierSynthesisFromB(b_m_theta_u,nph,phi0);
    1142       TVector<T> Tempq = RfourierSynthesisFromB(b_m_theta_q,nph,phi0); 
    1143       TVector<T> Tempu = RfourierSynthesisFromB(b_m_theta_u,nph,phi0);
    1144       for (int i=0;i< nph;i++)
    1145         {
    1146           //      mapq(pixNumber(i))=Tempq(i).real();
    1147           //      mapu(pixNumber(i))=Tempu(i).real();
    1148           mapq(pixNumber(i))=Tempq(i);
    1149           mapu(pixNumber(i))=Tempu(i);
    1150          
     1157      if (healpix)
     1158        {
     1159          TVector<T> Tempq = RfourierSynthesisFromB(b_m_theta_q,nph,phi0); 
     1160          TVector<T> Tempu = RfourierSynthesisFromB(b_m_theta_u,nph,phi0);
     1161          for (i=0;i< nph;i++)
     1162            {
     1163              mapq(pixNumber(i))=Tempq(i);
     1164              mapu(pixNumber(i))=Tempu(i);
     1165            }
     1166        }
     1167      else
     1168        // pour des pixelisations quelconques (autres que HEALPix
     1169        //  nph n'est pas toujours pair
     1170        // ca fait des problemes pour les transformees de Fourier
     1171        // car le server de TF ajuste la longueur du vecteur reel
     1172        // en sortie de TF, bref, la securite veut qu'on prenne une
     1173        // TF complexe
     1174        {
     1175          TVector<complex<T> > Tempq = fourierSynthesisFromB(b_m_theta_q,nph,phi0); 
     1176          TVector<complex<T> > Tempu = fourierSynthesisFromB(b_m_theta_u,nph,phi0);
     1177          for (i=0;i< nph;i++)
     1178            {
     1179              mapq(pixNumber(i))=Tempq(i).real();
     1180              mapu(pixNumber(i))=Tempu(i).real();
     1181            }
    11511182        }
    11521183    }
  • trunk/SophyaLib/Samba/sphericaltransformserver.h

    r1756 r2313  
    107107  void mapFromWX(int_4 nlmax, int_4 nmmax,
    108108               SphericalMap<T>& mapq, SphericalMap<T>& mapu,
    109                const Alm<T>& alme, const Alm<T>& almb) const;
     109               const Alm<T>& alme, const Alm<T>& almb, bool healpix) const;
    110110
    111111
Note: See TracChangeset for help on using the changeset viewer.