SetThresholds.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2021 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __Pulsar_SetThresholds_h
10 #define __Pulsar_SetThresholds_h
11 
12 #include "Pulsar/TimeFrequencyMask.h"
13 
14 namespace Pulsar
15 {
17  class SetThresholds : public TimeFrequencyMask
18  {
19 
20  public:
21 
23 
24  unsigned update_mask (std::vector<float> &mask,
25  std::vector<float> &stat,
26  std::vector<float> &model,
27  unsigned nsubint, unsigned nchan, unsigned npol);
28 
30  void set_cutoff_max (float t) { cutoff_max = t; cutoff_max_set = true; }
31 
33  float get_cutoff_max () const { return cutoff_max; }
34 
36  void set_cutoff_min (float t) { cutoff_min = t; cutoff_min_set = true; }
37 
39  float get_cutoff_min () const { return cutoff_min; }
40 
41  // Text interface to the SetThresholds class
42  class Interface : public TextInterface::To<SetThresholds> {
43  public:
44  Interface (SetThresholds* = 0);
45  std::string get_interface_name () const { return "set"; }
46  };
47 
50 
51  // Return new instance
52  SetThresholds* clone () const { return new SetThresholds(); }
53 
54  protected:
55 
56  float cutoff_max;
57  bool cutoff_max_set;
58 
59  float cutoff_min;
60  bool cutoff_min_set;
61  };
62 
63 }
64 
65 #endif
Uses set cutoff values to mask bad channels and sub-integrations.
Definition: SetThresholds.h:22
SetThresholds * clone() const
Derived types must also define clone method.
Definition: SetThresholds.h:62
void set_cutoff_min(float t)
Set the cut-off threshold for the minimum value.
Definition: SetThresholds.h:46
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: SetThresholds.C:96
float get_cutoff_min() const
Get the cut-off threshold for the minimum value.
Definition: SetThresholds.h:49
void set_cutoff_max(float t)
Set the cut-off threshold for the maximum value.
Definition: SetThresholds.h:40
Defines the PSRCHIVE library.
Definition: CalSource.h:17
unsigned update_mask(std::vector< float > &mask, std::vector< float > &stat, std::vector< float > &model, unsigned nsubint, unsigned nchan, unsigned npol)
Update the mask.
Definition: SetThresholds.C:25
float get_cutoff_max() const
Get the cut-off threshold for the maximum value.
Definition: SetThresholds.h:43

Generated using doxygen 1.8.17