Changeset 2313 in Sophya
- Timestamp:
- Jan 22, 2003, 5:23:53 PM (23 years ago)
- Location:
- trunk/SophyaLib/Samba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/sphericaltransformserver.cc
r2291 r2313 247 247 // sum_m b(m,theta)*exp(i*m*phi) -> f(phi,theta) 248 248 // ---------------------------------------------------------------*/ 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(); 253 266 } 254 267 } … … 377 390 // somme_m' : de 0 a nph-1 378 391 // 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)) 380 393 // mais phi(j) est un multiple entier de 2*pi/nph, la seconde exponentielle 381 394 // 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') 383 396 // si phi0 n'est pas nul, il y a juste un decalage a faire. 384 397 //********************************************************************** … … 407 420 408 421 // applies the shift in position <-> phase factor in Fourier space 422 // cout << " TF : nph= " << nph << " vec. entree " << data.Size() << endl; 409 423 for (int mprime=0; mprime <= nph/2; mprime++) 410 424 { … … 715 729 716 730 } 731 bool healpix = true; 717 732 if (sphere_type.substr(0,4) == "RING") 718 733 { … … 724 739 // en vue de l'application du critere Healpix : nlmax<=3*nsmax-1 725 740 // c'est approximatif ; a raffiner. 741 healpix = false; 726 742 if (sphere_type.substr(0,6) == "TETAFI") 727 743 { … … 749 765 throw SzMismatchError("SphericalTransformServer: arrays Alme and Almb have not the same size ? "); 750 766 } 751 mapFromWX(nlmax, nmmax, mapq, mapu, alme, almb );767 mapFromWX(nlmax, nmmax, mapq, mapu, alme, almb, healpix); 752 768 // mapFromPM(nlmax, nmmax, mapq, mapu, alme, almb); 753 769 } … … 1059 1075 SphericalMap<T>& mapu, 1060 1076 const Alm<T>& alme, 1061 const Alm<T>& almb ) const1077 const Alm<T>& almb, bool healpix) const 1062 1078 1063 1079 synthesis of Stokes parameters following formulae : … … 1086 1102 SphericalMap<T>& mapu, 1087 1103 const Alm<T>& alme, 1088 const Alm<T>& almb) const 1089 { 1104 const Alm<T>& almb, bool healpix) const 1105 { 1106 int i; 1107 1090 1108 Bm<complex<T> > b_m_theta_q(nmmax); 1091 1109 Bm<complex<T> > b_m_theta_u(nmmax); … … 1137 1155 b_m_theta_u(-m) = conj(b_m_theta_u(m)); 1138 1156 } 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 } 1151 1182 } 1152 1183 } -
trunk/SophyaLib/Samba/sphericaltransformserver.h
r1756 r2313 107 107 void mapFromWX(int_4 nlmax, int_4 nmmax, 108 108 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; 110 110 111 111
Note:
See TracChangeset
for help on using the changeset viewer.