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

Last change on this file since 909 was 909, checked in by ansari, 25 years ago

Sophie: adding documentation for Doxygen in the .cc files:wq

File size: 1.7 KB
RevLine 
[601]1//--------------------------------------------------------------------------
2// File and Version Information:
[909]3// $Id: squarefilt.cc,v 1.5 2000-04-13 14:10:45 ansari Exp $
[601]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
[909]20/*!
21 * \class SOPHYA::SquareFilter
22 * Square detector response
23 */
24
[601]25//----------------
26// Constructor --
27//----------------
[668]28SquareFilter::SquareFilter()
29 : SpectralResponse()
30{
31}
32
[601]33SquareFilter::SquareFilter(double numin, double numax)
34 : SpectralResponse(numin, numax)
35{
36 _nuPeak = (numin+numax)/2.;
37 _peakTransmission = transmission(_nuPeak);
38}
39
40
41//--------------
42// Destructor --
43//--------------
44SquareFilter::~SquareFilter()
45{
46}
47
48// ---------------------------
49// -- Function Definitions --
50// ---------------------------
51
52
[909]53/*! The transmission returns 1. for frequencies in the [numin,numax] range
54 and 0. outside */
[601]55double
56SquareFilter::transmission(double nu) const
57{
58 if(nu < -1.e99) nu = -1.e99;
59 if(nu > 1.e99) nu = 1.e99;
60
61 if(nu>=_numin && nu<=_numax) return 1.;
62 return 0.;
63}
64
65double
66SquareFilter::peakFreq() const
67{
68return _nuPeak;
69}
70
71double
72SquareFilter::peakTransmission() const
73{
[668]74 return _peakTransmission;
[601]75}
[668]76
[669]77/*
[668]78void
79SquareFilter::WriteSelf(POutPersist& s)
80{
81 s.PutR8(this->minFreq());
82 s.PutR8(this->maxFreq());
83}
84
85void
86SquareFilter::ReadSelf(PInPersist& s)
87{
88 double minFreq, maxFreq;
89 s.GetR8(_numin);
90 s.GetR8(_numax);
91 cout << "minFreq - maxFreq " << _numin << "-" << _numax << endl;
92}
[669]93*/
Note: See TracBrowser for help on using the repository browser.