ConfigurableProjection.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_ConfigurableProjection_h
10#define __Pulsar_ConfigurableProjection_h
11
12#include "Pulsar/VariableProjectionCorrection.h"
13#include "Pulsar/VariableTransformation.h"
14
15#include "Pulsar/ConfigurableProjectionExtension.h"
16
17#include "MEAL/Axis.h"
18
19namespace Pulsar
20{
23 {
24 public:
25
27 ConfigurableProjection (const std::string& filename);
28
31
33 void construct (const std::string&);
34
36 void set_archive (const Archive* _archive);
37
39 void set_subint (unsigned _subint);
40
42 void set_chan (unsigned _chan);
43
44 class Transformation;
45
47 void set_nchan (unsigned nchan) override;
48
50 Transformation* get_transformation (unsigned ichan) override;
51
54
56 const Transformation* get_transformation (unsigned ichan) const;
57
59 bool get_transformation_valid (unsigned ichan) const;
60
62 unsigned get_nchan () const;
63
65 unsigned get_ndim () const;
66
68 double get_value (const std::string& name);
69
71 const std::vector<std::string>& get_abscissa_names (unsigned index) { return parameters.at(index); }
72
74 const std::string& get_configuration() const { return configuration; }
75
77 class Info;
78
80
81 void calibrate (Archive*);
82
84 void transform (Archive*);
85
88
91
92 protected:
93
95 std::string configuration;
96
99
101
103
105 std::map< unsigned, std::vector<std::string> > parameters;
106
107 std::vector< Reference::To<Transformation> > xforms;
108
110 unsigned effective_ndim = 0;
111
113 void transform_work (Archive* arch, const std::string& name, bool invert);
114
115 public:
116
117 class Transformation : public VariableTransformationManager::Transformation
118 {
119 protected:
120
123
126
127 public:
128
129 Transformation (Calibration::VariableTransformation* xform)
130 {
131 transformation = xform;
132 argument.signal.connect (xform, &Calibration::VariableTransformation::set_argument);
133 }
134
137 { return transformation; }
138
141 { return transformation; }
142
144 MEAL::Argument* get_argument () { return &argument; }
145 };
146
147 };
148
149 void copy (MEAL::Complex2* to, const ConfigurableProjectionExtension::Transformation* from);
150
151 void copy (ConfigurableProjectionExtension::Transformation* to, const MEAL::Complex2* from);
152
153}
154
155#endif
Product of multi-variate model of antenna and known corrections.
Definition VariableTransformation.h:30
virtual MEAL::Argument * get_argument()=0
The primary interface to pulsar observational data.
Definition Archive.h:46
Intermediate storage of MEAL::Complex parameters.
Definition ConfigurableProjectionExtension.h:135
Stores ConfigurableProjection parameters in an Archive instance.
Definition ConfigurableProjectionExtension.h:24
bool get_transformation_valid(unsigned ichan) const
Return true if the speficied channel has a valid solution.
Definition ConfigurableProjection.C:313
void set_subint(unsigned _subint)
Set the sub-integration for which a tranformation will be computed.
Definition ConfigurableProjection.C:255
unsigned get_nchan() const
Get the number of frequency channels.
Definition ConfigurableProjection.C:273
Transformation * get_transformation(unsigned ichan) override
Return the Transformation for the specified channel.
Definition ConfigurableProjection.C:284
void transform_work(Archive *arch, const std::string &name, bool invert)
Performs the work for calibrate and transform.
Definition ConfigurableProjection.C:413
const std::string & get_configuration() const
Get the configuration text from which this instance was constructed.
Definition ConfigurableProjection.h:74
void set_archive(const Archive *_archive)
Set the Archive for which a tranformation will be computed.
Definition ConfigurableProjection.C:248
void set_projection(KnownVariableTransformation *known)
Set the projection from the antenna to the celestial reference frame.
Definition ConfigurableProjection.h:87
KnownVariableTransformation * get_projection()
Get the projection from the antenna to the celestial reference frame.
Definition ConfigurableProjection.h:90
Reference::To< Calibration::VariableTransformation > transformation
Model inserted between instrument and projection.
Definition ConfigurableProjection.h:102
unsigned get_ndim() const
Get the number of abscissa / dimensions that describe the variability.
Definition ConfigurableProjection.C:278
const std::vector< std::string > & get_abscissa_names(unsigned index)
Return the attribute names for each abscissa of the function constraining the specified index.
Definition ConfigurableProjection.h:71
std::map< unsigned, std::vector< std::string > > parameters
Names of Archive attributes assigned to each abscissa/dimension.
Definition ConfigurableProjection.h:105
MEAL::Argument::Value * new_value() override
Return a newly constructed Argument::Value for the current archive / subint / chan.
Definition ConfigurableProjection.C:320
void construct(const std::string &)
Construct from a configuration string.
Definition ConfigurableProjection.C:123
Reference::To< KnownVariableTransformation > projection
Known/fixed projection correction.
Definition ConfigurableProjection.h:98
void set_chan(unsigned _chan)
Set the frequency channel for which a tranformation will be computed.
Definition ConfigurableProjection.C:262
double get_value(const std::string &name)
Return the value associated with the parameter name.
Definition ConfigurableProjection.C:370
ConfigurableProjection(const std::string &filename)
Construct from a configuration file.
Definition ConfigurableProjection.C:103
void set_nchan(unsigned nchan) override
Set the number of frequency channels with a unique Transformation.
Definition ConfigurableProjection.C:268
void calibrate(Archive *)
Calibrate an observation.
Definition ConfigurableProjection.C:403
void transform(Archive *)
Subject an observation to the transformation (inverse of calibration)
Definition ConfigurableProjection.C:408
std::string configuration
Configuration string.
Definition ConfigurableProjection.h:95
unsigned effective_ndim
The effective number of dimensions / abscissa.
Definition ConfigurableProjection.h:110
Manager of variable transformations.
Definition KnownVariableTransformation.h:37
VariableTransformationManager()
Default constructor.
Definition VariableTransformationManager.C:16
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0