KnownVariableTransformation.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#ifndef __Pulsar_KnownVariableTransformation_h
10#define __Pulsar_KnownVariableTransformation_h
11
12#include "Pulsar/VariableTransformationManager.h"
13#include "MEAL/Axis.h"
14#include "MEAL/Value.h"
15
16namespace Pulsar {
17
19 template<typename T>
20 class LabelledJones : public Jones<T>
21 {
22 public:
23 std::string label;
24
25 LabelledJones() {}
26
27 template<typename U>
28 LabelledJones(const Jones<U>& jones) : Jones<T>(jones) {}
29 };
30
32 template<typename T>
33 std::string axis_value_to_string(const LabelledJones<T>& jones) { return jones.label; }
34
37 {
38 public:
39
40 typedef MEAL::Axis< LabelledJones<double> > KnownArgument;
41 typedef MEAL::Value< MEAL::Complex2 > KnownTransformation;
42
43 class Transformation : public VariableTransformationManager::Transformation
44 {
45 protected:
46
48 KnownArgument argument;
50 KnownTransformation transformation;
51
52 friend class KnownVariableTransformation;
53
54 public:
55
56 Transformation ()
57 {
58 argument.signal.connect (&transformation, &KnownTransformation::set_value);
59 }
60
62 MEAL::Complex2* get_transformation () { return &transformation; }
63
65 MEAL::Argument* get_argument () { return &argument; }
66 };
67
69 void set_nchan (unsigned nchan) override;
70
72 Transformation* get_transformation (unsigned ichan) override;
73
76
79
80 protected:
81
82 std::vector<Transformation> xform;
83 };
84}
85
86#endif
Jones(T scalar=0.0)
void set_value(const Result &_value)
virtual MEAL::Argument * get_argument()=0
Manager of variable transformations.
Definition KnownVariableTransformation.h:37
Transformation * get_transformation(unsigned ichan) override
Return the Transformation for the specified channel.
Definition KnownVariableTransformation.C:18
MEAL::Argument::Value * new_value() override
Return a newly constructed Argument::Value for the current archive / subint / chan.
Definition KnownVariableTransformation.C:26
void set_nchan(unsigned nchan) override
Set the number of frequency channels with a unique Transformation.
Definition KnownVariableTransformation.C:12
virtual LabelledJones< double > get_value()=0
Derived classes define the known transformation.
A Jones matrix with a label.
Definition KnownVariableTransformation.h:21
VariableTransformationManager()
Default constructor.
Definition VariableTransformationManager.C:16
Defines the PSRCHIVE library.
Definition CalSource.h:17
std::string axis_value_to_string(const LabelledJones< T > &jones)
Specialize the template defined in MEAL/Axis.h.
Definition KnownVariableTransformation.h:33

Generated using doxygen 1.14.0