TwoDeeMedian.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2020 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __Pulsar_TwoDeeMedian_h
10 #define __Pulsar_TwoDeeMedian_h
11 
12 #include "Pulsar/TimeFrequencySmooth.h"
13 
14 namespace Pulsar {
15 
17 
20  class TwoDeeMedian : public TimeFrequencySmooth
21  {
22 
23  public:
24 
26 
28 
31  virtual void smooth (std::vector<float> &smoothed,
32  std::vector<float> &raw, std::vector<float> &weight,
33  std::vector<float> &freqs, std::vector<float> &times);
34 
35  void set_nchan ( unsigned n ) { med_nchan = n; }
36  unsigned get_nchan () const { return med_nchan; }
37 
38  void set_nsubint ( unsigned n ) { med_nsubint = n; }
39  unsigned get_nsubint () const { return med_nsubint; }
40 
41  void set_freq_range ( float r ) { freq_range = r; }
42  float get_freq_range () const { return freq_range; }
43 
44  void set_time_range ( float r ) { time_range = r; }
45  float get_time_range () const { return time_range; }
46 
47 
48  // Text floaterface to the TwoDeeMedian class
49  class Interface : public TextInterface::To<TwoDeeMedian> {
50  public:
51  Interface (TwoDeeMedian* = 0);
52  std::string get_interface_name () const { return "2dmed"; }
53  };
54 
57 
58  // Return new instance
59  TwoDeeMedian* clone () const { return new TwoDeeMedian(); }
60 
61  protected:
62 
63  unsigned med_nchan;
64  unsigned med_nsubint;
65 
66  // TODO: also allow specification of boxcar dimensions using ...
67 
68  float freq_range; // MHz
69  float time_range; // sec
70 
71  };
72 
73 }
74 
75 #endif
virtual void smooth(std::vector< float > &smoothed, std::vector< float > &raw, std::vector< float > &weight, std::vector< float > &freqs, std::vector< float > &times)
Smooth the data given in raw, output to smoothed.
Definition: TwoDeeMedian.C:28
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: TwoDeeMedian.C:101
Defines the PSRCHIVE library.
Definition: CalSource.h:17
TwoDeeMedian * clone() const
Derived types must also define clone method.
Definition: TwoDeeMedian.h:69
Median smooth using a 2-dimensional boxcar.
Definition: TwoDeeMedian.h:25

Generated using doxygen 1.8.17