ChannelZapMedian.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2005 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/ChannelZapMedian.h
10 
11 #ifndef _Pulsar_ChannelZapMedian_H
12 #define _Pulsar_ChannelZapMedian_H
13 
14 #include "Pulsar/ChannelWeight.h"
15 #include "TextInterface.h"
16 
17 namespace Pulsar {
18 
19  class Statistics;
20  class ProfileStatistic;
21 
23  class ChannelZapMedian : public ChannelWeight
24  {
25 
26  public:
27 
30 
33 
34  // Text interface to the ChannelZapMedian class
35  class Interface : public TextInterface::To<ChannelZapMedian>
36  {
37  public:
38  Interface (ChannelZapMedian* = 0);
39  };
40 
42  void operator () (Archive*);
43 
45  void weight (Integration* integration);
46 
48  void set_window_size (unsigned size) { window_size = size; }
49 
51  unsigned get_window_size () const { return window_size; }
52 
54  void set_rms_threshold (float t);
55 
57  float get_rms_threshold () const;
58 
60  void set_madm_threshold (float t);
61 
63  float get_madm_threshold () const;
64 
66  void set_iqr_threshold (float t);
67 
69  float get_iqr_threshold () const;
70 
72  void set_bybin (bool t) { bybin = t; }
73 
75  bool get_bybin () const { return bybin; }
76 
78  void set_paz_report (bool t) { paz_report = t; }
79 
81  bool get_paz_report () const { return paz_report; }
82 
84  void set_from_total (bool t) { from_total = t; }
85 
87  bool get_from_total () const { return from_total; }
88 
90  void set_expression (const std::string& exp) { expression = exp; }
91 
93  std::string get_expression () const { return expression; }
94 
96  void set_statistic (const std::string&);
97 
99  std::string get_statistic () const;
100 
101  protected:
102 
104  unsigned window_size;
105 
107  float rms_threshold;
108 
110  float madm_threshold;
111 
113  float iqr_threshold;
114 
116  bool bybin;
117 
119  bool paz_report;
120 
122  bool from_total;
123 
125  std::vector<bool> single_mask;
126 
128  std::string expression;
129 
133 
136 
137  };
138 
139 }
140 
141 #endif
const ScalarMath exp(const ScalarMath &x)
void set_bybin(bool t)
Run the algorithm on the spectra of each bin.
Definition: ChannelZapMedian.h:77
void set_expression(const std::string &exp)
Set the mathematical expression.
Definition: ChannelZapMedian.h:95
float iqr_threshold
Threshold as a multiple of the inter-quartile range.
Definition: ChannelZapMedian.h:118
bool from_total
Compute the zap mask from the tscrunched total.
Definition: ChannelZapMedian.h:127
bool get_from_total() const
Compute a single zap mask from the total.
Definition: ChannelZapMedian.h:92
virtual unsigned get_npol() const =0
Get the number of polarization measurements.
float rms_threshold
Threshold as a multiple of the standard deviation.
Definition: ChannelZapMedian.h:112
virtual void set_Archive(const Archive *)
Set the instance.
Definition: HasArchive.C:25
void operator()(Archive *)
Set up attributes that apply to the whole archive.
Definition: ChannelZapMedian.C:84
Combines an index value and integrate flag.
Definition: Index.h:24
void set_iqr_threshold(float t)
Set the threshold as multiple of the inter-quartile range.
Definition: ChannelZapMedian.C:59
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
void set_madm_threshold(float t)
Set the threshold as multiple of the median absolute deviation from the median.
Definition: ChannelZapMedian.C:47
bool bybin
Median smooth the spectra of each bin.
Definition: ChannelZapMedian.h:121
float get_rms_threshold() const
Get the threshold as multiple of the standard deviation.
Definition: ChannelZapMedian.C:42
static bool verbose
flag controls the amount output to stderr by Integration methods
Definition: Integration.h:42
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
std::string get_statistic() const
Get the profile statistic.
Definition: ChannelZapMedian.C:76
The primary interface to pulsar observational data.
Definition: Archive.h:45
virtual unsigned get_nbin() const =0
Get the number of bins in each profile.
Reference::To< Statistics > stats
The Statistics estimator used to evaluate the expression.
Definition: ChannelZapMedian.h:136
void set_from_total(bool t)
Compute a single zap mask from the total.
Definition: ChannelZapMedian.h:89
Signal::State get_state() const
Get the polarimetric state of the profiles.
Definition: Integration.C:599
unsigned window_size
The size of the window over which median will be computed.
Definition: ChannelZapMedian.h:109
virtual Integration * clone() const =0
Return a new copy of self.
float get_weight(unsigned ichan) const
Get the Profile weight attribute of the given channel.
Definition: Integration.C:388
void set_paz_report(bool t)
Print equivalent paz command on cout.
Definition: ChannelZapMedian.h:83
TextInterface::Parser * get_interface()
Get the text interface to the configuration attributes.
Definition: ChannelZapMedian.C:139
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
float get_madm_threshold() const
Get the threshold as multiple of the median absolute deviation from the median.
Definition: ChannelZapMedian.C:54
Interface to a variety of useful statistics.
Definition: Statistics.h:30
unsigned get_window_size() const
Get the size of the window over which median will be computed.
Definition: ChannelZapMedian.h:56
void set_statistic(const std::string &)
Set the profile statistic.
Definition: ChannelZapMedian.C:71
void set_rms_threshold(float t)
Set the threshold as multiple of the standard deviation.
Definition: ChannelZapMedian.C:35
void set_weight(unsigned ichan, float weight)
Set the Profile weight attributes of the given channel.
Definition: Integration.C:401
std::string expression
Set the expression to evaluate in each channel (as in psrstat)
Definition: ChannelZapMedian.h:133
void weight(Integration *integration)
Set integration weights.
Definition: ChannelZapMedian.C:192
std::vector< bool > single_mask
The single mask to apply to every sub-integration.
Definition: ChannelZapMedian.h:130
void set_window_size(unsigned size)
Set the size of the window over which median will be computed.
Definition: ChannelZapMedian.h:53
std::string get_expression() const
Get the mathematical expression.
Definition: ChannelZapMedian.h:98
ChannelZapMedian()
Default constructor.
Definition: ChannelZapMedian.C:23
float madm_threshold
Threshold as a multiple of the median absolute deviation from the median.
Definition: ChannelZapMedian.h:115
float get_iqr_threshold() const
Get the threshold as multiple of the inter-quartile range.
Definition: ChannelZapMedian.C:66
virtual unsigned get_nchan() const =0
Get the number of chans.
bool get_dedispersed() const
Inter-channel dispersion delay has been removed.
Definition: Integration.C:467
Plot of data weight vs frequency.
Definition: ChannelWeightsPlot.h:29
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Uses a median smoothed spectrum to find birdies and zap them.
Definition: ChannelZapMedian.h:28
const Profile * get_Profile(const Archive *data, Index subint, Index pol, Index chan)
Return the requested profile, cloning and integrating when needed.
Definition: Index.C:24
bool paz_report
Print the verbose message used by paz.
Definition: ChannelZapMedian.h:124
Profile * get_Profile(unsigned ipol, unsigned ichan)
Returns a pointer to the Profile given by the specified indeces.
Definition: Integration.C:306
Reference::To< ProfileStatistic > statistic
The statistic to be derived from each profile.
Definition: ChannelZapMedian.h:140
bool get_paz_report() const
Print equivalent paz command on cout.
Definition: ChannelZapMedian.h:86
bool get_bybin() const
Run the algorithm on the spectra of each bin.
Definition: ChannelZapMedian.h:80

Generated using doxygen 1.8.17