source: Sophya/trunk/SophyaLib/SkyT/squarefilt.cc@ 668

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

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

File size: 1.5 KB
Line 
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: squarefilt.cc,v 1.3 1999-11-29 14:16:09 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
18#include "squarefilt.h"
19
20//----------------
21// Constructor --
22//----------------
23SquareFilter::SquareFilter()
24 : SpectralResponse()
25{
26}
27
28SquareFilter::SquareFilter(double numin, double numax)
29 : SpectralResponse(numin, numax)
30{
31 _nuPeak = (numin+numax)/2.;
32 _peakTransmission = transmission(_nuPeak);
33}
34
35
36//--------------
37// Destructor --
38//--------------
39SquareFilter::~SquareFilter()
40{
41}
42
43// ---------------------------
44// -- Function Definitions --
45// ---------------------------
46
47
48double
49SquareFilter::transmission(double nu) const
50{
51 if(nu < -1.e99) nu = -1.e99;
52 if(nu > 1.e99) nu = 1.e99;
53
54 if(nu>=_numin && nu<=_numax) return 1.;
55 return 0.;
56}
57
58double
59SquareFilter::peakFreq() const
60{
61return _nuPeak;
62}
63
64double
65SquareFilter::peakTransmission() const
66{
67 return _peakTransmission;
68}
69
70void
71SquareFilter::WriteSelf(POutPersist& s)
72{
73 s.PutR8(this->minFreq());
74 s.PutR8(this->maxFreq());
75}
76
77void
78SquareFilter::ReadSelf(PInPersist& s)
79{
80 double minFreq, maxFreq;
81 s.GetR8(_numin);
82 s.GetR8(_numax);
83 cout << "minFreq - maxFreq " << _numin << "-" << _numax << endl;
84}
Note: See TracBrowser for help on using the repository browser.