InterQuartileRange.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_InterQuartileRange_h
10 #define __Pulsar_InterQuartileRange_h
11 
12 #include "Pulsar/TimeFrequencyMask.h"
13 
14 namespace Pulsar
15 {
17 
19  class InterQuartileRange : public TimeFrequencyMask
20  {
21 
22  public:
23 
25 
27 
30  unsigned update_mask (std::vector<float> &mask,
31  std::vector<float> &stat,
32  std::vector<float> &model,
33  unsigned nsubint, unsigned nchan, unsigned npol);
34 
36  void set_cutoff_threshold (float t)
37  { threshold = cutoff_threshold_max = cutoff_threshold_min = t; }
38 
40  void set_cutoff_threshold_max (float t) { cutoff_threshold_max = t; }
41 
43  float get_cutoff_threshold_max () const { return cutoff_threshold_max; }
44 
46  void set_cutoff_threshold_min (float t) { cutoff_threshold_min = t; }
47 
49  float get_cutoff_threshold_min () const { return cutoff_threshold_min; }
50 
54 
58 
59  // Text interface to the InterQuartileRange class
60  class Interface : public TextInterface::To<InterQuartileRange> {
61  public:
62  Interface (InterQuartileRange* = 0);
63  std::string get_interface_name () const { return "iqr"; }
64  };
65 
68 
69  // Return new instance
70  InterQuartileRange* clone () const { return new InterQuartileRange(); }
71 
72  protected:
73 
76  float cutoff_threshold_min;
77 
80  };
81 
82 }
83 
84 #endif
void set_cutoff_threshold_max(float t)
Set the cut-off threshold for the maximum value.
Definition: InterQuartileRange.h:50
void set_cutoff_threshold_min(float t)
Set the cut-off threshold for the minimum value.
Definition: InterQuartileRange.h:56
float cutoff_threshold_max
Fraction of IQR.
Definition: InterQuartileRange.h:85
float get_cutoff_threshold_max() const
Get the cut-off threshold for the maximum value.
Definition: InterQuartileRange.h:53
unsigned update_mask(std::vector< float > &mask, std::vector< float > &stat, std::vector< float > &model, unsigned nsubint, unsigned nchan, unsigned npol)
Smooth the data given in raw, output to smoothed.
Definition: InterQuartileRange.C:28
InterQuartileRange * clone() const
Derived types must also define clone method.
Definition: InterQuartileRange.h:80
void set_cutoff_threshold(float t)
Set the cut-off threshold.
Definition: InterQuartileRange.h:46
float get_cutoff_threshold_min() const
Get the cut-off threshold for the minimum value.
Definition: InterQuartileRange.h:59
float minimum_slope_median_duty_cycle
Duty cycle used to find the 'minimum slope median'.
Definition: InterQuartileRange.h:89
float get_minimum_slope_median_duty_cycle() const
Get the duty cycle used to find the 'minimum slope median'.
Definition: InterQuartileRange.h:66
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: InterQuartileRange.C:174
Uses the inter-quartile range to mask bad channels and sub-integrations.
Definition: InterQuartileRange.h:24
void set_minimum_slope_median_duty_cycle(float t)
Set the duty cycle used to find the 'minimum slope median'.
Definition: InterQuartileRange.h:62
Defines the PSRCHIVE library.
Definition: CalSource.h:17

Generated using doxygen 1.8.17