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
14namespace Pulsar
15{
17
19 class InterQuartileRange : public TimeFrequencyMask
20 {
21
22 public:
23
24 InterQuartileRange() = default;
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
41
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 const std::string& get_way () const { return way; }
60 void set_way (const std::string& t) { way = t; }
61
62 // Text interface to the InterQuartileRange class
63 class Interface : public TextInterface::To<InterQuartileRange> {
64 public:
65 Interface (InterQuartileRange* = 0);
66 std::string get_interface_name () const { return "iqr"; }
67 };
68
70 TextInterface::Parser* get_interface ();
71
72 // Return new instance
73 InterQuartileRange* clone () const { return new InterQuartileRange(); }
74
75 protected:
76
79 float cutoff_threshold_min = 1.5;
80
83
84 // dimension along which to compare
85 std::string way = "all";
86 };
87
88}
89
90#endif
void set_cutoff_threshold(float t)
Set the cut-off threshold.
Definition InterQuartileRange.h:36
float get_minimum_slope_median_duty_cycle() const
Get the duty cycle used to find the 'minimum slope median'.
Definition InterQuartileRange.h:56
float minimum_slope_median_duty_cycle
Duty cycle used to find the 'minimum slope median'.
Definition InterQuartileRange.h:82
float cutoff_threshold_max
Fraction of IQR.
Definition InterQuartileRange.h:78
void set_minimum_slope_median_duty_cycle(float t)
Set the duty cycle used to find the 'minimum slope median'.
Definition InterQuartileRange.h:52
void set_cutoff_threshold_max(float t)
Set the cut-off threshold for the maximum value.
Definition InterQuartileRange.h:40
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:154
InterQuartileRange * clone() const
Derived types must also define clone method.
Definition InterQuartileRange.h:73
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition InterQuartileRange.C:249
float get_cutoff_threshold_max() const
Get the cut-off threshold for the maximum value.
Definition InterQuartileRange.h:43
float get_cutoff_threshold_min() const
Get the cut-off threshold for the minimum value.
Definition InterQuartileRange.h:49
void set_cutoff_threshold_min(float t)
Set the cut-off threshold for the minimum value.
Definition InterQuartileRange.h:46
virtual std::string get_interface_name() const
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0