| Last change
 on this file since 645 was             607, checked in by ansari, 26 years ago | 
        
          | 
Modifs preparatoire pour Garching MAP , Reza 20/11/99
 | 
        
          | File size:
            1.2 KB | 
      
      
| Rev | Line |  | 
|---|
| [601] | 1 | //-------------------------------------------------------------------------- | 
|---|
|  | 2 | // File and Version Information: | 
|---|
| [607] | 3 | //      $Id: squarefilt.cc,v 1.2 1999-11-20 21:00:53 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 |  | 
|---|
|  | 20 | //---------------- | 
|---|
|  | 21 | // Constructor -- | 
|---|
|  | 22 | //---------------- | 
|---|
|  | 23 | SquareFilter::SquareFilter(double numin, double numax) | 
|---|
|  | 24 | : SpectralResponse(numin, numax) | 
|---|
|  | 25 | { | 
|---|
|  | 26 | _nuPeak = (numin+numax)/2.; | 
|---|
|  | 27 | _peakTransmission = transmission(_nuPeak); | 
|---|
|  | 28 | } | 
|---|
|  | 29 |  | 
|---|
|  | 30 |  | 
|---|
|  | 31 | //-------------- | 
|---|
|  | 32 | // Destructor -- | 
|---|
|  | 33 | //-------------- | 
|---|
|  | 34 | SquareFilter::~SquareFilter() | 
|---|
|  | 35 | { | 
|---|
|  | 36 | } | 
|---|
|  | 37 |  | 
|---|
|  | 38 | //              --------------------------- | 
|---|
|  | 39 | //              --  Function Definitions -- | 
|---|
|  | 40 | //              --------------------------- | 
|---|
|  | 41 |  | 
|---|
|  | 42 |  | 
|---|
|  | 43 | double | 
|---|
|  | 44 | SquareFilter::transmission(double nu) const | 
|---|
|  | 45 | { | 
|---|
|  | 46 | if(nu < -1.e99) nu = -1.e99; | 
|---|
|  | 47 | if(nu > 1.e99) nu = 1.e99; | 
|---|
|  | 48 |  | 
|---|
|  | 49 | if(nu>=_numin && nu<=_numax) return 1.; | 
|---|
|  | 50 | return 0.; | 
|---|
|  | 51 | } | 
|---|
|  | 52 |  | 
|---|
|  | 53 | double | 
|---|
|  | 54 | SquareFilter::peakFreq() const | 
|---|
|  | 55 | { | 
|---|
|  | 56 | return _nuPeak; | 
|---|
|  | 57 | } | 
|---|
|  | 58 |  | 
|---|
|  | 59 | double | 
|---|
|  | 60 | SquareFilter::peakTransmission() const | 
|---|
|  | 61 | { | 
|---|
|  | 62 | return _peakTransmission; | 
|---|
|  | 63 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.