Changeset 880 in Sophya for trunk/SophyaProg


Ignore:
Timestamp:
Apr 11, 2000, 3:34:55 PM (25 years ago)
Author:
ansari
Message:

Adaptation SphereGorski -> SphereHEALPix apres modifs Sophie - Reza 11/4/2000

Location:
trunk/SophyaProg/PMixer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaProg/PMixer/extractRS.cc

    r877 r880  
    1212#include "tvector.h"
    1313#include "vector3d.h"
    14 #include "nbrandom.h"
     14#include "srandgen.h"
    1515#include "timing.h"
    1616#include "sambainit.h"
     
    8888 
    8989 
    90   cout << " extractRS/Info : NComp = " <<  nskycomp << " SphereGorski_NSide= " << hp_nside << endl;
     90  cout << " extractRS/Info : NComp = " <<  nskycomp << " SphereHEALPix_NSide= " << hp_nside << endl;
    9191  cout << "  ... MapPath = " << (string)mapPath << "  DebugLev= " << debuglev
    9292       << "  PrintLev= " << printlev << endl;
     
    9595  // We create an output persist file for writing debug objects
    9696  if (debuglev > 0) so = new POutPersist("extrRSdbg.ppf");
    97   SphereGorski<float> SourceMap(hp_nside);
    98   SphereGorski<float> OutputMap(hp_nside);
     97  SphereHEALPix<float> SourceMap(hp_nside);
     98  SphereHEALPix<float> OutputMap(hp_nside);
    9999  bool okout = true;
    100100 
     
    190190        K = dc.DParam(key, 1, 1.);
    191191        if (debuglev > 4) {  // Writing the input map to the outppf
    192           FIO_TMatrix<float> fiog;
     192          FIO_TArray<float> fiog;
    193193          fiog.Write(*so, key);
    194194        }
     
    282282      //        MeanSig(SourceMap.DataBlock(),moy,sig);
    283283      //        cout << " MeanSig for Source Map - Mean= " << moy << " Sigma= " << sig << endl;
    284       //        cout << "Source Map (SphereGorski<float>) written to FITS file "
     284      //        cout << "Source Map (SphereHEALPix<float>) written to FITS file "
    285285      //             << (string)(arg[3]) << endl;
    286286      //       }
     
    291291        MeanSig(OutputMap.DataBlock(),moy,sig);
    292292        cout << " MeanSig for Output Map - Mean= " << moy << " Sigma= " << sig << endl;
    293         cout << "Output Map (SphereGorski<float>) written to FITS file "
     293        cout << "Output Map (SphereHEALPix<float>) written to FITS file "
    294294             << (string)(arg[2]) << endl;
    295295      }
     
    298298      if (narg > 2) {
    299299        POutPersist s(arg[3]);
    300         FIO_SphereGorski<float> fiog(OutputMap);
     300        FIO_SphereHEALPix<float> fiog(OutputMap);
    301301        fiog.Write(s);
    302         cout << "Output Map (SphereGorski<float>) written to POutPersist file " 
     302        cout << "Output Map (SphereHEALPix<float>) written to POutPersist file " 
    303303             << (string)(arg[3]) << endl;
    304304        if(printlev>2) PrtTim("End of WritePPF ");
  • trunk/SophyaProg/PMixer/skymixer.cc

    r876 r880  
    1515#include "fitsioserver.h"
    1616
    17 #include "spheregorski.h"
     17#include "spherehealpix.h"
     18#include "fiospherehealpix.h"
    1819
    1920#include "radspecvector.h"
     
    5152//
    5253template <class T>
    53 void addComponentBeta(SphereGorski<T>& finalMap,
    54                       SphereGorski<T>& mapToAdd,SpectralResponse& sr,
    55                       SphereGorski<T>& betaMap, double normFreq, double K);
     54void addComponentBeta(SphereHEALPix<T>& finalMap,
     55                      SphereHEALPix<T>& mapToAdd,SpectralResponse& sr,
     56                      SphereHEALPix<T>& betaMap, double normFreq, double K);
    5657//
    5758template <class T>
    5859void integratedMap(SpectralResponse&  sr,   
    59                    SphereGorski<T>& betaMap, double normFreq, SphereGorski<T>& intBetaMap);
     60                   SphereHEALPix<T>& betaMap, double normFreq, SphereHEALPix<T>& intBetaMap);
    6061  //template <class T>
    6162  //void integratedMap(SpectralResponse&  sr,   
     
    6465  //                          PixelMap<T>& outMap);
    6566template <class T>
    66 void addComponentBeta(SphereGorski<T>& finalMap,
    67                       SphereGorski<T>& mapToAdd,
    68                       SphereGorski<T>& intBetaMap, double K);
     67void addComponentBeta(SphereHEALPix<T>& finalMap,
     68                      SphereHEALPix<T>& mapToAdd,
     69                      SphereHEALPix<T>& intBetaMap, double K);
    6970//
    7071// -----------------------------------------------------------------
     
    119120
    120121
    121 cout << " skymix/Info : NComp = " <<  nskycomp << " SphereGorski_NSide= " << hp_nside << endl;
     122cout << " skymix/Info : NComp = " <<  nskycomp << " SphereHEALPix_NSide= " << hp_nside << endl;
    122123cout << "  ... MapPath = " << (string)mapPath << "  DebugLev= " << debuglev
    123124     << "  PrintLev= " << printlev << endl;
     
    126127if (debuglev > 0) so = new POutPersist("skymixdbg.ppf");
    127128
    128 SphereGorski<float> outgs(hp_nside);
     129SphereHEALPix<float> outgs(hp_nside);
    129130bool okout = false;
    130131
     
    156157  string key;
    157158
    158   SphereGorski<float> ings(hp_nside);  // The input map
     159  SphereHEALPix<float> ings(hp_nside);  // The input map
    159160  double K = 1.;
    160161  double freqOfMap = 1.;
     
    182183    fios.load(ings, flnm, 2);
    183184    if (debuglev > 4) {  // Writing the input map to the outppf
    184       FIO_SphereGorski<float> fiog(ings);
     185      FIO_SphereHEALPix<float> fiog(ings);
    185186      fiog.Write(*so, key);
    186187    }
     
    199200      {
    200201        key = (string)"BETAFITSFILE"+ buff;
    201         SphereGorski<float> betaMap;
     202        SphereHEALPix<float> betaMap;
    202203        flnm = BuildFITSFileName(dc.SParam(key, 0));
    203204        double normFreq = dc.DParam(key, 1, 1.);
     
    215216          {
    216217            // integrate the betamap over the SpectralResponse
    217             SphereGorski<float> intBetaMap(nSideForInt);
     218            SphereHEALPix<float> intBetaMap(nSideForInt);
    218219            integratedMap(*sr, betaMap, normFreq, intBetaMap);
    219220            betaMap.Resize(8);
     
    248249  FitsIoServer fios;
    249250  fios.save(outgs, arg[2]);
    250   cout << "Output Map (SphereGorski<float>) written to FITS file "
     251  cout << "Output Map (SphereHEALPix<float>) written to FITS file "
    251252       << (string)(arg[2]) << endl;
    252253  PrtTim("End of WriteFITS ");
     
    254255  if (narg > 3) {
    255256   POutPersist s(arg[3]);
    256    FIO_SphereGorski<float> fiog(&outgs) ;
     257   FIO_SphereHEALPix<float> fiog(&outgs) ;
    257258   fiog.Write(s);
    258    cout << "Output Map (SphereGorski<float>) written to POutPersist file " 
     259   cout << "Output Map (SphereHEALPix<float>) written to POutPersist file " 
    259260        << (string)(arg[3]) << endl;
    260261   PrtTim("End of WritePPF ");
     
    503504/* Nouvelle-Fonction */
    504505template <class T>
    505 void addComponentBeta(SphereGorski<T>& finalMap,
    506                       SphereGorski<T>& mapToAdd,SpectralResponse& sr,
    507                       SphereGorski<T>& betaMap, double normFreq, double K)
     506void addComponentBeta(SphereHEALPix<T>& finalMap,
     507                      SphereHEALPix<T>& mapToAdd,SpectralResponse& sr,
     508                      SphereHEALPix<T>& betaMap, double normFreq, double K)
    508509{
    509510  // finalMap = finalMap + coeff* mapToAdd
     
    520521      cout << "nb pixels: " << finalMap.NbPixels() << endl;
    521522    }
    522   SphereGorski<T> bigBetaMap(sqrt(nbpix/12));
     523  SphereHEALPix<T> bigBetaMap(sqrt(nbpix/12));
    523524  if(nbpix != betaMap.NbPixels())
    524525    {
     
    537538template <class T>
    538539void integratedMap(SpectralResponse&  sr,   
    539                    SphereGorski<T>& betaMap,
     540                   SphereHEALPix<T>& betaMap,
    540541                   double normFreq,
    541                    SphereGorski<T>& intBetaMap)
     542                   SphereHEALPix<T>& intBetaMap)
    542543{
    543544  //  int nbpix = intBetaMap.NbPixels();
    544   //  SphereGorski<T> newMap(sqrt(nbpix/12));
     545  //  SphereHEALPix<T> newMap(sqrt(nbpix/12));
    545546  Sph2Sph(betaMap,intBetaMap);
    546547  for(int i=0; i<intBetaMap.NbPixels(); i++)
     
    554555
    555556template <class T>
    556 void addComponentBeta(SphereGorski<T>& finalMap,
    557                       SphereGorski<T>& mapToAdd,SphereGorski<T>& intBetaMap, double K)
     557void addComponentBeta(SphereHEALPix<T>& finalMap,
     558                      SphereHEALPix<T>& mapToAdd,SphereHEALPix<T>& intBetaMap, double K)
    558559{
    559560  // finalMap = finalMap + coeff* mapToAdd
     
    575576    {
    576577      cout << "nbpix != intBetaMap.NbPixels()" << endl;
    577       SphereGorski<T> bigBetaMap(sqrt(nbpix/12));
     578      SphereHEALPix<T> bigBetaMap(sqrt(nbpix/12));
    578579      cout << "new map with size corresponding to mapToAdd" <<  sqrt(nbpix/12) << endl;
    579580      Sph2Sph(intBetaMap,bigBetaMap);
Note: See TracChangeset for help on using the changeset viewer.