Changeset 668 in Sophya for trunk/SophyaLib/SkyT/easyTest.cc


Ignore:
Timestamp:
Nov 29, 1999, 3:16:10 PM (26 years ago)
Author:
ansari
Message:

Ajout de classes deleguees PPersist et correction integration - Sophie 29/11/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SkyT/easyTest.cc

    r601 r668  
    44#include "specrespvector.h"
    55#include "tvector.h"
    6 // #include "szsource.h"
    76#include "squarefilt.h"
    87#include "trianglefilt.h"
     8
     9#include "iobjspecresp.cc"
     10
    911int
    1012main()
    1113{
     14//   PInPersist in("out");
     15//   SR_ReadSelf(in);
     16//   cout << " " << endl;
     17
     18    PInPersist in2("outTF");
     19    SR_ReadSelf(in2);
     20    cout << " " << endl;
     21
    1222  cout << "BlackBody!" << endl;
    13   BlackBody myBB;
    14   double freqmin =  10.;
    15   double freqmax = 100;
     23  BlackBody myBB(2.73);
     24  double freqmin =  230.;
     25  double freqmax = 500;
    1626  double logIF = myBB.logIntegratedFlux(freqmin,freqmax);
    1727  double IF    = myBB.integratedFlux(freqmin,freqmax);
     
    1929  cout << "nolog " << IF    << endl;
    2030  cout << "min et max " << myBB.minFreq() << " :: " << myBB.maxFreq() << endl;
    21   cout << "full integration no log  " << myBB.integratedFlux() << endl;
    22   cout << "full integration log     " << myBB.logIntegratedFlux() << endl;
     31  cout << "full integration no log  " << myBB.integratedFlux(freqmin,freqmax) << endl;
     32  cout << "full integration log     " << myBB.logIntegratedFlux(freqmin,freqmax) << endl;
     33  cout << "full integration no log nolimit " << myBB.integratedFlux() << endl;
     34  cout << "full integration log  nolimit  " << myBB.logIntegratedFlux() << endl;
    2335
    24   /*
    25   cout << "SZSource " << endl;
    26   SzSource mySZ(1);
    27   double logSZ = mySZ.logIntegratedFlux(freqmin,freqmax);
    28   double SZ    = mySZ.integratedFlux(freqmin,freqmax);
    29   cout << "log   " << logSZ << endl;
    30   cout << "nolog " << SZ    << endl;
    31   cout << "min et max " << mySZ.minFreq() << " :: " << mySZ.maxFreq() << endl;
    32   cout << "full integration no log  " << mySZ.integratedFlux() << endl;
    33   cout << "full integration log     " << mySZ.logIntegratedFlux() << endl;
    34   */
    3536  cout << "squareFilter " << endl;
    36   SquareFilter mySF(0,200);
     37  SquareFilter mySF(200,600);
    3738  double logSF = mySF.logIntegratedSpect(freqmin,freqmax);
    3839  double SF    = mySF.IntegratedSpect(freqmin,freqmax);
     
    4041  cout << "nolog " << SF    << endl;
    4142  cout << "min et max " << mySF.minFreq() << " :: " << mySF.maxFreq() << endl;
    42   cout << "full integration no log  " << mySF.IntegratedSpect() << endl;
    43   cout << "full integration log     " << mySF.logIntegratedSpect() << endl;
     43  cout << "full integration no log  " << mySF.IntegratedSpect(200,700) << endl;
     44  cout << "full integration log     " << mySF.logIntegratedSpect(200,700) << endl;
     45  cout << "full integration no log nolimit  " << mySF.IntegratedSpect() << endl;
     46  cout << "full integration log  nolimit   " << mySF.logIntegratedSpect() << endl;
     47
    4448
    4549  cout << "triangleFilter" << endl;
    46   TriangleFilter myTF(10,200,20,40);
     50  TriangleFilter myTF(200,500,120,40);
    4751  double logTF = myTF.logIntegratedSpect(10.,freqmax);
    4852  double TF    = myTF.IntegratedSpect(10.,freqmax);
     
    5963  for (int i=0; i<maxVal; i++)
    6064    {
    61       vecOfNu(i) = (double)i+30.;
     65      vecOfNu(i) = (double)i+230.;
    6266      vecOfFDeNu(i) = 1.; //*(double)i+1;
    6367      cout << "entry values  " <<  vecOfNu(i) << " " << vecOfFDeNu(i) << endl;
    6468    }
    65   freqmin = 10.;
    66   freqmax = 19.;
     69  freqmin = 200.;
     70  freqmax = 259.;
    6771  RadSpectraVec myRSV(vecOfNu, vecOfFDeNu);
    6872  double RSV    = myRSV.integratedFlux(freqmin,freqmax);
     
    8185  for (int i=0; i<SRVmaxVal; i++)
    8286    {
    83       vecOfNuRSV(i) = (double)i+30.;
     87      vecOfNuRSV(i) = (double)i+130.;
    8488      vecOfFDeNuRSV(i) = 10*(double)i+1;
    8589      //      cout << "entry values  " <<  vecOfNuRSV(i) << " " << vecOfFDeNuRSV(i) << endl;
     
    99103  cout << "...Testing filter and integrate !" << endl;
    100104
    101   cout << " BBSF nolog " << myBB.filteredIntegratedFlux(mySF,30.,100.) << endl;
    102   cout << " BBSF   log " << myBB.filteredLogIntFlux(mySF,30.,100.) << endl;
    103   cout << "full integration no log  " << myBB.integratedFlux(30.,100.) << endl;
    104   cout << "full integration log     " << myBB.logIntegratedFlux(30.,100.) << endl;
     105  cout << " BBSF nolog " << myBB.filteredIntegratedFlux(mySF,200.,400.) << endl;
     106  cout << " BBSF   log " << myBB.filteredLogIntFlux(mySF,200.,400.) << endl;
     107  cout << "full integration no log  " << myBB.integratedFlux(200.,400.) << endl;
     108  cout << "full integration log     " << myBB.logIntegratedFlux(200.,400.) << endl;
    105109  cout << "SF" << endl;
    106   cout << "full integration no log  " << mySF.IntegratedSpect(30.,100.) << endl;
    107   cout << "full integration log     " << mySF.logIntegratedSpect(30.,100.) << endl;
     110  cout << "full integration no log  " << mySF.IntegratedSpect(200.,400.) << endl;
     111  cout << "full integration log     " << mySF.logIntegratedSpect(200.,400.) << endl;
    108112
    109   cout << " BBTF nolog " << myBB.filteredIntegratedFlux(myTF,30.,100.) << endl;
    110   cout << " BBTF   log " << myBB.filteredLogIntFlux(myTF,30.,100.) << endl;
     113  cout << " BBTF nolog " << myBB.filteredIntegratedFlux(myTF,200.,400.) << endl;
     114  cout << " BBTF   log " << myBB.filteredLogIntFlux(myTF,200.,400.) << endl;
    111115  cout << "TF" << endl;
    112   cout << "full integration no log  " << myTF.IntegratedSpect(30.,100.) << endl;
    113   cout << "full integration log     " << myTF.logIntegratedSpect(30.,100.) << endl;
     116  cout << "full integration no log  " << myTF.IntegratedSpect(200.,400.) << endl;
     117  cout << "full integration log     " << myTF.logIntegratedSpect(200.,400.) << endl;
    114118
    115119  /*
     
    123127                           */
    124128  cout << "********" << endl;
    125   cout << " RSVSF nolog " << myRSV.filteredIntegratedFlux(mySF,30.,100.) << endl;
    126   cout << " RSVSF   log " << myRSV.filteredLogIntFlux(mySF,30.,100.) << endl;
    127   cout << "full integration no log  " << myRSV.integratedFlux(30.,100.) << endl;
    128   cout << "full integration log     " << myRSV.logIntegratedFlux(30.,100.) << endl;
     129  double min, max;
     130  min=232;
     131  max=235;
    129132
    130   cout << " RSVTF nolog " << myRSV.filteredIntegratedFlux(myTF,30.,100.) << endl;
    131   cout << " RSVTF   log " << myRSV.filteredLogIntFlux(myTF,30.,100.) << endl;
     133  cout << " RSVSF nolog " << myRSV.filteredIntegratedFlux(mySF,min,max) << endl;
     134  cout << " RSVSF   log " << myRSV.filteredLogIntFlux(mySF,min,max) << endl;
     135  cout << "full integration no log  " << myRSV.integratedFlux(230.,500.) << endl;
     136  cout << "full integration log     " << myRSV.logIntegratedFlux(230.,500.) << endl;
     137  cout << "full integration no log min max " << myRSV.integratedFlux(min,max) << endl;
     138  cout << "full integration log  min max   " << myRSV.logIntegratedFlux(min,max) << endl;
     139
     140  cout << " RSVTF nolog " << myRSV.filteredIntegratedFlux(myTF,230.,500.) << endl;
     141  cout << " RSVTF   log " << myRSV.filteredLogIntFlux(myTF,230.,500.) << endl;
     142 
     143//   cout << "New TESTS USING IOBJS!" << endl;
     144//   POutPersist out("out");
     145//   TriangleFilter* myTF2 = new TriangleFilter(10,200,20,40);
     146//   SR_WriteSelf(myTF2,out);
     147
     148//   POutPersist outV("outV");
     149//   cout << "check before anything" << vecOfNu.NElts()<< endl;
     150//   SpecRespVec* mySRV2 = new SpecRespVec(vecOfNu, vecOfFDeNu);
     151//   SR_WriteSelf(mySRV2,outV);
     152 
     153//   Vector myVec(10);
     154//   myVec.ReSize(10);
     155//   cout << myVec.NElts();
     156//   return 1;
     157
     158  cout << "read and write things in file...ppersist!" << endl;
     159  TriangleFilter myTF2(10,200,20,40);
     160  POutPersist outTF("outTF");
     161  myTF2.WriteSelf(outTF);
     162//   PInPersist inTF("outTF");
     163//   myTF2.ReadSelf(inTF);
    132164 
    133165
    134   return 1;
    135166}
Note: See TracChangeset for help on using the changeset viewer.