RFIFilter.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Signal/General/dsp/RFIFilter.h
10 
11 #ifndef __RFIFilter_h
12 #define __RFIFilter_h
13 
14 #include "dsp/Response.h"
15 #include "Reference.h"
16 #include "MJD.h"
17 
18 namespace dsp {
19 
20  class Source;
21  class TimeSeries;
22  class Bandpass;
23 
25  /* This class may become a base class for all RFI mitigaton
26  strategies that can be applied in the frequency domain. For now,
27  it produces a narrow-band birdie zapping mask. */
28  class RFIFilter: public Response {
29 
30  public:
31 
34 
36  ~RFIFilter ();
37 
39  void match (const Observation*, unsigned nchan);
40 
42  void match (const Response* response);
43 
45  void set_nchan (unsigned nchan);
46 
48  void set_update_interval (double seconds);
49 
51  void set_duty_cycle (float cycle);
52 
54  void set_source (Source*);
55 
58 
60  void set_data (Response* data);
61 
64 
65  void calculate (Response* bp);
66 
67  protected:
68 
70  template<typename SourceType>
71  void match (SourceType* source, const Observation*, unsigned nchan);
72 
75 
78 
81 
84 
86  uint64_t maximum_block_size;
87 
89  unsigned nchan_bandpass;
90 
92  double interval;
93 
95  float duty_cycle;
96 
98  unsigned median_window;
99 
100  private:
101 
103  MJD end_time;
104 
106  MJD start_time;
107 
109  bool calculated;
110 
111  };
112 
113 }
114 
115 #endif
uint64_t maximum_block_size
The maximum block size.
Definition: RFIFilter.h:91
unsigned median_window
The size of the window used in median smoothing.
Definition: RFIFilter.h:103
Produces TimeSeries data by integrating an Input with an Unpacker.
Definition: IOManager.h:26
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
RFIFilter()
Default constructor.
Definition: RFIFilter.C:19
float * get_datptr(unsigned ichan, unsigned ipol)
Provide access to the data for the specified polarization.
Definition: Shape.h:91
~RFIFilter()
Destructor.
Definition: RFIFilter.C:30
void set_buffer(TimeSeries *buffer)
Set the buffer into which raw data will be read [optional].
Definition: RFIFilter.C:262
Reference::To< Response > data
The buffer into which the bandpass will be integrated.
Definition: RFIFilter.h:88
void set_source(Source *)
Set the source of the data.
Definition: RFIFilter.C:256
Describes a frequency (or impulse) response.
Definition: Response.h:34
Produces the bandpass of an undetected timeseries.
Definition: Bandpass.h:24
void set_update_interval(double seconds)
Set the interval over which the RFI mask will be calculated.
Definition: RFIFilter.C:244
double interval
The interval over which the RFI mask will be calculated.
Definition: RFIFilter.h:97
unsigned nchan
Number of frequency divisions (channels)
Definition: Shape.h:115
Container of weighted time-major order floating point data.
Definition: WeightedTimeSeries.h:26
Produces TimeSeries data by integrating a ParallelInput with a ParallelUnpacker.
Definition: ParallelIOManager.h:26
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
unsigned get_ndat() const
Get the number of datum in each of the nchan*npol divisions.
Definition: Shape.h:58
void set_bandpass(Bandpass *bandpass)
Set the tool used to compute the spectra [optional].
Definition: RFIFilter.C:274
float duty_cycle
The fraction of the data used to calculate the RFI mask.
Definition: RFIFilter.h:100
unsigned get_nchan() const
Get the number of frequency channels.
Definition: Shape.h:55
Reference::To< TimeSeries > buffer
The buffer into which data will be read.
Definition: RFIFilter.h:82
unsigned nchan_bandpass
The number of frequency channels used in calculating the bandpass.
Definition: RFIFilter.h:94
void set_nchan(unsigned nchan)
Set the number of channels into which the band will be divided.
Definition: RFIFilter.C:238
void match(const Observation *, unsigned nchan)
Create an RFI filter for the specified observation.
Definition: RFIFilter.C:107
Reference::To< Bandpass > bandpass
The tool for computing the bandpass.
Definition: RFIFilter.h:85
MJD get_start_time() const
Return the start time of the leading edge of the first time sample.
Definition: Observation.h:152
Abstract interface to sources of TimeSeries data.
Definition: Source.h:22
void set_data(Response *data)
Set the buffer into which the spectra will be integrated [optional].
Definition: RFIFilter.C:268
virtual void seek(int64_t offset)
Offset the base pointer by offset time samples.
Definition: TimeSeries.C:234
void set_duty_cycle(float cycle)
Set the fraction of the data used to calculate the RFI mask.
Definition: RFIFilter.C:250
Reference::To< Source > source
The source of data.
Definition: RFIFilter.h:79

Generated using doxygen 1.8.17