Changeset 1191 in Sophya


Ignore:
Timestamp:
Sep 19, 2000, 2:28:59 PM (25 years ago)
Author:
ansari
Message:

cleaned up for maching LevelS upgrade ongoing

D.Y.

Location:
trunk/SigPredictor
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/SigPredictor/abscalctool.cc

    r1154 r1191  
    5454}
    5555
    56 double AbsCalcTool::diffSolidAng(double ang1,double ang2) const
    57 {       return fabs(2*M_PI*(cos(ang1)-cos(ang2)));              // Steradians
    58                 // Cas d'une source Žtendue.
    59 }
     56
    6057
    6158/*      // Pour compilation sur cxx boeuf!
  • trunk/SigPredictor/abscalctool.h

    r1154 r1191  
    6767            //compute solid angle between cones of aperture angles ang1 and ang2
    6868 
    69         virtual double diffSolidAng(double ang1,double ang2) const;
     69        double diffSolidAng(double ang1,double ang2) const
     70        {       return fabs(2*M_PI*(cos(ang1)-cos(ang2)));              // Steradians
     71        }
    7072
    7173};
  • trunk/SigPredictor/abslightsource.h

    r1148 r1191  
    1616//friend class SigCalcTool;
    1717public:
    18   AbsLightSource() :PtSourceS(false), QPtSource(false), LScrFSep(false), IsLSrcMappedPower (false)
     18  AbsLightSource() : QPtSource(false), LScrFSep(false), IsLSrcMappedPower (false)
    1919  {     sprintf(Name, "");
    2020  }
     
    3636     return resolution;     // constructeur have to initialise res
    3737  }
    38  
    39   inline bool IsPtSourceS() { return PtSourceS;}
    4038  inline bool IsQPtSrc() { return QPtSource;}
    4139  inline bool IsFreqSep() { return LScrFSep;}
     
    7472        return 0;
    7573  }
    76   double planckSpectrum(double freq, double Tempe=T_CMBR);
     74  static double planckSpectrum(double freq, double Tempe=T_CMBR);
    7775  // W/m2/st/Hz
    78   double planckSpecDiff(double DTempe, double freq, double Tempe=T_CMBR);
     76  static double planckSpecDiff(double DTempe, double freq, double Tempe=T_CMBR);
    7977  // W/m2/St/Hz
    8078protected:
    81   bool PtSourceS;  // Is a set of PtSources (Galaxie IR ponctuelles?)
     79//  bool PtSourceS;  // Is a set of PtSources (Galaxie IR ponctuelles?)
    8280  bool QPtSource;    // Is this a QuasiPointSource. (Sun, Jupiter, Mars et al.)
    8381  bool LScrFSep;         // Are spatial coordinated and frequency separable variables?
    8482  bool IsLSrcMappedPower;       // Is the LSrc a in band map power. Valid only for Lobes separabe in freq.
    8583  double resolution; // Map Pixellisation resolution.;
    86   char Name[32];
     84  char Name[128];
    8785};
    8886
  • trunk/SigPredictor/alllightsources.h

    r801 r1191  
    88#include "lightsynchro.h"
    99#include "lightsrcmappowerinband.h"
     10#include "lightptsrclevsinband.h"
    1011#include "quasiptsources.h"
  • trunk/SigPredictor/alllobe.h

    r801 r1191  
    22#include "fastlobes.h"
    33#include "lobes4pi.h"
    4 #include "lobecartographmoyen.h"
     4//#include "lobecartographmoyen.h"              // Aux Oubliettes!
     5#include "lobelevshealpix.h"
  • trunk/SigPredictor/lightptsrclevsinband.cc

    r1151 r1191  
    2828        while (HFI)
    2929        {       // Data in file in radian and Jansky
     30        //      cout<<compteur<<'\t'<<HFI.fail()<<'\n'<<endl;;
    3031                HFI>>theta;
    3132                HFI>>phi;
     
    4445                {       HFI.clear();
    4546                        HFI.getline(Line, 199);
    46                         if(HFI.eof())
     47                        if(HFI.eof())           // Fin de lecture du fichier
    4748                        {       cerr<< "Fin de lecture du fichier: "<<PtSrcfile<<endl;
    4849                                cerr<< "Point source number : "<<MapOfPtSrc.size()<<endl;
     50                                HFI.close();
    4951                                break;
    5052                        }
     
    6769                        UneSource.flux857G=f857*1.e-26;
    6870                       
    69                         const pair<const UnitVector, LevSPtSrcData> UneValeur=make_pair(UnCoord, UneSource);
     71                        const pair<const UnitVector,LevSPtSrcData>UneValeur=make_pair(UnCoord, UneSource);
    7072                       
    7173                        MapOfPtSrc.insert(MapOfPtSrc.end(),UneValeur);
     
    7678        return;
    7779}
     80
     81#include "fitsspherehealpix.h"
     82
     83void LightPtSrcLevSInBand::DumpMap(LevSPanckBand band)
     84{       // Write a Mollweide projection of the Point Sources Sky
     85        // power in the LevSPanckBand band
     86        SphereHEALPix <r_4> Sphere(128);
     87
     88        multimap <UnitVector,LevSPtSrcData,LevSPtSrcCmpUnitVec>::iterator iter;
     89        multimap <UnitVector,LevSPtSrcData,LevSPtSrcCmpUnitVec>::iterator iterBegin=MapOfPtSrc.begin();
     90        multimap <UnitVector,LevSPtSrcData,LevSPtSrcCmpUnitVec>::iterator iterEnd=MapOfPtSrc.end();
     91       
     92        long indexSphere;
     93        double theta;
     94        double phi;
     95        double power;
     96       
     97        for(iter=iterBegin; !(iter==iterEnd); iter++)
     98        {       theta=(*iter).first.Theta();
     99                phi=(*iter).first.Phi();
     100                power=(*iter).second.getPower(band);
     101               
     102                indexSphere=Sphere.PixIndexSph(theta,phi);
     103                Sphere(indexSphere) += power;
     104        }
     105       
     106        FITS_SphereHEALPix <r_4> FSphere(Sphere);
     107        FSphere.Mollweide_picture_projection("SkyOfPtSrcInBandMollweide.fits");
     108
     109        return;
     110}
  • trunk/SigPredictor/lobelevshealpix.cc

    r1152 r1191  
    1 #include "fitsspherehealpix.h"
     1#include <stdlib.h>
     2#include <iostream>
    23#include "lobelevshealpix.h"
    3 
     4#include "lightptsrclevsinband.h"
    45
    56LobeLevSHealpix::LobeLevSHealpix(char FileOflobeMap[],double angMax_degre, double MeanFreq_Hz)
     
    910                cosanglemax=cos(angleMax);
    1011               
    11                 sprintf(Name,"Lobe LevelS Healpix");
     12                sprintf(Name,"Lobe_LevelS_Healpix");
     13               
     14        // Version 4
     15                // On lit la Sphere Healpix
     16                FitsInFile File(FileOflobeMap);
     17                FITS_SphereHEALPix <r_4> FSphere;
     18                FSphere.Read(File);
     19                cerr<<"Lecture des donnŽes du lobe LevelSHealpix"<<endl;
     20               
     21                // On stocke les donnees
     22                pSphere=new SphereHEALPix<r_4> ((SphereHEALPix<r_4>) FSphere );
    1223
    1324/*              // Version 1           
     
    1627                FITS_SphereHEALPix<float> FSphere(*pSphere);
    1728                FSphere.Read(FileOflobeMap);
    18 */
    19 /*              // Version 2
     29
     30                // Version 2
    2031                FITS_SphereHEALPix<float> FSphere(FileOflobeMap);       
    2132                cerr<<"Lecture des donnŽes du lobe LevelSHealpix"<<endl;
    2233                pSphere=new SphereHEALPix<r_4>;
    2334                *pSphere= (SphereHEALPix<r_4>) FSphere;
    24 */             
    25 /*              // Version 3
     35       
     36                // Version 3
    2637                FITS_SphereHEALPix<float> FSphere(FileOflobeMap);       
    2738                cerr<<"Lecture des donnŽes du lobe LevelSHealpix"<<endl;
     
    2940                pSphere=&Sphere;
    3041*/
     42
     43                 
     44/*         pSphere= new SphereHEALPix<float>;
     45           *pSphere= ( SphereHEALPix<float> ) FSphere;
     46*/   
     47           /*
     48                SphereHEALPix <float>* pUNSphere=pFSphere->getObj();
     49                long Nlat=pUNSphere->SizeIndex();
     50                pSphere=new SphereHEALPix <float>(Nlat);
     51                *pSphere=(SphereHEALPix <float>) (*pFSphere);
     52                delete pFSphere;
     53                */
    3154}
    3255
    3356LobeLevSHealpix::~LobeLevSHealpix()
    3457{       delete pSphere;
     58       
    3559}
    3660
     
    3963{       double cosinusZ=VP*VInteg;
    4064        if(cosinusZ<cosanglemax) return 0.;
     65        if(cosinusZ==1.) return (*pSphere)(pSphere->PixIndexSph(0.,0.));
    4166        else
    4267        {       UnitVector VX=VP^VY;
     
    4772               
    4873                double norm=Vproj.Norm();
    49                 if(norm==0.)
    50                 {       phi=0.;}
    51                 else
    52                 {       Vproj/=norm;
    53                         phi = scangle(VY*Vproj,VX*Vproj);       // Fonction de geometry.h
    54                 }                                                                                                       // double scangle(double sinus, double cosinus)         
     74                Vproj/=norm;
     75                phi = scangle(VY*Vproj,VX*Vproj);       // Fonction de geometry.h
     76                                                                                                                // double scangle(double sinus, double cosinus)         
    5577          // double PixNumb = pSphere->PixIndexSph(theta,phi);
    5678           double weigthVal= (*pSphere)(pSphere->PixIndexSph(theta,phi));
  • trunk/SigPredictor/lobelevshealpix.h

    r1152 r1191  
    33
    44#include "meanlobe.h"
    5 #include "spherehealpix.h"
     5#include "fitsspherehealpix.h"
    66
    77class LobeLevSHealpix:public MeanFreqLobe
     
    1010        LobeLevSHealpix(char FileOflobeMap[],double angMax_degre, double MeanFreq_Hz);
    1111        ~LobeLevSHealpix();
    12    const SphereHEALPix<float>& sphere() const { return *pSphere;}
     12   const SphereHEALPix<r_4>& sphere() const {   return *pSphere;}
    1313 protected:
    1414        virtual double ResolutionCurve(double angleShift) const
     
    2121          const UnitVector& VY) const;
    2222               
    23         SphereHEALPix<float>* pSphere;
     23        //FITS_SphereHEALPix<float>* pFSphere;
     24        SphereHEALPix<r_4>* pSphere;
    2425};
    2526
  • trunk/SigPredictor/makebolotimeline.cc

    r1148 r1191  
    33#include <iomanip.h>
    44#include <new>
    5 #ifdef __MWERKS__
    6    #include "macenvvariables.h"
    7 #else
    8         # define ERROR_LABEL -32768
    9 #endif
     5
     6# define ERROR_LABEL -32768
    107
    118#include "makebolotimeline.h"
     
    3835#endif
    3936
     37       
     38        NormRJ=ptool->NormKelvinRayleighJeans();
     39        NormTCMB=ptool->NormKelvinCMB();
    4040        saveReadMe(file);
    4141       
    4242        char filecur[150];
    43         sprintf(filecur,"%s%s.dat", PATHResults,file);
     43        sprintf(filecur,"%s.dat",file);
    4444       
    4545        pMystr= new ofstream(filecur,ios::out|ios::trunc);
     
    5757        }
    5858
    59         sprintf(Name, "%s%s%s",PATHResults,file,".visu");
     59        sprintf(Name, "%s%s",file,".visu");
    6060#endif
    6161}
     
    139139{       char filecur[150];
    140140        // Fill Header file for ascii output
    141         sprintf(filecur,"%s%s.ReadMe", PATHResults,File);
     141        sprintf(filecur,"%s.ReadMe",File);
    142142        cout<<filecur<<endl;
    143143        ofstream ReadMe(filecur,ios::out|ios::trunc);
     
    145145        ReadMe<<" Fichier de timeline pour:"<<endl;
    146146        ptool->print(ReadMe);
    147        
    148         NormRJ=ptool->NormKelvinRayleighJeans();
    149         NormTCMB=ptool->NormKelvinCMB();
     147
    150148       
    151149        ReadMe<< setprecision(3);
  • trunk/SigPredictor/sigcalctools.cc

    r1148 r1191  
    193193  VPerp=VPoin.VperpPhi();
    194194
    195   double dAngShift=AngResComp(0.)*1.1;
     195  double dAngShift=AngResComp(0.);
    196196    // AngleSteps are not necessarily constant.
    197     // factor 1.1 to raise ambiguities in nearby pixel integration
    198197  double lastAngShiftMax;                           
    199198    // Needed to compute accurately solid angle values
     
    317316  VPerp=VPoin.VperpPhi();
    318317
    319   double dAngShift=AngResComp(0.)*1.1;
     318  double dAngShift=AngResComp(0.);
    320319    // AngleSteps are not necessarily constant.
    321     // factor 1.1 to raise ambiguities in nearby pixel integration.
    322320  double lastAngShiftMax;                           
    323321    // Needed to compute accurately solid angle values
     
    460458}
    461459
    462 double SigCalcTool::diffSolidAng(double ang1,double ang2) const
    463 {       double returnVal;               // Steradians
    464         if(!pLSrc->IsPtSourceS()) returnVal= fabs(2*M_PI*(cos(ang1)-cos(ang2)));
    465                 // Cas d'une source Žtendue.
    466         else  returnVal= 1.;
    467                 // Cas d'une source ponctuelle. Sont flux est exprime en W/m2/Hz
    468                 // Pas d'angle solide.
    469         return returnVal;
    470 }
    471 
    472460template void addInInBandPowerMap(PixelMap<float>& Map, SigCalcTool& tool);
    473461template void addInInBandPowerMap(PixelMap<double>& Map, SigCalcTool& tool);
  • trunk/SigPredictor/sigcalctools.h

    r1148 r1191  
    9797        // From a source LSrc, with a lobe parametrised in Lobe, and an additionnal filter Filter
    9898        // WeigthVsFreq
    99 
    100  virtual double diffSolidAng(double ang1,double ang2) const;
    10199};
    102100
Note: See TracChangeset for help on using the changeset viewer.