[601] | 1 | #include <iostream.h>
|
---|
| 2 | #include "blackbody.h"
|
---|
| 3 | #include "radspecvector.h"
|
---|
| 4 | #include "specrespvector.h"
|
---|
| 5 | #include "tvector.h"
|
---|
| 6 | // #include "szsource.h"
|
---|
| 7 | #include "squarefilt.h"
|
---|
| 8 | #include "trianglefilt.h"
|
---|
| 9 | int
|
---|
| 10 | main()
|
---|
| 11 | {
|
---|
| 12 | cout << "BlackBody!" << endl;
|
---|
| 13 | BlackBody myBB;
|
---|
| 14 | double freqmin = 10.;
|
---|
| 15 | double freqmax = 100;
|
---|
| 16 | double logIF = myBB.logIntegratedFlux(freqmin,freqmax);
|
---|
| 17 | double IF = myBB.integratedFlux(freqmin,freqmax);
|
---|
| 18 | cout << "log " << logIF << endl;
|
---|
| 19 | cout << "nolog " << IF << endl;
|
---|
| 20 | 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;
|
---|
| 23 |
|
---|
| 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 | */
|
---|
| 35 | cout << "squareFilter " << endl;
|
---|
| 36 | SquareFilter mySF(0,200);
|
---|
| 37 | double logSF = mySF.logIntegratedSpect(freqmin,freqmax);
|
---|
| 38 | double SF = mySF.IntegratedSpect(freqmin,freqmax);
|
---|
| 39 | cout << "log " << logSF << endl;
|
---|
| 40 | cout << "nolog " << SF << endl;
|
---|
| 41 | 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;
|
---|
| 44 |
|
---|
| 45 | cout << "triangleFilter" << endl;
|
---|
| 46 | TriangleFilter myTF(10,200,20,40);
|
---|
| 47 | double logTF = myTF.logIntegratedSpect(10.,freqmax);
|
---|
| 48 | double TF = myTF.IntegratedSpect(10.,freqmax);
|
---|
| 49 | cout << "log " << logTF << endl;
|
---|
| 50 | cout << "nolog " << TF << endl;
|
---|
| 51 | cout << "min et max " << myTF.minFreq() << " :: " << myTF.maxFreq() << endl;
|
---|
| 52 | cout << "full integration no log " << myTF.IntegratedSpect() << endl;
|
---|
| 53 | cout << "full integration log " << myTF.logIntegratedSpect() << endl;
|
---|
| 54 |
|
---|
| 55 | cout << "....Testing RadSpectraVec..." << endl;
|
---|
| 56 | int maxVal = 10;
|
---|
| 57 | Vector vecOfNu(maxVal);
|
---|
| 58 | Vector vecOfFDeNu(maxVal);
|
---|
| 59 | for (int i=0; i<maxVal; i++)
|
---|
| 60 | {
|
---|
| 61 | vecOfNu(i) = (double)i+30.;
|
---|
| 62 | vecOfFDeNu(i) = 1.; //*(double)i+1;
|
---|
| 63 | cout << "entry values " << vecOfNu(i) << " " << vecOfFDeNu(i) << endl;
|
---|
| 64 | }
|
---|
| 65 | freqmin = 10.;
|
---|
| 66 | freqmax = 19.;
|
---|
| 67 | RadSpectraVec myRSV(vecOfNu, vecOfFDeNu);
|
---|
| 68 | double RSV = myRSV.integratedFlux(freqmin,freqmax);
|
---|
| 69 |
|
---|
| 70 | double logRSV = myRSV.logIntegratedFlux(freqmin,freqmax);
|
---|
| 71 | cout << "nolog int " << RSV << endl;
|
---|
| 72 | cout << "log int " << logRSV << endl;
|
---|
| 73 | cout << "min et max " << myRSV.minFreq() << " :: " << myRSV.maxFreq() << endl;
|
---|
| 74 | cout << "full integration no log " << myRSV.integratedFlux() << endl;
|
---|
| 75 | cout << "full integration log " << myRSV.logIntegratedFlux() << endl;
|
---|
| 76 |
|
---|
| 77 | cout << "....Testing SpecRespVec..." << endl;
|
---|
| 78 | int SRVmaxVal = 100;
|
---|
| 79 | Vector vecOfNuRSV(SRVmaxVal);
|
---|
| 80 | Vector vecOfFDeNuRSV(SRVmaxVal);
|
---|
| 81 | for (int i=0; i<SRVmaxVal; i++)
|
---|
| 82 | {
|
---|
| 83 | vecOfNuRSV(i) = (double)i+30.;
|
---|
| 84 | vecOfFDeNuRSV(i) = 10*(double)i+1;
|
---|
| 85 | // cout << "entry values " << vecOfNuRSV(i) << " " << vecOfFDeNuRSV(i) << endl;
|
---|
| 86 | }
|
---|
| 87 | freqmin = vecOfNuRSV(0);
|
---|
| 88 | freqmax = vecOfNuRSV(SRVmaxVal-1);
|
---|
| 89 | SpecRespVec mySRV(vecOfNuRSV, vecOfFDeNuRSV);
|
---|
| 90 | double SRV = mySRV.IntegratedSpect(freqmin,freqmax);
|
---|
| 91 | double logSRV = mySRV.logIntegratedSpect(freqmin,freqmax);
|
---|
| 92 | cout << "nolog " << SRV << endl;
|
---|
| 93 | cout << "log " << logSRV << endl;
|
---|
| 94 | cout << "min et max " << mySRV.minFreq() << " :: " << mySRV.maxFreq() << endl;
|
---|
| 95 | cout << "full integration no log " << mySRV.IntegratedSpect() << endl;
|
---|
| 96 | cout << "full integration log " << mySRV.logIntegratedSpect() << endl;
|
---|
| 97 |
|
---|
| 98 | cout << "----------------------------------------------------" << endl;
|
---|
| 99 | cout << "...Testing filter and integrate !" << endl;
|
---|
| 100 |
|
---|
| 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 << "SF" << endl;
|
---|
| 106 | cout << "full integration no log " << mySF.IntegratedSpect(30.,100.) << endl;
|
---|
| 107 | cout << "full integration log " << mySF.logIntegratedSpect(30.,100.) << endl;
|
---|
| 108 |
|
---|
| 109 | cout << " BBTF nolog " << myBB.filteredIntegratedFlux(myTF,30.,100.) << endl;
|
---|
| 110 | cout << " BBTF log " << myBB.filteredLogIntFlux(myTF,30.,100.) << endl;
|
---|
| 111 | cout << "TF" << endl;
|
---|
| 112 | cout << "full integration no log " << myTF.IntegratedSpect(30.,100.) << endl;
|
---|
| 113 | cout << "full integration log " << myTF.logIntegratedSpect(30.,100.) << endl;
|
---|
| 114 |
|
---|
| 115 | /*
|
---|
| 116 | cout << " SZSF nolog " << mySZ.filteredIntegratedFlux(mySF,30.,100.) << endl;
|
---|
| 117 | cout << " SZSF log " << mySZ.filteredLogIntFlux(mySF,30.,100.) << endl;
|
---|
| 118 | cout << "full integration no log " << mySZ.integratedFlux(30.,100.) << endl;
|
---|
| 119 | cout << "full integration log " << mySZ.logIntegratedFlux(30.,100.) << endl;
|
---|
| 120 |
|
---|
| 121 | cout << " SZTF nolog " << mySZ.filteredIntegratedFlux(myTF,30.,100.) << endl;
|
---|
| 122 | cout << " SZTF log " << mySZ.filteredLogIntFlux(myTF,30.,100.) << endl;
|
---|
| 123 | */
|
---|
| 124 | 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 |
|
---|
| 130 | cout << " RSVTF nolog " << myRSV.filteredIntegratedFlux(myTF,30.,100.) << endl;
|
---|
| 131 | cout << " RSVTF log " << myRSV.filteredLogIntFlux(myTF,30.,100.) << endl;
|
---|
| 132 |
|
---|
| 133 |
|
---|
| 134 | return 1;
|
---|
| 135 | }
|
---|