Dedispersion.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2002 - 2020 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Signal/General/dsp/Dedispersion.h
10 
11 #ifndef __Dedispersion_h
12 #define __Dedispersion_h
13 
14 #include "dsp/PlasmaResponse.h"
15 
16 class ThreadContext;
17 
18 namespace dsp {
19 
21  /* This class implements the phase-coherent dedispersion kernel, as
22  determined by the frequency response of the interstellar
23  medium. */
24 
25  class Dedispersion : public PlasmaResponse
26  {
27 
28  public:
29 
31  static const double dm_dispersion;
32 
34  Dedispersion();
35 
37  ~Dedispersion();
38 
40  void prepare (const Observation* input, unsigned channels);
41 
43  virtual void mark (Observation* output);
44 
46  void set_dispersion_measure (double dm);
47 
49  double get_dispersion_measure () const { return dispersion_measure; }
50 
52  double delay_time (double freq) const override;
53 
55  class SampleDelay;
56 
58  void set_sample_delay (SampleDelay*);
59 
61  SampleDelay* get_sample_delay ();
62 
64  virtual void build (const Observation* input = 0);
65 
67  void build (std::vector<float>& phases, unsigned npts, unsigned nchan);
68 
70  void set_build_delays (bool delay = true);
71 
72  protected:
73 
75  double dispersion_measure = 0.0;
76 
79 
81  bool build_delays = false;
82 
83  void build (unsigned ndat, unsigned nchan);
84 
85  friend class PlasmaResponse;
86 
88  void build_setup (double chan_freq);
89  double interchannel_fractional_sample_delay = 0.0;
90 
92  double build_compute (double chan_freq, double freq);
93  };
94 
95 }
96 
97 #endif
SampleDelay * get_sample_delay()
Get the integer sample inter-channel delay.
Definition: Dedispersion.C:63
~Dedispersion()
Default constructor.
Definition: Dedispersion.C:38
void set_sample_delay(SampleDelay *)
Correct fractional inter-channel delay given the integer sample inter-channel delay.
Definition: Dedispersion.C:55
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
bool build_delays
Build method returns delay in microseconds instead of phase.
Definition: Dedispersion.h:81
Reference::To< SampleDelay > sample_delay
Used to compute inter-channel fractional sample delay.
Definition: Dedispersion.h:78
unsigned nchan
Number of frequency divisions (channels)
Definition: Shape.h:115
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
void build_setup(double chan_freq)
Set up for the specified channel.
Definition: Dedispersion.C:149
double get_dispersion_measure() const
Get the dispersion measure in .
Definition: Dedispersion.h:49
double delay_time(double freq) const override
Return the dispersive delay for the given frequency.
Definition: Dedispersion.C:143
void set_dispersion_measure(double dm)
Set the dispersion measure in .
Definition: Dedispersion.C:43
double build_compute(double chan_freq, double freq)
Return the phase of the kernel response.
Definition: Dedispersion.C:173
Dedispersion()
Default constructor.
Definition: Dedispersion.C:34
double dispersion_measure
The dispersion measure (DM)
Definition: Dedispersion.h:75
virtual void mark(Observation *output)
Set the dispersion measure attribute in the output Observation.
Definition: Dedispersion.C:201
unsigned ndat
Number of datum in each of the npol*nchan divisions.
Definition: Shape.h:118
virtual void build(const Observation *input=0)
Build the frequency response kernel.
Definition: Dedispersion.C:78
Phase-coherent dispersion removal frequency response function.
Definition: Dedispersion.h:25
static const double dm_dispersion
Conversion factor between dispersion measure, DM, and dispersion, D.
Definition: Dedispersion.h:31
void set_build_delays(bool delay=true)
Build delays in microseconds instead of phases.
Definition: Dedispersion.C:196
void prepare(const Observation *input, unsigned channels)
Set up and calculate the impulse_pos and impulse_neg attributes.
Definition: Dedispersion.C:65

Generated using doxygen 1.8.17