Last change
on this file since 607 was 607, checked in by ansari, 26 years ago |
Modifs preparatoire pour Garching MAP , Reza 20/11/99
|
File size:
1.4 KB
|
Line | |
---|
1 | //--------------------------------------------------------------------------
|
---|
2 | // File and Version Information:
|
---|
3 | // $Id: nupower.cc,v 1.2 1999-11-20 21:00:49 ansari Exp $
|
---|
4 | //
|
---|
5 | // Description:
|
---|
6 | // Aim of the class: To give the energy density for a nupower
|
---|
7 | // The unity used here is W/m^2/Hz/sr
|
---|
8 | //
|
---|
9 | // History (add to end):
|
---|
10 | // Sophie Oct, 1999 - creation
|
---|
11 | //
|
---|
12 | //------------------------------------------------------------------------
|
---|
13 |
|
---|
14 | //---------------
|
---|
15 | // C++ Headers --
|
---|
16 | //---------------
|
---|
17 | #include "machdefs.h"
|
---|
18 | #include <iostream.h>
|
---|
19 | #include <math.h>
|
---|
20 |
|
---|
21 | #include "nupower.h"
|
---|
22 |
|
---|
23 | //----------------
|
---|
24 | // Constructor --
|
---|
25 | //----------------
|
---|
26 | PowerLawSpectra::PowerLawSpectra(double a, double b, double nu0, double numin, double numax)
|
---|
27 | : RadSpectra(numin, numax)
|
---|
28 | {
|
---|
29 | _a = a;
|
---|
30 | _b = b;
|
---|
31 | _nu0 = nu0;
|
---|
32 | }
|
---|
33 |
|
---|
34 |
|
---|
35 | PowerLawSpectra::~PowerLawSpectra()
|
---|
36 | {
|
---|
37 | }
|
---|
38 |
|
---|
39 | double
|
---|
40 | PowerLawSpectra::flux(double nu) const
|
---|
41 | {
|
---|
42 | if ((nu < _numin) || (nu > _numax)) return(0.);
|
---|
43 | else return( _a * pow((nu-_nu0), _b) );
|
---|
44 | }
|
---|
45 |
|
---|
46 | void
|
---|
47 | PowerLawSpectra::Print(ostream& os) const
|
---|
48 | {
|
---|
49 | os << "PowerLawSpectra::Print f = a (nu-nu0)^b " << _a << "(nu-" << _nu0
|
---|
50 | << ") ^ " << _b << endl;
|
---|
51 | os << " - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl;
|
---|
52 | os << "MeanFreq= " << meanFreq() << " Emission= " << flux(meanFreq()) << endl;
|
---|
53 | os << "PeakFreq= " << peakFreq() << " Emission= " << flux(peakFreq()) << endl;
|
---|
54 |
|
---|
55 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.