SortedMinimumSlope.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2022 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __Pulsar_SortedMinimumSlope_h
10 #define __Pulsar_SortedMinimumSlope_h
11 
12 #include "Pulsar/TimeFrequencyMask.h"
13 
14 namespace Pulsar
15 {
17  class SortedMinimumSlope : public TimeFrequencyMask
18  {
19 
20  public:
21 
23 
25  /* stat and model arrays have dims (nsub, nchan, npol), slow to fast.
26  mask array has dims (nsub, nchan).
27  */
28  unsigned update_mask (std::vector<float> &mask,
29  std::vector<float> &stat,
30  std::vector<float> &model,
31  unsigned nsubint, unsigned nchan, unsigned npol);
32 
34  void set_duty_cycle (float t) { duty_cycle = t; }
35  float get_duty_cycle () const { return duty_cycle; }
36 
37  // Text interface to the SortedMinimumSlope class
38  class Interface : public TextInterface::To<SortedMinimumSlope> {
39  public:
40  Interface (SortedMinimumSlope* = 0);
41  std::string get_interface_name () const { return "sms"; }
42  };
43 
46 
47  // Return new instance
48  SortedMinimumSlope* clone () const { return new SortedMinimumSlope(); }
49 
50  protected:
51 
53  float duty_cycle;
54  };
55 
56 }
57 
58 #endif
Uses the minimum slope of the sorted data to define the good "median".
Definition: SortedMinimumSlope.h:22
void set_duty_cycle(float t)
Set the cut-off threshold (multiple of value at sorted minimum slope)
Definition: SortedMinimumSlope.h:44
SortedMinimumSlope * clone() const
Derived types must also define clone method.
Definition: SortedMinimumSlope.h:58
TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition: SortedMinimumSlope.C:183
float duty_cycle
Fraction of data used to compute slope.
Definition: SortedMinimumSlope.h:63
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)
Smooth the data given in raw, output to smoothed.
Definition: SortedMinimumSlope.C:79

Generated using doxygen 1.8.17