source: Sophya/trunk/SophyaLib/SkyT/gaussfilt.cc@ 601

Last change on this file since 601 was 601, checked in by ansari, 26 years ago

Creation module SkyT (provisoire) - Outils pour simulation du ciel

Reza 19/11/99

File size: 1.6 KB
Line 
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: gaussfilt.cc,v 1.1.1.1 1999-11-19 16:34:33 ansari Exp $
4//
5// Description:
6//
7// History (add to end):
8// Sophie Oct, 1999 - creation
9//
10//------------------------------------------------------------------------
11
12//---------------
13// C++ Headers --
14//---------------
15#include "machdefs.h"
16#include <iostream.h>
17#include <math.h>
18
19#include "gaussfilt.h"
20
21//----------------
22// Constructor --
23//----------------
24GaussianFilter::GaussianFilter(double nu0, double s, double a, double numin, double numax)
25 : SpectralResponse(numin, numax)
26{
27 if (s < 1.e-19) s = 1.e-19;
28 _s = s;
29 _nu0 = nu0;
30 _a = a;
31}
32
33
34//--------------
35// Destructor --
36//--------------
37GaussianFilter::~GaussianFilter()
38{
39}
40
41// ---------------------------
42// -- Function Definitions --
43// ---------------------------
44
45
46double
47GaussianFilter::transmission(double nu) const
48{
49 if ((nu < _numin) || (nu > _numax)) return(0.);
50 else {
51 double tmp = (nu-_nu0)/_s;
52 return(_a * exp(tmp*tmp));
53 }
54}
55
56double
57GaussianFilter::peakFreq() const
58{
59return(_nu0);
60}
61
62double
63GaussianFilter::peakTransmission() const
64{
65return(_a);
66}
67
68void
69GaussianFilter::Print(ostream& os) const
70{
71 os << "GaussianFilter::Print - Fmin,Fmax= " << minFreq() << "," << maxFreq() << endl;
72 os << " T = A * Exp(((nu-nu0)/s)^2) : " << " nu0= " << _nu0 << " sig= "
73 << _s << " A= " << _a << endl;
74 os << "PeakFreq= " << peakFreq() << " Transmission= " << transmission(peakFreq()) << endl;
75
76
77}
Note: See TracBrowser for help on using the repository browser.