| 1 | #ifndef SPHERICALTRANFORMSERVER_SEEN | 
|---|
| 2 | #define SPHERICALTRANFORMSERVER_SEEN | 
|---|
| 3 |  | 
|---|
| 4 | #include "sphericalmap.h" | 
|---|
| 5 | #include "fftservintf.h" | 
|---|
| 6 | #include "fftpserver.h" | 
|---|
| 7 | #include "alm.h" | 
|---|
| 8 | #include "lambdaBuilder.h" | 
|---|
| 9 |  | 
|---|
| 10 |  | 
|---|
| 11 | namespace SOPHYA { | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 | template <class T> | 
|---|
| 15 | class SphericalTransformServer | 
|---|
| 16 | { | 
|---|
| 17 |  | 
|---|
| 18 | public: | 
|---|
| 19 |  | 
|---|
| 20 | SphericalTransformServer() | 
|---|
| 21 | { | 
|---|
| 22 | fftIntfPtr_=new FFTPackServer(true); // preserveinput = true | 
|---|
| 23 | fftIntfPtr_->setNormalize(false); | 
|---|
| 24 | }; | 
|---|
| 25 | ~SphericalTransformServer(){ if (fftIntfPtr_!=NULL) delete fftIntfPtr_;}; | 
|---|
| 26 |  | 
|---|
| 27 | /*! | 
|---|
| 28 | Set a fft server. The constructor sets a default fft server (fft-pack). So it is not necessary to call this method for a standard use. | 
|---|
| 29 | \warning The FFTServerInterface object should NOT overwrite the input arrays | 
|---|
| 30 | */ | 
|---|
| 31 | void SetFFTServer(FFTServerInterface* srv=NULL) | 
|---|
| 32 | { | 
|---|
| 33 | if (fftIntfPtr_!=NULL) delete fftIntfPtr_; | 
|---|
| 34 | fftIntfPtr_=srv; | 
|---|
| 35 | fftIntfPtr_->setNormalize(false); | 
|---|
| 36 | } | 
|---|
| 37 |  | 
|---|
| 38 | void GenerateFromAlm( SphericalMap<T>& map, int_4 pixelSizeIndex, const Alm<T>& alm) const; | 
|---|
| 39 | void GenerateFromAlm(SphericalMap<T>& mapq, SphericalMap<T>& mapu, int_4 pixelSizeIndex, const Alm<T>& alme,    const Alm<T>& almb) const; | 
|---|
| 40 |  | 
|---|
| 41 | void GenerateFromCl(SphericalMap<T>& sph, int_4 pixelSizeIndex, | 
|---|
| 42 | const TVector<T>& Cl, const r_8 fwhm) const; | 
|---|
| 43 | void GenerateFromCl(SphericalMap<T>& sphq, SphericalMap<T>& sphu, | 
|---|
| 44 | int_4 pixelSizeIndex, | 
|---|
| 45 | const TVector<T>& Cle, const TVector<T>& Clb, | 
|---|
| 46 | const r_8 fwhm) const; | 
|---|
| 47 |  | 
|---|
| 48 |  | 
|---|
| 49 | void DecomposeToAlm(SphericalMap<T>& map, Alm<T>& alm, int_4 nlmax, r_8 cos_theta_cut, int iterationOrder) const; | 
|---|
| 50 | void DecomposeToAlm(const SphericalMap<T>& map, Alm<T>& alm, int_4 nlmax, r_8 cos_theta_cut) const; | 
|---|
| 51 |  | 
|---|
| 52 | void DecomposeToAlm(SphericalMap<T>& mapq, | 
|---|
| 53 | SphericalMap<T>& mapu, | 
|---|
| 54 | Alm<T>& alme, | 
|---|
| 55 | Alm<T>& almb, | 
|---|
| 56 | int_4 nlmax, | 
|---|
| 57 | r_8 cos_theta_cut, | 
|---|
| 58 | int iterationOrder) const; | 
|---|
| 59 | void DecomposeToAlm(const SphericalMap<T>& mapq, | 
|---|
| 60 | const SphericalMap<T>& mapu, | 
|---|
| 61 | Alm<T>& alme, | 
|---|
| 62 | Alm<T>& almb, | 
|---|
| 63 | int_4 nlmax, | 
|---|
| 64 | r_8 cos_theta_cut) const; | 
|---|
| 65 |  | 
|---|
| 66 | TVector<T>  DecomposeToCl(SphericalMap<T>& sph, | 
|---|
| 67 | int_4 nlmax, r_8 cos_theta_cut, int iterationOrder) const; | 
|---|
| 68 |  | 
|---|
| 69 | TVector<T>  DecomposeToCl(const SphericalMap<T>& sph, | 
|---|
| 70 | int_4 nlmax, r_8 cos_theta_cut) const; | 
|---|
| 71 |  | 
|---|
| 72 |  | 
|---|
| 73 | private: | 
|---|
| 74 |  | 
|---|
| 75 | void carteVersAlm(const SphericalMap<T>& map, int_4 nlmax, r_8 cos_theta_cut, Alm<T>& alm) const; | 
|---|
| 76 |  | 
|---|
| 77 | void carteVersAlm(const SphericalMap<T>& mapq, | 
|---|
| 78 | const SphericalMap<T>& mapu, | 
|---|
| 79 | Alm<T>& alme, | 
|---|
| 80 | Alm<T>& almb, | 
|---|
| 81 | int_4 nlmax, | 
|---|
| 82 | r_8 cos_theta_cut) const; | 
|---|
| 83 |  | 
|---|
| 84 |  | 
|---|
| 85 | TVector< complex<T> >  fourierSynthesisFromB(const Bm<complex<T> >& b_m, | 
|---|
| 86 | int_4 nph, r_8 phi0) const; | 
|---|
| 87 | TVector<T>  RfourierSynthesisFromB(const Bm<complex<T> >& b_m, | 
|---|
| 88 | int_4 nph, r_8 phi0) const; | 
|---|
| 89 | TVector< complex<T> > CFromFourierAnalysis(int_4 mmax, | 
|---|
| 90 | const TVector<complex<T> > datain, | 
|---|
| 91 | r_8 phi0) const; | 
|---|
| 92 | //  TVector< complex<T> > CFromFourierAnalysis(int_4 mmax, | 
|---|
| 93 | //                     const TVector<T> datain, | 
|---|
| 94 | //                              r_8 phi0) const; | 
|---|
| 95 | void CFromFourierAnalysis(int_4 mmax, const TVector<T> datain, | 
|---|
| 96 | TVector< complex<T> >& dataout, | 
|---|
| 97 | r_8 phi0) const; | 
|---|
| 98 |  | 
|---|
| 99 | void almFromWX(int_4 nlmax, int_4 nmmax, r_8 phi0, | 
|---|
| 100 | r_8 domega, r_8 theta, | 
|---|
| 101 | const TVector<T>& dataq, const TVector<T>& datau, | 
|---|
| 102 | Alm<T>& alme, Alm<T>& almb) const; | 
|---|
| 103 | void almFromPM(int_4 nph, int_4 nlmax, int_4 nmmax, | 
|---|
| 104 | r_8 phi0, r_8 domega, r_8 theta, | 
|---|
| 105 | const TVector<T>& dataq, const TVector<T>& datau, | 
|---|
| 106 | Alm<T>& alme, Alm<T>& almb) const; | 
|---|
| 107 |  | 
|---|
| 108 | void mapFromWX(int_4 nlmax, int_4 nmmax, | 
|---|
| 109 | SphericalMap<T>& mapq, SphericalMap<T>& mapu, | 
|---|
| 110 | const Alm<T>& alme, const Alm<T>& almb, bool healpix) const; | 
|---|
| 111 |  | 
|---|
| 112 |  | 
|---|
| 113 | void mapFromPM(int_4 nlmax, int_4 nmmax, | 
|---|
| 114 | SphericalMap<T>& mapq, SphericalMap<T>& mapu, | 
|---|
| 115 | const Alm<T>& alme, const Alm<T>& almb) const; | 
|---|
| 116 |  | 
|---|
| 117 |  | 
|---|
| 118 |  | 
|---|
| 119 | FFTServerInterface* fftIntfPtr_; | 
|---|
| 120 |  | 
|---|
| 121 | }; | 
|---|
| 122 | } // Fin du namespace | 
|---|
| 123 |  | 
|---|
| 124 |  | 
|---|
| 125 | #endif | 
|---|