ImageCorrection.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2018 by Paul Demorest
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/Pulsar/ImageCorrection.h
10
11#ifndef __Pulsar_ImageCorrection_h
12#define __Pulsar_ImageCorrection_h
13
14#include "Pulsar/Transformation.h"
15
16#include "TextInterface.h"
17
18namespace Pulsar {
19
20 class Archive;
21 class Integration;
22
24 class ImageCorrection : public Transformation<Integration> {
25
26 public:
27
30
32 void correct (Archive*);
33
35 void transform (Integration*);
36
39
41 class Interface;
42
44 void set_strict(bool flag=true) { strict = flag; }
45
47 bool get_strict() const { return strict; }
48
50 void set_coherent(bool flag=true) { coherent = flag; }
51
53 bool get_coherent() const { return coherent; }
54
56 void set_fadc(double f) { f_cent_adc = f; }
57
59 double get_fadc() const { return f_cent_adc; }
60
62 void set_fcenter(double f) { f_cent_sky = f; }
63
65 double get_fcenter() const { return f_cent_sky; }
66
68 void set_band_dir(int d) { dir = d; }
69
71 int get_band_dir() const { return dir; }
72
74 void set_dt(double dt0, double dt1) { dt[0]=dt0; dt[1]=dt1; }
75
77 void set_gain(double a0, double a1) { alpha[0]=a0; alpha[1]=a1; }
78
79 protected:
80
82 double f_cent_adc;
83
85 double f_cent_sky;
86
88 int dir;
89
90 // Note, all of the above imply that the conversion between
91 // sky freq (f_sky) and sampled freq (f_adc) are:
92 // f_adc = dir*(f_sky-f_cent_sky) + f_cent_adc
93 double f_adc(double f_sky) const
94 {
95 return (double)dir*(f_sky-f_cent_sky) + f_cent_adc;
96 }
97
99 bool strict;
100
103
105 double dt[2];
106
108 double alpha[2];
109
111 // into channel at 2*f_center - f
112 double ratio(double f, unsigned ipol) const;
113
115 int match_channel(const Integration *subint, double f_sky) const;
116
117 };
118
119}
120
121#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
double get_fcenter() const
Get sky center freq.
Definition ImageCorrection.h:65
void set_fcenter(double f)
Set sky center freq.
Definition ImageCorrection.h:62
bool get_strict() const
Get strict setting.
Definition ImageCorrection.h:47
void set_strict(bool flag=true)
Set strict mode.
Definition ImageCorrection.h:44
int get_band_dir() const
Get band direction.
Definition ImageCorrection.h:71
int match_channel(const Integration *subint, double f_sky) const
Find channel matching given sky freq, returns -1 for no match.
Definition ImageCorrection.C:166
bool coherent
Set true if data have been coherently dedispersed.
Definition ImageCorrection.h:102
virtual TextInterface::Parser * get_interface()
Return a text interface that can be used to configure this instance.
Definition ImageCorrection.C:213
double f_cent_adc
The center frequency of the band at the ADC (MHz)
Definition ImageCorrection.h:82
double dt[2]
The time misalignment between samplers, per-poln (us)
Definition ImageCorrection.h:105
void set_fadc(double f)
Set center freq at sampler.
Definition ImageCorrection.h:56
double ratio(double f, unsigned ipol) const
The ratio of image power from input sampler freq f.
Definition ImageCorrection.C:148
bool get_coherent() const
Get coherent dedisp flag.
Definition ImageCorrection.h:53
double f_cent_sky
The center sky frequency of the sampled band (MHz)
Definition ImageCorrection.h:85
ImageCorrection()
Default constructor.
Definition ImageCorrection.C:21
int dir
Band direction at the sampler.
Definition ImageCorrection.h:88
void correct(Archive *)
Perform correction on full archive.
Definition ImageCorrection.C:32
void set_band_dir(int d)
Set band direction at sampler.
Definition ImageCorrection.h:68
double get_fadc() const
Set center freq at sampler.
Definition ImageCorrection.h:59
bool strict
strict==true means uncorrectable channels will be zero-weighted
Definition ImageCorrection.h:99
void set_gain(double a0, double a1)
Set gain per poln.
Definition ImageCorrection.h:77
void set_coherent(bool flag=true)
Set coherent dedisp flag.
Definition ImageCorrection.h:50
void set_dt(double dt0, double dt1)
Set dt per poln.
Definition ImageCorrection.h:74
double alpha[2]
The gain mismatch between samplers, per-poln.
Definition ImageCorrection.h:108
void transform(Integration *)
Perform correction on one integration.
Definition ImageCorrection.C:62
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
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