TimeFrequencyMask.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2018 by Paul Demorest
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __Pulsar_TimeFrequencyMask_h
10 #define __Pulsar_TimeFrequencyMask_h
11 
12 #include "Pulsar/Algorithm.h"
13 #include "Pulsar/Archive.h"
14 
15 namespace Pulsar {
16 
18 
22  class TimeFrequencyMask : public Algorithm
23  {
24 
25  public:
26 
28  static TimeFrequencyMask* factory (const std::string& name);
29 
31  static const std::vector<TimeFrequencyMask*>& children ();
32 
33  TimeFrequencyMask();
34 
36 
45  virtual unsigned update_mask (std::vector<float> &mask,
46  std::vector<float> &stat,
47  std::vector<float> &model,
48  unsigned nsubint,
49  unsigned nchan,
50  unsigned npol) = 0;
51 
52  virtual void set_threshold (float t) { threshold = t; }
53  virtual float get_threshold () const { return threshold; }
54 
56  virtual TextInterface::Parser* get_interface () { return 0; }
57 
59  virtual TimeFrequencyMask* clone () const = 0;
60 
61  protected:
62 
63  float threshold;
64 
65  private:
66  static void build ();
67  };
68 
69  std::ostream& operator<< (std::ostream&, TimeFrequencyMask*);
70 
71  std::istream& operator>> (std::istream&, TimeFrequencyMask*&);
72 
73 }
74 
75 #endif
Compute mask from statistic vs time/freq.
Definition: TimeFrequencyMask.h:27
virtual TimeFrequencyMask * clone() const =0
Derived types must also define clone method.
static TimeFrequencyMask * factory(const std::string &name)
Create a new instance of TimeFrequencyMask based on name.
Definition: TimeFrequencyMask.C:50
virtual TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: TimeFrequencyMask.h:66
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual unsigned update_mask(std::vector< float > &mask, std::vector< float > &stat, std::vector< float > &model, unsigned nsubint, unsigned nchan, unsigned npol)=0
Update the mask.
static const std::vector< TimeFrequencyMask * > & children()
Returns a list of available TimeFrequencyMask children.
Definition: TimeFrequencyMask.C:39

Generated using doxygen 1.8.17