PolnCalibratorExtension.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2003-2009 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Base/Extensions/Pulsar/PolnCalibratorExtension.h
10
11#ifndef __PolnCalibratorExtension_h
12#define __PolnCalibratorExtension_h
13
14#include "Pulsar/CalibratorExtension.h"
15
16namespace Pulsar {
17
18 class PolnCalibrator;
19
21
24
25 public:
26
29
32
35
38
41 { return new PolnCalibratorExtension( *this ); }
42
45
46 // Text interface to a PolnCalibratorExtension instance
47 class Interface : public TextInterface::To<PolnCalibratorExtension>
48 {
49 public:
50 Interface( PolnCalibratorExtension *s_instance = NULL );
51 };
52
54 PolnCalibratorExtension (const PolnCalibrator*);
55
57 std::string get_short_name () const override { return "pcal"; }
58
60 void set_type (const Calibrator::Type* type) override;
61
63 void set_nchan (unsigned nchan) override;
64
66 void remove_chan (unsigned first, unsigned last) override;
67
69 void set_weight (unsigned ichan, float weight) override;
71 float get_weight (unsigned ichan) const override;
72
74 unsigned get_nparam () const;
75
77 void set_ndim (unsigned);
79 unsigned get_ndim () const;
80
82 bool get_has_covariance () const;
84 void set_has_covariance (bool);
85
87 bool get_has_solver () const;
89 void set_has_solver (bool);
90
92 bool get_valid (unsigned ichan) const;
93 void set_valid (unsigned ichan, bool valid);
94
95 class Transformation;
96
100 const Transformation* get_transformation (unsigned c) const;
101
103 void frequency_append (Archive* to, const Archive* from) override;
104
105 void fscrunch (unsigned factor = 0);
106 void fscrunch_to_nchan (unsigned new_nchan);
107
108 Estimate<float> get_Estimate ( unsigned iparam, unsigned ichan ) const;
109 void set_Estimate (unsigned iparam, unsigned ichan, const Estimate<float>&);
110
111 protected:
112
114 std::vector<Transformation> response;
115
117 unsigned nparam = 0;
118
120 unsigned ndim = 0;
121
123 bool has_covariance = false;
124
126 bool has_solver = false;
127
129 void construct ();
130
131 private:
132
133 void init ();
134
135 };
136
139 {
140 public:
141
144
146 unsigned get_nparam() const;
148 void set_nparam (unsigned);
149
151 std::string get_param_name (unsigned) const;
153 void set_param_name (unsigned, const std::string&);
154
156 std::string get_param_description (unsigned) const;
158 void set_param_description (unsigned, const std::string&);
159
161 double get_param (unsigned) const;
163 void set_param (unsigned, double);
164
166 double get_variance (unsigned) const;
168 void set_variance (unsigned, double);
169
171 std::vector< std::vector<double> > get_covariance () const;
173 void set_covariance (const std::vector< std::vector<double> >&);
174
176 void get_covariance (std::vector<double>&) const;
178 void set_covariance (const std::vector<double>&);
179
181 Estimate<double> get_Estimate (unsigned) const;
183 void set_Estimate (unsigned, const Estimate<double>&);
184
186 bool get_valid () const;
188 void set_valid (bool);
189
191 double get_chisq () const;
193 void set_chisq (double);
194
196 double get_log_det_curvature () const;
198 void set_log_det_curvature (double);
199
201 double get_log_cond_curvature () const;
203 void set_log_cond_curvature (double);
204
206 unsigned get_nfree() const;
208 void set_nfree (unsigned);
209
211 unsigned get_nfit() const;
213 void set_nfit (unsigned);
214
216 unsigned get_ndim() const;
218 void set_ndim (unsigned);
219
221 double get_reduced_chisq () const;
222
225
228
231
234
235 // Text interface to a PolnCalibratorExtension instance
236 class Interface : public TextInterface::To<Transformation>
237 {
238 public:
239 Interface();
240 };
241
242 protected:
243
244 std::vector< Estimate<double> > params;
245 std::vector< std::string > names;
246 std::vector< std::string > descriptions;
247
248 std::vector<double> covariance;
249 double chisq = 0.0;
250 double log_det_curvature = 0.0;
251 double log_cond_curvature = 0.0;
252 unsigned nfree = 0;
253 unsigned nfit = 0;
254
257 unsigned ndim = 0;
258 bool valid = false;
259
260 };
261
262}
263
264#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
Reference::To< const Calibrator::Type > type
Type of the calibrator.
Definition CalibratorExtension.h:87
CalibratorExtension(const char *name="CalibratorExtension")
Default constructor.
Definition CalibratorExtension.C:16
Definition CalibratorType.h:26
Intermediate storage of MEAL::Complex parameters.
Definition PolnCalibratorExtension.h:139
bool get_valid() const
Get the model validity flag.
Definition PolnCalibratorExtension.C:328
void set_log_det_curvature(double)
Set the logarithm of the determinant of the curvature matrix.
Definition PolnCalibratorExtension.C:391
unsigned get_nfree() const
Get the number of degrees of freedom.
Definition PolnCalibratorExtension.C:348
double get_chisq() const
Get the best fit value of chi squared.
Definition PolnCalibratorExtension.C:338
std::string get_param_name(unsigned) const
Get the name of the specified model parameter.
Definition PolnCalibratorExtension.C:259
Estimate< double > get_Estimate(unsigned) const
Get the value and variance of the specified model parameter.
Definition PolnCalibratorExtension.C:315
void set_chisq(double)
Set the best fit value of chi squared.
Definition PolnCalibratorExtension.C:343
double get_log_det_curvature() const
Get the logarithm of the determinant of the curvature matrix.
Definition PolnCalibratorExtension.C:386
Transformation()
Default constructor.
Definition PolnCalibratorExtension.C:243
void set_nfit(unsigned)
Set the number of model parameters varied to find best fit.
Definition PolnCalibratorExtension.C:363
double get_reduced_chisq() const
Get the best fit value of the reduced chi squared = chisq/nfree.
Definition PolnCalibratorExtension.C:378
std::vector< std::vector< double > > get_covariance() const
Get the covariance matrix of the model paramters.
Definition PolnCalibratorExtension.C:454
void set_param(unsigned, double)
Set the value of the specified model parameter.
Definition PolnCalibratorExtension.C:300
void set_nparam(unsigned)
Set the number of model parameters.
Definition PolnCalibratorExtension.C:286
double get_geometric_information_criterion() const
Get the geometric information criterion.
Definition PolnCalibratorExtension.C:426
void set_param_name(unsigned, const std::string &)
Set the name of the specified model parameter.
Definition PolnCalibratorExtension.C:266
void set_param_description(unsigned, const std::string &)
Set the description of the specified model parameter.
Definition PolnCalibratorExtension.C:281
void set_valid(bool)
Set the model validity flag.
Definition PolnCalibratorExtension.C:333
double get_log_cond_curvature() const
Get the logarithm of the condition number of the curvature matrix.
Definition PolnCalibratorExtension.C:396
double get_stochastic_information_complexity() const
Get the stochastic information complexity.
Definition PolnCalibratorExtension.C:439
void set_variance(unsigned, double)
Set the variance of the specified model parameter.
Definition PolnCalibratorExtension.C:310
double get_param(unsigned) const
Get the value of the specified model parameter.
Definition PolnCalibratorExtension.C:294
double get_Akaike_information_criterion() const
Get the Akaike information criterion.
Definition PolnCalibratorExtension.C:406
double get_Bayesian_information_criterion() const
Get the Bayesian information criterion.
Definition PolnCalibratorExtension.C:417
unsigned get_ndim() const
Get the number of abscissa / dimensions.
Definition PolnCalibratorExtension.C:368
std::string get_param_description(unsigned) const
Get the description of the specified model parameter.
Definition PolnCalibratorExtension.C:273
unsigned get_nfit() const
Get the number of model parameters varied to find best fit.
Definition PolnCalibratorExtension.C:358
double get_variance(unsigned) const
Get the variance of the specified model parameter.
Definition PolnCalibratorExtension.C:305
void set_Estimate(unsigned, const Estimate< double > &)
Set the value and variance of the specified model parameter.
Definition PolnCalibratorExtension.C:323
unsigned get_nparam() const
Get the number of model parameters.
Definition PolnCalibratorExtension.C:252
void set_nfree(unsigned)
Set the number of degress of freedom.
Definition PolnCalibratorExtension.C:353
void set_log_cond_curvature(double)
Set the logarithm of the condition number of the curvature matrix.
Definition PolnCalibratorExtension.C:401
void set_ndim(unsigned)
Set the number of abscissa / dimensions.
Definition PolnCalibratorExtension.C:373
void set_covariance(const std::vector< std::vector< double > > &)
Set the covariance matrix of the model paramters.
Definition PolnCalibratorExtension.C:481
unsigned ndim
Definition PolnCalibratorExtension.h:257
Stores PolnCalibrator parameters in an Archive instance.
Definition PolnCalibratorExtension.h:23
void set_has_solver(bool)
Return true if information about the solution is available.
Definition PolnCalibratorExtension.C:161
unsigned nparam
The number of parameters that describe the transformation.
Definition PolnCalibratorExtension.h:117
void frequency_append(Archive *to, const Archive *from) override
Append PolnCalibrator Extension data from another Archive.
Definition PolnCalibratorExtension.C:212
unsigned ndim
The number of abscissa / dimensions in the model.
Definition PolnCalibratorExtension.h:120
bool has_covariance
The covariances of the transformation parameters are available.
Definition PolnCalibratorExtension.h:123
PolnCalibratorExtension * clone() const
Clone method.
Definition PolnCalibratorExtension.h:40
~PolnCalibratorExtension()
Destructor.
Definition PolnCalibratorExtension.C:67
TextInterface::Parser * get_interface()
get the text ineterface
Definition PolnCalibratorExtension.C:552
Transformation * get_transformation(unsigned c)
Get the transformation for the specified frequency channel.
Definition PolnCalibratorExtension.C:168
float get_weight(unsigned ichan) const override
Get the weight of the specified channel.
Definition PolnCalibratorExtension.C:100
unsigned get_nparam() const
Get the number of parameters describing each transformation.
Definition PolnCalibratorExtension.C:128
void remove_chan(unsigned first, unsigned last) override
Remove the inclusive range of channels.
Definition PolnCalibratorExtension.C:87
bool get_has_covariance() const
Return true if the covariances of the model parameters are available.
Definition PolnCalibratorExtension.C:144
bool get_valid(unsigned ichan) const
Return true if the transformation for the specified channel is valid.
Definition PolnCalibratorExtension.C:110
bool get_has_solver() const
Return true if information about the solution is available.
Definition PolnCalibratorExtension.C:155
bool has_solver
The solver statistics are available.
Definition PolnCalibratorExtension.h:126
unsigned get_ndim() const
Get the number of abscissa / dimensions in the model.
Definition PolnCalibratorExtension.C:139
void construct()
Construct the response array according to the current attributes.
Definition PolnCalibratorExtension.C:199
void fscrunch(unsigned factor=0)
Definition PolnCalExtFreqIntegrate.C:133
std::string get_short_name() const override
Return a short name.
Definition PolnCalibratorExtension.h:57
const PolnCalibratorExtension & operator=(const PolnCalibratorExtension &)
Operator =.
Definition PolnCalibratorExtension.C:43
void set_has_covariance(bool)
Set true when the covariances of the model parameters are available.
Definition PolnCalibratorExtension.C:149
void set_ndim(unsigned)
Set the number of abscissa / dimensions in the model.
Definition PolnCalibratorExtension.C:133
PolnCalibratorExtension()
Default constructor.
Definition PolnCalibratorExtension.C:19
void set_weight(unsigned ichan, float weight) override
Set the weight of the specified channel.
Definition PolnCalibratorExtension.C:94
void set_nchan(unsigned nchan) override
Set the number of frequency channels.
Definition PolnCalibratorExtension.C:80
void set_type(const Calibrator::Type *type) override
Set the type of the instrumental response parameterization.
Definition PolnCalibratorExtension.C:72
std::vector< Transformation > response
The instrumental response as a function of frequency.
Definition PolnCalibratorExtension.h:114
Polarimetric calibrators.
Definition PolnCalibrator.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