FortranSNR.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 - 2016 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/FortranSNR.h
10 
11 #ifndef __Pulsar_FortranSNR_h
12 #define __Pulsar_FortranSNR_h
13 
14 #include "Pulsar/SNRatioEstimator.h"
15 #include "PhaseRange.h"
16 
17 #include <vector>
18 
19 namespace Pulsar {
20 
22  class FortranSNR : public SNRatioEstimator
23  {
24 
25  public:
26 
28 
30  float get_snr (const Profile* profile);
31 
34 
36  class Interface;
37 
39  FortranSNR* clone () const;
40 
41  int get_bestwidth(){ return bestwidth; }
42 
43  void set_rms( float new_rms ) { rms = new_rms; rms_set = true; }
44  void set_minwidthbins ( int bins ) { minwidthbins = bins; }
45  void set_maxwidthbins ( int bins ) { maxwidthbins = bins; }
46  void set_bestwidth(int bw) { bestwidth=bw; };
47 
48  Phase::Value get_width () const;
49 
50  private:
51  float rms;
52  int minwidthbins;
53  int maxwidthbins;
54  int bestwidth;
55  bool rms_set;
56 
57  std::vector<float> work;
58  };
59 
60 }
61 
62 #endif
63 
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
FortranSNR * clone() const
Return a copy constructed instance of self.
Definition: FortranSNR.C:105
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: FortranSNR.C:99
Calculates the signal-to-noise ratio by fitting against a standard.
Definition: FortranSNR.h:27
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
float get_snr(const Profile *profile)
Return the signal to noise ratio based on the shift.
Definition: FortranSNR.C:40
PhaseWeight * baseline() const
Return a new PhaseWeight instance with the baseline phase bins masked.
Definition: Profile_baseline.C:15
Defines the PSRCHIVE library.
Definition: CalSource.h:17
float get_rms() const
Get the weighted rms of the Profile amplitudes.
Definition: PhaseWeight.C:368

Generated using doxygen 1.8.17