Changeset 487 in Sophya


Ignore:
Timestamp:
Oct 21, 1999, 4:02:14 PM (26 years ago)
Author:
ansari
Message:

suppression de sorties inutiles 21-OCT-99 GLM

Location:
trunk/SophyaLib/Samba
Files:
4 edited

Legend:

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

    r473 r487  
    1111}
    1212     
    13 extern "C"
    14 {
    15 void anafast_(int&,int&,int&,double&,float*,float*,float*,float*,float*,float*,float*);
    16 void synfast_(int&,int&,int&,int&,float&,float*,float*,float*,double*,double*,double*,double*,double*,float*);
    17 }
    1813
    1914//*******************************************************************
     
    2520PIXELS_XY::PIXELS_XY()
    2621{
    27   cout << " appel du constructeur PIXELS_XY " <<endl;
    2822  pix2x_.ReSize(1024);
    2923  pix2x_.Reset();
     
    189183//--
    190184{
    191   cout<<" appel du constructeur SphereGorski ()" <<endl;
    192185  InitNul();
    193186}
     
    202195//--
    203196{
    204   cout<<" appel du constructeur SphereGorski (m)" <<endl;
    205197
    206198  if(m <= 0 || m > 8192)
     
    233225  pixels_= s.pixels_;
    234226
    235   nlmax_= s.nlmax_;
    236   nmmax_= s.nmmax_;
    237   iseed_= s.iseed_;
    238   fwhm_ = s.fwhm_;
    239   quadrupole_ = s.quadrupole_;
    240   sym_cut_deg_= s.sym_cut_deg_;
    241   strcpy(powFile_,s.powFile_);
    242227}
    243228
     
    322307  pixels_.Reset();
    323308
    324   nlmax_= 0;
    325   nmmax_= 0;
    326   iseed_= 0;
    327   fwhm_ = 0.;
    328   quadrupole_ = 0.;
    329   sym_cut_deg_= 0.;
    330   for(int k = 0; k < 128; k++) powFile_[k]=' ';
    331309}
    332310
     
    550528}
    551529
    552 /*
    553 //++
    554 template<class T>
    555 void SphereGorski<T>::anharm(int nlmax, float sym_c,float* powspec)
    556 //
    557 //    analyse en harmoniques spheriques des valeurs des pixels de la
    558 //    sphere : appel du module anafast (Gorski-Hivon)
    559 //
    560 //    "nlmax"   : multipole maximum, nlmax <= 2*nsmax (cf. Nyquist)
    561 //
    562 //    "sym c"   : coupure symetrique autour de l'equateur (degres)
    563 //
    564 //    "powspec" : tableau resultat (a reserver avant l'appel) de C(l)
    565 //    (spectre de puissance)
    566 //
    567 //--
    568 //
    569 // Pb a resoudre : dans cette classe les valeurs de pixel sont "double"
    570 // dans anafast le tableau correspondant est "float"
    571 // pour l'instant on duplique les tableaux, il faudra decider quelque chose
    572 //
    573 {
    574     if (nlmax > 2*nSide_) {
    575           cout << " anharm : nlmax= " << nlmax <<
    576                           " doit etre <= 2*nsmax (cf. Nyquist), soit :" << 2*nSide_ << endl;
    577          exit(1);
    578   }
    579   else {
    580     nlmax_=nlmax;
    581     nmmax_=nlmax_;
    582   }
    583   sym_cut_deg_=sym_c;
    584   float* map=new float[nPix_];
    585   for (int k=0; k<nPix_; k++) map[k]=(float)pixels_(k);
    586   int nsmax=nSide_;
    587   int nmmax=nmmax_;
    588   double sc=(double)sym_cut_deg_;
    589   float* alm_T=new float[2*(nlmax+1)*(nmmax+1)];
    590   if (powspec==NULL) {
    591    
    592     cout <<
    593       " anharm : un tableau de C_l doit etre alloue avant appel " << endl;
    594     exit(1);
    595   }
    596   float* phas_n=new float[2*(nmmax+1)];
    597   float* phas_s=new float[2*(nmmax+1)];
    598   float*  dataw =new float[16*nsmax];
    599   float*  work =new float[16*nsmax];
    600 
    601   anafast_(nsmax,nlmax,nmmax,sc,map,alm_T, powspec,phas_n,phas_s,dataw,work);
    602   quadrupole_=powspec[2];
    603   delete [] map;
    604   delete [] alm_T;
    605   delete [] phas_n;
    606   delete [] phas_s;
    607   delete [] dataw;
    608   delete [] work; 
    609 }
    610 */
    611 
    612 /*
    613 //++
    614 template<class T>
    615 void SphereGorski<T>::synharm(int nlmax, int iseed,float fwhm, float* powspec)
    616 //
    617 //    synthese  des valeurs des pixels de la sphere par l'intermediaire
    618 //    des coefficients en harmoniques spheriques reconstitues apartir d'un
    619 //    spectre en puissance : appel du module synfast (Gorski-Hivon)
    620 //
    621 //    powspec est un tableau (a fournir) de C(l) (spectre de puissance)
    622 //    Ce tableau doit contenir les valeur de C(l) par ordre
    623 //    SEQUENTIEL de l (de l=0 a l=nlmax). IL SERA MODIFIE PAR L'ALGORITHME
    624 //
    625 //    nlmax : multipole maximum (nlmax <= 2*nsmax (cf. Nyquist)
    626 //    iseed : initialisation generation aleatoire (negatif, suggere : -1)
    627 //    fwhm  : largeur totale a mi-hauteur (minutes d'arc, >=0, ex: 5)
    628 //--
    629 // Pb a resoudre : dans cette classe les valeurs de pixel sont "double"
    630 // dans anafast le tableau correspondant est "float"
    631 // pour l'instant on duplique les tableaux, il faudra decider quelque chose
    632 
    633 {
    634   if (nlmax > 2*nSide_) {
    635     cout << " sphereGorski::synharm: nlmax= " << nlmax <<
    636             " doit etre <= 2*nsmax (cf. Nyquist), soit : " << 2*nSide_ << endl;
    637     exit(1);
    638   }
    639   else {
    640     nlmax_=nlmax;
    641     nmmax_=nlmax_;
    642     quadrupole_=powspec[2];
    643   }
    644   if (powspec==NULL) {
    645    
    646     cout <<
    647       "sphereGorski::synharm : un tableau de C_l doit etre alloue avant appel"
    648          << endl;
    649     exit(1);
    650   }
    651   iseed_=iseed;
    652   fwhm_ =fwhm;
    653   float* map=new float[nPix_];
    654   int nsmax=nSide_;
    655   int nmmax=nmmax_;
    656   float* alm_T=new float[2*(nlmax+1)*(nmmax+1)];
    657 
    658   //    tableaux de travail
    659   double* b_north=new double[2*(2*nmmax+1)];
    660   double* b_south=new double[2*(2*nmmax+1)];
    661   double* bw=new double[2*4*nsmax];
    662   double* data=new double[2*4*nsmax];
    663   double* work=new double[2*4*nsmax];
    664   float* lread=new float[nlmax+1];
    665   synfast_(nsmax,nlmax,nmmax,iseed,fwhm, map,alm_T, powspec,
    666                   b_north,b_south,bw,data,work,lread);
    667   for (int k=0; k<nPix_; k++) pixels_(k) = (T)map[k];
    668   delete [] map;
    669   delete [] alm_T;
    670   delete [] b_north;
    671   delete [] b_south;
    672   delete [] bw;
    673   delete [] data;
    674   delete [] work;
    675   delete [] lread;
    676 }
    677 */
    678530
    679531template<class T>
     
    11951047}
    11961048
    1197 // retourne le nom du fichier qui contient le spectre de puissance
    1198 template<class T>
    1199 void SphereGorski<T>::powfile(char filename[]) const
    1200 {
    1201   bool status = false;
    1202   for (int k=0; k< 128; k++)
    1203     {
    1204       if( powFile_[k] != ' ' )
    1205         {
    1206           status = true;
    1207           break;
    1208         }
    1209     }
    1210   if ( status )
    1211     {
    1212       strcpy(filename,powFile_);
    1213     }
    1214   else
    1215     {
    1216       strcpy(filename,"no file");
    1217     }
    1218 }
    1219 
    1220 template<class T>
    1221 void SphereGorski<T>::getParafast(int& nlmax,int& nmmax,int& iseed,float& fwhm,float& quadr,float& cut) const
    1222 {
    1223   nlmax= nlmax_;
    1224   nmmax= nmmax_;
    1225   iseed= iseed_;
    1226   fwhm = fwhm_;
    1227   quadr= quadrupole_;
    1228   cut  = sym_cut_deg_;
    1229 }
    1230 
    1231 template<class T>
    1232 void SphereGorski<T>::setParafast(int nlmax,int nmmax,int iseed,float fwhm,float quadr,float cut,char* filename)
    1233 {
    1234   nlmax_= nlmax;
    1235   nmmax_= nmmax;
    1236   iseed_= iseed;
    1237   fwhm_ = fwhm;
    1238   quadrupole_ = quadr;
    1239   sym_cut_deg_= cut;
    1240   strcpy(powFile_,filename);
    1241 }
     1049
    12421050
    12431051template <class T>
     
    12501058  os << " omeg_ = " << omeg_   << endl;
    12511059
    1252   os << " contenu de pixels : ";
     1060  os << " content of pixels : ";
    12531061  for(int i=0; i < nPix_; i++)
    12541062    {
     
    12591067
    12601068  os << endl;
    1261   const PIXELS_XY& PXY= PIXELS_XY::instance();
    1262 
    1263   os << endl;  os << " contenu des tableaux conversions "<<endl;
    1264   for(int i=0; i < 5; i++)
    1265     {
    1266       os<<PXY.pix2x_(i)<<", "<<PXY.pix2y_(i)<<", "<<PXY.x2pix_(i)<<", "<<PXY.y2pix_(i)<<endl;
    1267     }
     1069  //const PIXELS_XY& PXY= PIXELS_XY::instance();
     1070
     1071  //os << endl;  os << " contenu des tableaux conversions "<<endl;
     1072  //for(int i=0; i < 5; i++)
     1073  //  {
     1074  //   os<<PXY.pix2x_(i)<<", "<<PXY.pix2y_(i)<<", "<<PXY.x2pix_(i)<<", "<<PXY.y2pix_(i)<<endl;
     1075  // }
    12681076  os << endl;
    12691077
    1270   os << " les parametres des modules anafast et synfast " <<endl;
    1271   os << " nlmax, nmmax & iseed= " <<nlmax_<<", "<<nmmax_<<", "<<iseed_<<endl;
    1272   os << " fwhm, quadr & cut = "<<fwhm_<<", "<<quadrupole_<<", "<<sym_cut_deg_<<endl;
    1273   os << " powfile= " << powFile_<<endl;
    12741078}
    12751079
     
    13571161  delete [] pixels;
    13581162
    1359   int nlmax,nmmax,iseed;
    1360   is.GetI4(nlmax);
    1361   is.GetI4(nmmax);
    1362   is.GetI4(iseed);
    1363  
    1364   float fwhm,quadr,cut;
    1365   is.GetR4(fwhm);
    1366   is.GetR4(quadr);
    1367   is.GetR4(cut);
    1368 
    1369   char powfl[128];
    1370   is.GetLine(powfl, 127);
    1371 
    1372   dobj->setParafast(nlmax,nmmax,iseed,fwhm,quadr,cut,powfl);
    13731163}
    13741164
     
    14061196  PIOSWriteArray(os,(dobj->getDataBlock())->Data(), nPix);
    14071197
    1408   int nlmax,nmmax,iseed;
    1409   float fwhm,quadr,cut;
    1410   dobj->getParafast(nlmax,nmmax,iseed,fwhm,quadr,cut);
    1411   os.PutI4(nlmax);
    1412   os.PutI4(nmmax);
    1413   os.PutI4(iseed);
    1414   os.PutR4(fwhm);
    1415   os.PutR4(quadr);
    1416   os.PutR4(cut);
    1417 
    1418   char powfl[128];
    1419   dobj->powfile(powfl);
    1420   os.PutLine(powfl);
     1198
    14211199}
    14221200
  • trunk/SophyaLib/Samba/spheregorski.h

    r473 r487  
    99#include "ppersist.h"
    1010
    11 // les attributs de classe pix2x_ et pix2y_ sont relatifs a la traduction des
    12 // indices  RING en indices NESTED (ou l inverse). Ce sont des tableaux
    13 // d'entiers initialises et remplis par le constructeur. Dans la version
    14 // FORTRAN de healpix, il s'agissait de tableaux mis en COMMON. Ils etaient
    15 // initialises au premier appel d'une conversion d indice. Je ne peux pas
    16 // garder cette procedure car, par exemple, la fonction PixValNest() const
    17 // n'autorisera pas la constitution de ces tableaux (a cause du const). Ainsi,
    18 // des la creation d un objet SphereGorski ces tableaux sont calcules, ce qui
    19 // est, certes, inutile si on ne se sert pas des indices NESTED. Ca ne me
    20 // rejouit pas, mais c est le seul moyen que j ai trouve pour temir compte de
    21 // toutes les demandes et des options prises.
    22 //
    23 //                                                G. Le Meur
    2411
    2512// ***************** CLASSE SphereGorski *****************************
     
    8774int RingToNest(int) const;
    8875
    89 /* analyse en harmoniques spheriques des valeurs des pixels de la
    90    sphere : appel du module anafast (Gorski-Hivon) */
    91 //void anharm(int, float, float*);
    92  
    93 /*synthese  des valeurs des pixels de la sphere par l'intermediaire
    94   des coefficients en harmoniques spheriques reconstitues apartir d'un
    95   spectre en puissance : appel du module synfast (Gorski-Hivon) */
    96 //void synharm(int, int, float, float*);
    9776
    9877/* retourne/fixe la valeur du parametre Gorski */
     
    10483inline void setDataBlock(T* data,int m) { pixels_.FillFrom(m,data); }
    10584
    106 /* retourne/fixe les parametres des modules anafast et synfast */
    107 void getParafast(int& nlmax,int& nmmax,int& iseed,float& fwhm,float& quadr,float& cut) const;
    108 void setParafast(int nlmax,int nmmax,int iseed,float fwhm,float quadr,float cut,char* filename);
    10985
    110 /* retourne/fixe le nom du fichier qui contient le spectre de puissance */
    111 void powfile(char filename[]) const;
    11286
    11387/* impression */
     
    134108NDataBlock<T> pixels_;
    135109
    136 int nlmax_;
    137 int nmmax_;
    138 int iseed_;
    139 float fwhm_;
    140 float quadrupole_;
    141 float sym_cut_deg_;
    142 char powFile_[128];
    143110};
    144111
  • trunk/SophyaLib/Samba/spherethetaphi.cc

    r473 r487  
    6969}
    7070
    71 /* --Methode-- */
    72 //++
    73 template <class T>
    74 SphereThetaPhi<T>::SphereThetaPhi(char* flnm)
    75 
    76 //    Constructeur : charge une image à partir d'un fichier
    77 //--
    78 {
    79   InitNul();
    80   cout << " ShereThetaPhi:: constructeur lecture sur fichier A FAIRE " << endl;
    81   //PInPersist s(flnm);
    82   //Read(s);
    83 }
    8471
    8572/* --Methode-- */
  • trunk/SophyaLib/Samba/spherethetaphi.h

    r473 r487  
    1919SphereThetaPhi();
    2020SphereThetaPhi(int m);
    21 SphereThetaPhi(char* flnm);
    2221SphereThetaPhi(const SphereThetaPhi<T>& s);
    2322virtual ~SphereThetaPhi();
Note: See TracChangeset for help on using the changeset viewer.