VariableTransformation.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2022 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Polarimetry/Pulsar/VariableTransformation.h
10
11#ifndef __CalibrationVariableTransformation_H
12#define __CalibrationVariableTransformation_H
13
14#include "MEAL/Complex2.h"
15#include "MEAL/Nvariate.h"
16#include "MEAL/ProductRule.h"
17#include "MEAL/ChainRule.h"
18#include "MEAL/Value.h"
19
20#include "Estimate.h"
21#include "Stokes.h"
22
23#include <map>
24
25namespace Calibration {
26
28
29 class VariableTransformation : public MEAL::ProductRule<MEAL::Complex2>
30 {
33
35 MEAL::Value<MEAL::Complex2> pre_correction;
36
39
41 MEAL::Value<MEAL::Complex2> post_correction;
42
44 std::map< unsigned, Reference::To< MEAL::Nvariate<MEAL::Scalar> > > function;
45
46 public:
47
50
53
56
59
62
65
67 const MEAL::Complex2* get_model () const;
69
71 void set_constraint (unsigned index, MEAL::Nvariate<MEAL::Scalar>*);
72
74 unsigned get_nconstraint () const { return function.size(); }
75
77 unsigned get_index (unsigned j);
78
80 bool has_constraint (unsigned index) { return function.find(index) != function.end(); }
81
83 MEAL::Nvariate<MEAL::Scalar>* get_constraint (unsigned index) { return function.at(index); }
84
85 class Argument
86 {
87 public:
88
90 Jones<double> pre_correction;
91
93 Jones<double> post_correction;
94
96 std::map< unsigned, std::vector<double> > arguments;
97 };
98
99 void set_argument (const Argument&);
100
101 private:
102
104 void init ();
105
106 };
107
109 std::string axis_value_to_string(const VariableTransformation::Argument&);
110
111}
112
113#endif
114
void set_constraint(unsigned index, MEAL::Nvariate< MEAL::Scalar > *)
Set the multivariate function that constrains the specified parameter.
Definition VariableTransformation.C:83
MEAL::Nvariate< MEAL::Scalar > * get_constraint(unsigned index)
Get the constraining function for the specified index.
Definition VariableTransformation.h:83
unsigned get_nconstraint() const
Get the number of constrained parameters.
Definition VariableTransformation.h:74
bool has_constraint(unsigned index)
Return true if the index is constrained.
Definition VariableTransformation.h:80
void set_model(MEAL::Complex2 *)
Set the model that is constrained by abscissae.
Definition VariableTransformation.C:66
VariableTransformation * clone() const
Clone operator.
Definition VariableTransformation.C:61
unsigned get_index(unsigned j)
Get the index of the jth constrained parameter.
Definition VariableTransformation.C:96
const MEAL::Complex2 * get_model() const
Get the model that is constrained by abscissae.
Definition VariableTransformation.C:77
~VariableTransformation()
Destructor.
Definition VariableTransformation.C:54
const VariableTransformation & operator=(const VariableTransformation &s)
Assignment Operator.
Definition VariableTransformation.C:38
VariableTransformation()
Default Constructor.
Definition VariableTransformation.C:25

Generated using doxygen 1.14.0