| 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;
 | 
|---|
| 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 | */
 | 
|---|
| 30 |   void SetFFTServer(FFTServerInterface* srv=NULL) 
 | 
|---|
| 31 |     {
 | 
|---|
| 32 |       if (fftIntfPtr_!=NULL) delete fftIntfPtr_;
 | 
|---|
| 33 |       fftIntfPtr_=srv;
 | 
|---|
| 34 |       fftIntfPtr_->setNormalize(false);
 | 
|---|
| 35 |     }
 | 
|---|
| 36 | 
 | 
|---|
| 37 |   void GenerateFromAlm( SphericalMap<T>& map, int_4 pixelSizeIndex, const Alm<T>& alm) const; 
 | 
|---|
| 38 |   void GenerateFromAlm(SphericalMap<T>& mapq, SphericalMap<T>& mapu, int_4 pixelSizeIndex, const Alm<T>& alme,    const Alm<T>& almb) const;
 | 
|---|
| 39 | 
 | 
|---|
| 40 |   void GenerateFromCl(SphericalMap<T>& sph, int_4 pixelSizeIndex,
 | 
|---|
| 41 |                      const TVector<T>& Cl, const r_8 fwhm) const; 
 | 
|---|
| 42 |   void GenerateFromCl(SphericalMap<T>& sphq, SphericalMap<T>& sphu, 
 | 
|---|
| 43 |                      int_4 pixelSizeIndex,
 | 
|---|
| 44 |                      const TVector<T>& Cle, const TVector<T>& Clb, 
 | 
|---|
| 45 |                     const r_8 fwhm) const; 
 | 
|---|
| 46 | 
 | 
|---|
| 47 | 
 | 
|---|
| 48 | void DecomposeToAlm(SphericalMap<T>& map, Alm<T>& alm, int_4 nlmax, r_8 cos_theta_cut, int iterationOrder) const;
 | 
|---|
| 49 | void DecomposeToAlm(const SphericalMap<T>& map, Alm<T>& alm, int_4 nlmax, r_8 cos_theta_cut) const;
 | 
|---|
| 50 | 
 | 
|---|
| 51 | void DecomposeToAlm(SphericalMap<T>& mapq,
 | 
|---|
| 52 |                     SphericalMap<T>& mapu,
 | 
|---|
| 53 |                     Alm<T>& alme,
 | 
|---|
| 54 |                     Alm<T>& almb,
 | 
|---|
| 55 |                     int_4 nlmax,
 | 
|---|
| 56 |                     r_8 cos_theta_cut, 
 | 
|---|
| 57 |                     int iterationOrder) const;
 | 
|---|
| 58 | void DecomposeToAlm(const SphericalMap<T>& mapq,
 | 
|---|
| 59 |                     const SphericalMap<T>& mapu,
 | 
|---|
| 60 |                     Alm<T>& alme,
 | 
|---|
| 61 |                     Alm<T>& almb,
 | 
|---|
| 62 |                     int_4 nlmax,
 | 
|---|
| 63 |                     r_8 cos_theta_cut) const;
 | 
|---|
| 64 | 
 | 
|---|
| 65 | TVector<T>  DecomposeToCl(SphericalMap<T>& sph,  
 | 
|---|
| 66 |                            int_4 nlmax, r_8 cos_theta_cut, int iterationOrder) const;
 | 
|---|
| 67 | 
 | 
|---|
| 68 | TVector<T>  DecomposeToCl(const SphericalMap<T>& sph,  
 | 
|---|
| 69 |                            int_4 nlmax, r_8 cos_theta_cut) const;
 | 
|---|
| 70 | 
 | 
|---|
| 71 | 
 | 
|---|
| 72 |  private:
 | 
|---|
| 73 | 
 | 
|---|
| 74 | void carteVersAlm(const SphericalMap<T>& map, int_4 nlmax, r_8 cos_theta_cut, Alm<T>& alm) const;
 | 
|---|
| 75 | 
 | 
|---|
| 76 | void carteVersAlm(const SphericalMap<T>& mapq,
 | 
|---|
| 77 |                   const SphericalMap<T>& mapu,
 | 
|---|
| 78 |                   Alm<T>& alme,
 | 
|---|
| 79 |                   Alm<T>& almb,
 | 
|---|
| 80 |                   int_4 nlmax,
 | 
|---|
| 81 |                   r_8 cos_theta_cut) const;
 | 
|---|
| 82 | 
 | 
|---|
| 83 | 
 | 
|---|
| 84 | TVector< complex<T> >  fourierSynthesisFromB(const Bm<complex<T> >& b_m,  
 | 
|---|
| 85 |                                   int_4 nph, r_8 phi0) const;
 | 
|---|
| 86 | TVector<T>  RfourierSynthesisFromB(const Bm<complex<T> >& b_m,  
 | 
|---|
| 87 |                                   int_4 nph, r_8 phi0) const;
 | 
|---|
| 88 | TVector< complex<T> > CFromFourierAnalysis(int_4 mmax, 
 | 
|---|
| 89 |                                   const TVector<complex<T> > datain,
 | 
|---|
| 90 |                                   r_8 phi0) const;
 | 
|---|
| 91 |   //  TVector< complex<T> > CFromFourierAnalysis(int_4 mmax, 
 | 
|---|
| 92 |   //                     const TVector<T> datain,  
 | 
|---|
| 93 |   //                              r_8 phi0) const;
 | 
|---|
| 94 |   void CFromFourierAnalysis(int_4 mmax, const TVector<T> datain,
 | 
|---|
| 95 |                             TVector< complex<T> >& dataout,
 | 
|---|
| 96 |                             r_8 phi0) const;
 | 
|---|
| 97 | 
 | 
|---|
| 98 |   void almFromWX(int_4 nlmax, int_4 nmmax, r_8 phi0, 
 | 
|---|
| 99 |                r_8 domega, r_8 theta, 
 | 
|---|
| 100 |                const TVector<T>& dataq, const TVector<T>& datau,
 | 
|---|
| 101 |                Alm<T>& alme, Alm<T>& almb) const;
 | 
|---|
| 102 |   void almFromPM(int_4 nph, int_4 nlmax, int_4 nmmax, 
 | 
|---|
| 103 |                r_8 phi0, r_8 domega, r_8 theta, 
 | 
|---|
| 104 |                const TVector<T>& dataq, const TVector<T>& datau,
 | 
|---|
| 105 |                Alm<T>& alme, Alm<T>& almb) const;
 | 
|---|
| 106 | 
 | 
|---|
| 107 |   void mapFromWX(int_4 nlmax, int_4 nmmax,
 | 
|---|
| 108 |                SphericalMap<T>& mapq, SphericalMap<T>& mapu, 
 | 
|---|
| 109 |                const Alm<T>& alme, const Alm<T>& almb) const;
 | 
|---|
| 110 | 
 | 
|---|
| 111 | 
 | 
|---|
| 112 |   void mapFromPM(int_4 nlmax, int_4 nmmax,
 | 
|---|
| 113 |                SphericalMap<T>& mapq, SphericalMap<T>& mapu, 
 | 
|---|
| 114 |                const Alm<T>& alme, const Alm<T>& almb) const;
 | 
|---|
| 115 | 
 | 
|---|
| 116 | 
 | 
|---|
| 117 | 
 | 
|---|
| 118 |  FFTServerInterface* fftIntfPtr_;
 | 
|---|
| 119 | 
 | 
|---|
| 120 | };
 | 
|---|
| 121 | } // Fin du namespace
 | 
|---|
| 122 | 
 | 
|---|
| 123 | 
 | 
|---|
| 124 | #endif
 | 
|---|