Mower.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2012 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/RFIMitigation/Pulsar/MADLM.h
10
11#ifndef __Pulsar_MADLM_h
12#define __Pulsar_MADLM_h
13
14#include "Pulsar/Transformation.h"
15#include "Pulsar/Integration.h"
16
17#include "TextInterface.h"
18#include "Functor.h"
19
20namespace Pulsar {
21
23
24 class Mower : public Transformation<Integration> {
25
26 public:
27
29 Mower ();
30
33
34 // Text interface to the Mower class
35 class Interface : public TextInterface::To<Mower> {
36 public:
37 Interface (Mower* = 0);
38 };
39
41 void transform (Integration*);
42
44 virtual void set_threshold (float madm);
45 float get_threshold () const;
46
48 virtual void set_median_smoothing (float turns);
49 float get_median_smoothing () const;
50
52 virtual void set_broadband (bool);
53
55 virtual void set_prune (const PhaseWeight* prune_mask);
56 const PhaseWeight* get_prune () const;
57
59 virtual void add_precondition( Functor< bool(Profile*,PhaseWeight*) > );
60
61 protected:
62
65
68
70 virtual bool build_mask (Profile* profile);
71
73 virtual void compute (PhaseWeight* mask, const Profile* difference) = 0;
74
77
80
83
85 std::vector< Functor< bool(Profile*,PhaseWeight*) > > precondition;
86
87 };
88
89}
90
91#endif
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
virtual bool build_mask(Profile *profile)
Create mask and return true if all preconditions are satisfied.
Definition Mower.C:82
Reference::To< PhaseWeight > mowed
Points to be mowed.
Definition Mower.h:64
std::vector< Functor< bool(Profile *, PhaseWeight *) > > precondition
Preconditions.
Definition Mower.h:85
bool broadband
Search for spikes in fscrunch (DM=0) total.
Definition Mower.h:82
virtual void set_prune(const PhaseWeight *prune_mask)
If set, mow only the points flagged in the prune mask.
Definition Mower.C:63
virtual TextInterface::Parser * get_interface()
Get the text interface to the mower attributes.
Definition Mower.C:235
Mower()
Default constructor.
Definition Mower.C:25
virtual void set_median_smoothing(float turns)
Set the size of the window used during median smoothing.
Definition Mower.C:48
virtual void compute(PhaseWeight *mask, const Profile *difference)=0
Find the spikes in median smoothed difference and flag them in mask.
float median_smoothing_turns
Size of median smoothing window in turns.
Definition Mower.h:76
virtual void set_broadband(bool)
If set, search for spikes in fscrunched (DM=0) total.
Definition Mower.C:58
Reference::To< const PhaseWeight > prune
Specific points to be pruned.
Definition Mower.h:67
float cutoff_threshold
Cutoff threshold.
Definition Mower.h:79
virtual void add_precondition(Functor< bool(Profile *, PhaseWeight *) >)
One or more preconditions can be added.
Definition Mower.C:75
void transform(Integration *)
Set the Profile from which baseline PhaseWeight will be computed.
Definition Mower.C:150
virtual void set_threshold(float madm)
Set the threshold above which samples are mown.
Definition Mower.C:38
Stores a weight for each Profile phase bin.
Definition PhaseWeight.h:24
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Algorithms that modify data in the Container.
Definition Transformation.h:20
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0