ReferenceCalibrator.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// psrchive/More/Polarimetry/Pulsar/ReferenceCalibrator.h
10
11#ifndef __Pulsar_ReferenceCalibrator_H
12#define __Pulsar_ReferenceCalibrator_H
13
14#include "Pulsar/PolnCalibrator.h"
15#include "Pulsar/Config.h"
16
17#include "Estimate.h"
18#include "Stokes.h"
19#include "Types.h"
20
21namespace Pulsar {
22
23 class Integration;
24
27 {
28
29 void init ();
30
31 public:
32
35
38 const Archive*);
39
41 ReferenceCalibrator (const Archive* archive);
42
45
47 virtual ReferenceCalibrator* clone () const = 0;
48
51
53 void set_reference_source (const Stokes< Estimate<double> >& stokes);
54
56 Stokes< Estimate<double> > get_reference_source () const;
57
60
62 float get_outlier_threshold () const { return outlier_threshold; }
63
65 void get_levels (unsigned nchan,
66 std::vector<std::vector<Estimate<double> > >& hi,
67 std::vector<std::vector<Estimate<double> > >& lo) const;
68
70 static void get_levels (const Archive* archive,
71 Index subint, unsigned nchan,
72 std::vector<std::vector<Estimate<double> > >& hi,
73 std::vector<std::vector<Estimate<double> > >& lo,
74 double outlier_threshold);
75
77 static void get_levels (const Integration* integration, unsigned nchan,
78 std::vector<std::vector<Estimate<double> > >& hi,
79 std::vector<std::vector<Estimate<double> > >& lo,
80 double outlier_threshold);
81
82 // ///////////////////////////////////////////////////////////////////
83 //
84 // Pulsar::PolnCalibrator over-ride
85 //
86 // ///////////////////////////////////////////////////////////////////
87
89 virtual void set_nchan (unsigned nchan);
90
91 protected:
92
94 std::vector< Estimate<double> > baseline;
95
97 Stokes< Estimate<double> > reference_source;
98
100 void set_calibrator (const Archive* archive);
101
104
107
110
111 // ///////////////////////////////////////////////////////////////////
112 //
113 // Pulsar::Calibrator implementation
114 //
115 // ///////////////////////////////////////////////////////////////////
116
119
121 void calculate (std::vector<std::vector<Estimate<double> > >& hi,
122 std::vector<std::vector<Estimate<double> > >& lo);
123
125 virtual MEAL::Complex2*
126 solve (const std::vector<Estimate<double> >& hi,
127 const std::vector<Estimate<double> >& lo) = 0;
128
130 virtual void extra (unsigned ichan,
131 const std::vector< Estimate<double> >& source,
132 const std::vector< Estimate<double> >& sky) { }
133
134 };
135
136}
137
138#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
Definition CalibratorType.h:26
Combines an index value and integrate flag.
Definition Index.h:19
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Configuration option.
Definition Config.h:69
PolnCalibrator(const Archive *archive=0)
Construct with optional processed calibrator Archive.
Definition PolnCalibrator.C:76
double outlier_threshold
Threshold used to reject outliers when computing levels.
Definition ReferenceCalibrator.h:109
static ReferenceCalibrator * factory(const Calibrator::Type *, const Archive *)
Factory creates instances of derived types.
Definition ReferenceCalibrator.C:496
std::vector< Estimate< double > > baseline
Intensity of off-pulse (system + sky), in CAL flux units.
Definition ReferenceCalibrator.h:94
virtual MEAL::Complex2 * solve(const std::vector< Estimate< double > > &hi, const std::vector< Estimate< double > > &lo)=0
Derived classes must perform the actual solution.
Stokes< Estimate< double > > reference_source
The Stokes parameters of the reference source.
Definition ReferenceCalibrator.h:97
static Option< bool > smooth_bandpass
If true, then a median filter is run on the calibrator bandpass.
Definition ReferenceCalibrator.h:34
~ReferenceCalibrator()
Destructor.
Definition ReferenceCalibrator.C:34
void set_calibrator(const Archive *archive)
Filter access to the calibrator.
Definition ReferenceCalibrator.C:39
void get_levels(unsigned nchan, std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo) const
Return the mean levels of the calibrator hi and lo states.
Definition ReferenceCalibrator.C:358
virtual void extra(unsigned ichan, const std::vector< Estimate< double > > &source, const std::vector< Estimate< double > > &sky)
Derived classes may also compute other things.
Definition ReferenceCalibrator.h:130
virtual ReferenceCalibrator * clone() const =0
Clone operator.
void calculate(std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo)
Does the calculation of the above.
ReferenceCalibrator(const Archive *archive)
Construct from an single PolnCal Pulsar::Archive.
Definition ReferenceCalibrator.C:86
void set_outlier_threshold(float f)
Set the threshold used to reject outliers when computing levels.
Definition ReferenceCalibrator.h:59
void calculate_transformation()
Solve using the observation of the reference source.
Definition ReferenceCalibrator.C:369
virtual void set_nchan(unsigned nchan)
Set the number of frequency channels in the response array.
Definition ReferenceCalibrator.C:147
unsigned requested_nchan
Requested number of frequency channels.
Definition ReferenceCalibrator.h:106
Stokes< Estimate< double > > get_reference_source() const
Get the Stokes parameters of the reference source.
Definition ReferenceCalibrator.C:138
void set_reference_source(const Stokes< Estimate< double > > &stokes)
Set the Stokes parameters of the reference source.
Definition ReferenceCalibrator.C:130
float get_outlier_threshold() const
Get the threshold used to reject outliers when computing levels.
Definition ReferenceCalibrator.h:62
bool source_set
Flag raised when the reference_source attribute is set.
Definition ReferenceCalibrator.h:103
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0